#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 EXIT_SUCCESS;
int /*<<< orphan*/ free(unsigned long *);
int /*<<< orphan*/ printOutput(int, unsigned long *);
int /*<<< orphan*/ readInputFile(char *, int *, unsigned long **);
int main(int argc, char **argv) {
  char *fileName;
  if (argc == 1) {
    fileName = "testInput";
  } else {
    fileName = argv[1];
  }
  int numberOfCases;
  unsigned long *cases;
  readInputFile(fileName, &numberOfCases, &cases);
  printOutput(numberOfCases, cases);
  free(cases);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1160 <main+0x30>
lea    0xea9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    116c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <readInputFile@plt>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1040 <printOutput@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
cmp    $0x1,%edi
jne    1142 <main+0x12>
lea    0xec0(%rip),%rdi
jmp    1146 <main+0x16>
mov    0x8(%rsi),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1050 <readInputFile@plt>
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%rsi
call   1040 <printOutput@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"testInput\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %6
br label %16
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
store i8* %15, i8** %6
br label %16
16: ; preds = %12, %11
%17 = load i8*, i8** %6
%18 = call i32 @readInputFile(i8* %17, i32* %7, i64** %8)
%19 = load i32, i32* %7
%20 = load i64*, i64** %8
%21 = call i32 @printOutput(i32 %19, i64* %20)
%22 = load i64*, i64** %8
%23 = call i32 @free(i64* %22)
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

LLVM IR (-O2):
@.str = [10 x i8] c"testInput\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = icmp eq i32 %0, 1
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
br label %9
9: ; preds = %2, %6
%10 = phi i8* [ %8, %6 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%11 = bitcast i32* %3 to i8*
%12 = bitcast i64** %4 to i8*
%13 = call i32 @readInputFile(i8* %10, i32* %3, i64** %4)
%14 = load i32, i32* %3
%15 = load i64*, i64** %4
%16 = call i32 @printOutput(i32 %14, i64* %15)
%17 = load i64*, i64** %4
%18 = call i32 @free(i64* %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}