#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ calcSetup();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runTestbench(int, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int numberOfWords;
  if (argc == 3) {
    calcSetup();
    numberOfWords = atoi(argv[2]);
    runTestbench(numberOfWords, argv[1], 0);
    return 0;
  } else {
    printf("Usage: input_name output_0_name number_of_bytes\n");
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1195 <main+0x55>
mov    $0x0,%al
call   1030 <calcSetup@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
xor    %edx,%edx
call   1050 <runTestbench@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <main+0x68>
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    116c <main+0x2c>
mov    %rsi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <calcSetup@plt>
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    0x8(%rbx),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1050 <runTestbench@plt>
jmp    117d <main+0x3d>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: input_name output_0_name number_of_bytes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 3
br i1 %8, label %9, label %20
9: ; preds = %2
%10 = call i32 (...) @calcSetup()
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 2
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @runTestbench(i32 %15, i8* %18, i32 0)
store i32 0, i32* %3
br label %22
20: ; preds = %2
%21 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %22
22: ; preds = %20, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@str = [48 x i8] c"Usage: input_name output_0_name number_of_bytes\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = tail call i32 (...) @calcSetup()
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @runTestbench(i32 %8, i8* %10, i32 0)
br label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %4
%15 = phi i32 [ 0, %4 ], [ -1, %12 ]
ret i32 %15
}