#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 /*<<< orphan*/ bar(int);
int fib(int);
int /*<<< orphan*/ foo();
int increment();
int /*<<< orphan*/ print_arr(float *, int);
int /*<<< orphan*/ printf(char *, ...);
double pythag(float, float);
int /*<<< orphan*/ sub1(float *, int);
int main(int argc, char **argv) {
  foo();
  bar(9001);
  printf("Hypotenuse of a 3, 4-sided right triangle is %f\n",
         pythag(3.0f, 4.0f));
  float a[3] = {1.0f, 2.5f, 3.0f};
  printf("Original array:\n");
  print_arr(a, 3);
  printf("Modified array:\n");
  sub1(a, 3);
  print_arr(a, 3);
  printf("Fib of 10 is %d\n", fib(10));
  int i = 0;
  for (i = 0; i < 10; ++i) {
    printf("Iterator is now at %d\n", increment());
  }
}


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)
mov    $0x0,%al
call   1090 <foo@plt>
mov    $0x2329,%edi
call   1040 <bar@plt>
movss  0xe51(%rip),%xmm0
movss  0xe4d(%rip),%xmm1
call   1070 <pythag@plt>
lea    0xe45(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    0xeb3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1050 <print_arr@plt>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1080 <sub1@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1050 <print_arr@plt>
mov    $0xa,%edi
call   10a0 <fib@plt>
mov    %eax,%esi
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jge    127b <main+0xfb>
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    124c <main+0xcc>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   10a0 <foo@plt>
mov    $0x2329,%edi
call   1050 <bar@plt>
movss  0xe52(%rip),%xmm0
movss  0xe4e(%rip),%xmm1
call   1080 <pythag@plt>
lea    0xe46(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0xebd(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xeaa(%rip),%rax
mov    %rax,(%rsp)
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <print_arr@plt>
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1090 <sub1@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <print_arr@plt>
mov    $0xa,%edi
call   10b0 <fib@plt>
lea    0xe08(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
lea    0xe02(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1040 <increment@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Hypotenuse of a 3, 4-sided right triangle is %f\0A\00"
@__const.main.a = [3 x float] [float 1.000000e+00, float 2.500000e+00, float 3.000000e+00]
@.str.1 = [17 x i8] c"Original array:\0A\00"
@.str.2 = [17 x i8] c"Modified array:\0A\00"
@.str.3 = [17 x i8] c"Fib of 10 is %d\0A\00"
@.str.4 = [23 x i8] c"Iterator is now at %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x float]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @foo()
%9 = call i32 @bar(i32 9001)
%10 = call double @pythag(float 3.000000e+00, float 4.000000e+00)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %10)
%12 = bitcast [3 x float]* %6 to i8*
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%15 = call i32 @print_arr(float* %14, i32 3)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%17 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%18 = call i32 @sub1(float* %17, i32 3)
%19 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%20 = call i32 @print_arr(float* %19, i32 3)
%21 = call i32 @fib(i32 10)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %21)
store i32 0, i32* %7
store i32 0, i32* %7
br label %23
23: ; preds = %29, %2
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 10
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = call i32 (...) @increment()
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %23
32: ; preds = %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [49 x i8] c"Hypotenuse of a 3, 4-sided right triangle is %f\0A\00"
@__const.main.a = [3 x float] [float 1.000000e+00, float 2.500000e+00, float 3.000000e+00]
@.str.3 = [17 x i8] c"Fib of 10 is %d\0A\00"
@.str.4 = [23 x i8] c"Iterator is now at %d\0A\00"
@str = [16 x i8] c"Original array:\00"
@str.5 = [16 x i8] c"Modified array:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x float]
%4 = tail call i32 (...) @foo()
%5 = tail call i32 @bar(i32 9001)
%6 = tail call double @pythag(float 3.000000e+00, float 4.000000e+00)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %6)
%8 = bitcast [3 x float]* %3 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%10 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%11 = call i32 @print_arr(float* %10, i32 3)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%13 = call i32 @sub1(float* %10, i32 3)
%14 = call i32 @print_arr(float* %10, i32 3)
%15 = call i32 @fib(i32 10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 (...) @increment()
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = call i32 (...) @increment()
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = call i32 (...) @increment()
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = call i32 (...) @increment()
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = call i32 (...) @increment()
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = call i32 (...) @increment()
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = call i32 (...) @increment()
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %29)
%31 = call i32 (...) @increment()
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = call i32 (...) @increment()
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %33)
%35 = call i32 (...) @increment()
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %35)
ret i32 0
}