#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*/ difCode();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ multipleValue();
int /*<<< orphan*/ scaleForObix();
int /*<<< orphan*/ singleValue();
int /*<<< orphan*/ singleValueWithVariableLength();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vifCode();
int main(int argc, char **argv) {
  int nbLoops = 1;
  int i = 0;
  if (argc == 2) {
    nbLoops = atoi(argv[0]);
  }
  for (i = 0; i < nbLoops; i++) {
    fprintf(stderr, "###### %d ######\n", i);
    singleValue();
    multipleValue();
    singleValueWithVariableLength();
    vifCode();
    difCode();
    scaleForObix();
  }
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11bd <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1220 <main+0xa0>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xe1d(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1080 <singleValue@plt>
mov    $0x0,%al
call   1040 <multipleValue@plt>
mov    $0x0,%al
call   1070 <singleValueWithVariableLength@plt>
mov    $0x0,%al
call   1030 <vifCode@plt>
mov    $0x0,%al
call   1050 <difCode@plt>
mov    $0x0,%al
call   10a0 <scaleForObix@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11c4 <main+0x44>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x2,%edi
jne    119f <main+0x1f>
mov    (%rsi),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    11ee <main+0x6e>
mov    0x2e3a(%rip),%r15
lea    0xe53(%rip),%r14
xor    %ebp,%ebp
nop
mov    (%r15),%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1080 <singleValue@plt>
xor    %eax,%eax
call   1040 <multipleValue@plt>
xor    %eax,%eax
call   1070 <singleValueWithVariableLength@plt>
xor    %eax,%eax
call   1030 <vifCode@plt>
xor    %eax,%eax
call   1050 <difCode@plt>
xor    %eax,%eax
call   10a0 <scaleForObix@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    11b0 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"###### %d ######\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
br label %15
15: ; preds = %10, %2
store i32 0, i32* %7
br label %16
16: ; preds = %30, %15
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %33
20: ; preds = %16
%21 = load i32, i32* @stderr
%22 = load i32, i32* %7
%23 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %22)
%24 = call i32 (...) @singleValue()
%25 = call i32 (...) @multipleValue()
%26 = call i32 (...) @singleValueWithVariableLength()
%27 = call i32 (...) @vifCode()
%28 = call i32 (...) @difCode()
%29 = call i32 (...) @scaleForObix()
br label %30
30: ; preds = %20
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %16
33: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"###### %d ######\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @atoi(i8* %5)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %2, %4
%9 = phi i32 [ %6, %4 ], [ 1, %2 ]
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ %20, %10 ], [ 0, %8 ]
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
%14 = tail call i32 (...) @singleValue()
%15 = tail call i32 (...) @multipleValue()
%16 = tail call i32 (...) @singleValueWithVariableLength()
%17 = tail call i32 (...) @vifCode()
%18 = tail call i32 (...) @difCode()
%19 = tail call i32 (...) @scaleForObix()
%20 = add nuw nsw i32 %11, 1
%21 = icmp eq i32 %20, %9
br i1 %21, label %22, label %10
22: ; preds = %10, %4
ret i32 0
}