#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 */
scalar_t__ control_flow(int);
scalar_t__ nest();
scalar_t__ recurse_countdown(int);
scalar_t__ sum_of_1_through_10();
int main() {
  int ret = 0;
  int tmp[] = {345, 43, 22, 2, 3, 6, 78, 7, 7};
  ret += control_flow(1);
  ret += control_flow(0);
  ret += nest();
  ret += sum_of_1_through_10();
  ret += recurse_countdown(10);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
mov    $0x1,%edi
call   1060 <control_flow@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1060 <control_flow@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <nest@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <sum_of_1_through_10@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1070 <recurse_countdown@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%edi
call   1050 <control_flow@plt>
mov    %rax,%r14
xor    %edi,%edi
call   1050 <control_flow@plt>
mov    %rax,%r15
add    %r14d,%r15d
xor    %eax,%eax
call   1040 <nest@plt>
mov    %rax,%rbx
add    %r15d,%ebx
xor    %eax,%eax
call   1030 <sum_of_1_through_10@plt>
mov    %rax,%r14
add    %ebx,%r14d
mov    $0xa,%edi
call   1060 <recurse_countdown@plt>
add    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.tmp = [9 x i32] [i32 345, i32 43, i32 22, i32 2, i32 3, i32 6, i32 78, i32 7, i32 7]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [9 x i32]* %3 to i8*
%5 = call i64 @control_flow(i32 1)
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = add nsw i64 %7, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = call i64 @control_flow(i32 0)
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %2
%15 = call i64 (...) @nest()
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = add nsw i64 %17, %15
%19 = trunc i64 %18 to i32
store i32 %19, i32* %2
%20 = call i64 (...) @sum_of_1_through_10()
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = add nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %2
%25 = call i64 @recurse_countdown(i32 10)
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = add nsw i64 %27, %25
%29 = trunc i64 %28 to i32
store i32 %29, i32* %2
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @control_flow(i32 1)
%2 = tail call i64 @control_flow(i32 0)
%3 = add i64 %2, %1
%4 = tail call i64 (...) @nest()
%5 = add i64 %3, %4
%6 = tail call i64 (...) @sum_of_1_through_10()
%7 = add i64 %5, %6
%8 = tail call i64 @recurse_countdown(i32 10)
%9 = add i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}