int main(int argc, char **argv) {
  int n = 100;
  char files[3][50] = {"in_asc", "in_dsc", "in_rnd"};
  switch (argc) {
  case 3:
    if (sizeof(argv[2]) > (50 - 7)) {
      snprintf(argv[2], 50 - 7, "%s", argv[2]);
    }
    for (int i = 0; i < 3; i++) {
      snprintf(files[i], 50, "%s_%s", files[i], argv[2]);
    }
  case 2:
    n = atoi(argv[1]);
    break;
  }
  char buf[50];
  snprintf(buf, 50, "./generate %s %d 1 1", files[0], n);
  system(buf);
  snprintf(buf, 50, "./generate %s %d 1 0", files[1], n);
  system(buf);
  snprintf(buf, 50, "./generate %s %d 0", files[2], n);
  system(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
lea    0xe99(%rip),%rsi
lea    -0xb0(%rbp),%rdi
mov    $0x96,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xf4(%rbp)
sub    $0x2,%eax
je     1218 <main+0xd8>
jmp    118f <main+0x4f>
mov    -0xf4(%rbp),%eax
sub    $0x3,%eax
jne    122a <main+0xea>
jmp    11a3 <main+0x63>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x3,-0xb4(%rbp)
jge    1213 <main+0xd3>
movslq -0xb4(%rbp),%rax
lea    -0xb0(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
movslq -0xb4(%rbp),%rax
lea    -0xb0(%rbp),%rcx
imul   $0x32,%rax,%rax
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%r8
mov    $0x32,%esi
lea    0xe9e(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11ad <main+0x6d>
jmp    1218 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0xf0(%rbp),%rdi
lea    -0xb0(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x32,%esi
lea    0xe54(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
lea    -0xf0(%rbp),%rdi
lea    -0xb0(%rbp),%rcx
add    $0x32,%rcx
mov    -0x14(%rbp),%r8d
mov    $0x32,%esi
lea    0xe32(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
lea    -0xf0(%rbp),%rdi
lea    -0xb0(%rbp),%rcx
add    $0x64,%rcx
mov    -0x14(%rbp),%r8d
mov    $0x32,%esi
lea    0xe10(%rip),%rdx
mov    $0x0,%al
call   1040 <snprintf@plt>
lea    -0xf0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xea9(%rip),%rsi
mov    %rsp,%rdi
mov    $0x96,%edx
call   1050 <memcpy@plt>
cmp    $0x2,%ebx
je     11c9 <main+0x89>
mov    $0x64,%ebp
cmp    $0x3,%ebx
jne    11d6 <main+0x96>
mov    0x10(%r14),%r8
lea    0xf18(%rip),%rbx
mov    %rsp,%rcx
mov    $0x32,%esi
mov    %rcx,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <snprintf@plt>
lea    0x32(%rsp),%rcx
mov    0x10(%r14),%r8
mov    $0x32,%esi
mov    %rcx,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <snprintf@plt>
lea    0x64(%rsp),%rcx
mov    0x10(%r14),%r8
mov    $0x32,%esi
mov    %rcx,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    0x8(%r14),%rdi
xor    %eax,%eax
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0xebf(%rip),%rdx
lea    0xa0(%rsp),%rbx
mov    %rsp,%rcx
mov    $0x32,%esi
mov    %rbx,%rdi
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
lea    0x32(%rsp),%rcx
lea    0xea1(%rip),%rdx
mov    $0x32,%esi
mov    %rbx,%rdi
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
lea    0x64(%rsp),%rcx
lea    0xe8e(%rip),%rdx
mov    $0x32,%esi
mov    %rbx,%rdi
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <snprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <system@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.files = [3 x [50 x i8]] [[50 x i8] c"in_asc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [50 x i8] c"in_dsc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [50 x i8] c"in_rnd\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [6 x i8] c"%s_%s\00"
@.str.1 = [21 x i8] c"./generate %s %d 1 1\00"
@.str.2 = [21 x i8] c"./generate %s %d 1 0\00"
@.str.3 = [19 x i8] c"./generate %s %d 0\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [3 x [50 x i8]]
%8 = alloca i32
%9 = alloca [50 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%10 = bitcast [3 x [50 x i8]]* %7 to i8*
%11 = load i32, i32* %4
switch i32 %11, label %38 [
i32 3, label %12
i32 2, label %33
]
12: ; preds = %2
store i32 0, i32* %8
br label %13
13: ; preds = %29, %12
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %7, i64 0, i64 %18
%20 = getelementptr inbounds [50 x i8], [50 x i8]* %19, i64 0, i64 0
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %7, i64 0, i64 %22
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %23, i64 0, i64 0
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %20, i64 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %24, i8* %27)
br label %29
29: ; preds = %16
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %13
32: ; preds = %13
br label %33
33: ; preds = %2, %32
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %36)
store i32 %37, i32* %6
br label %38
38: ; preds = %2, %33
%39 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%40 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %7, i64 0, i64 0
%41 = getelementptr inbounds [50 x i8], [50 x i8]* %40, i64 0, i64 0
%42 = load i32, i32* %6
%43 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %39, i64 50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %41, i32 %42)
%44 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%45 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %44)
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%47 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %7, i64 0, i64 1
%48 = getelementptr inbounds [50 x i8], [50 x i8]* %47, i64 0, i64 0
%49 = load i32, i32* %6
%50 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %46, i64 50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %48, i32 %49)
%51 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%52 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %51)
%53 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%54 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %7, i64 0, i64 2
%55 = getelementptr inbounds [50 x i8], [50 x i8]* %54, i64 0, i64 0
%56 = load i32, i32* %6
%57 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %53, i64 50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %55, i32 %56)
%58 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%59 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %58)
ret i32 0
}

LLVM IR (-O2):
@__const.main.files = [3 x [50 x i8]] [[50 x i8] c"in_asc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [50 x i8] c"in_dsc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [50 x i8] c"in_rnd\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@.str = [6 x i8] c"%s_%s\00"
@.str.1 = [21 x i8] c"./generate %s %d 1 1\00"
@.str.2 = [21 x i8] c"./generate %s %d 1 0\00"
@.str.3 = [19 x i8] c"./generate %s %d 0\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x [50 x i8]]
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %3, i64 0, i64 0, i64 0
switch i32 %0, label %20 [
i32 3, label %6
i32 2, label %16
]
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %5, i64 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8)
%10 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %3, i64 0, i64 1, i64 0
%11 = load i8*, i8** %7
%12 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %10, i64 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %3, i64 0, i64 2, i64 0
%14 = load i8*, i8** %7
%15 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %13, i64 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %6, %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %18)
br label %20
20: ; preds = %2, %16
%21 = phi i32 [ 100, %2 ], [ %19, %16 ]
%22 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %22, i64 50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %21)
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %22)
%25 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %3, i64 0, i64 1, i64 0
%26 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %22, i64 50, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %25, i32 %21)
%27 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %22)
%28 = getelementptr inbounds [3 x [50 x i8]], [3 x [50 x i8]]* %3, i64 0, i64 2, i64 0
%29 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %22, i64 50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %28, i32 %21)
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %22)
ret i32 0
}