#!/usr/bin/perl
my @commands;
my @block;
my $count=0;

my $mult=shift;

while (<>) {
	chomp;
	if (/^##\s*repeat\s+(\d+)/) {
		$count=$1 * $mult;
	}
	elsif (/^##\s*endrepeat/) {
		push @commands, @block for 1..$count;
		$count=0;
		@block=();
	}
	next if /^#/ || ! length;
	if ($count) {
		push @block, $_
	}
	else {
		push @commands, $_;
	}
}

# First benchmark a like number of null commands, to determine benchmark
# framework overhead.
print ":starting: null\n";
print " \n" for @commands;

print "$_\n" for @commands;
