#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*/ counter_controlled_loop();
int factorial(int);
int get_input();
int /*<<< orphan*/ loop_till_sentinal_value();
int /*<<< orphan*/ nested_loops();
int /*<<< orphan*/ prefix_vs_postfix();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  counter_controlled_loop();
  prefix_vs_postfix();
  int fct = factorial(5);
  printf("factorial 5 = %d\n", fct);
  loop_till_sentinal_value();
  int input = get_input();
  printf("input = %d (inside main function) \n", input);
  nested_loops();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <counter_controlled_loop@plt>
mov    $0x0,%al
call   1050 <prefix_vs_postfix@plt>
mov    $0x5,%edi
call   1030 <factorial@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <loop_till_sentinal_value@plt>
mov    $0x0,%al
call   1090 <get_input@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <nested_loops@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <counter_controlled_loop@plt>
xor    %eax,%eax
call   1050 <prefix_vs_postfix@plt>
mov    $0x5,%edi
call   1030 <factorial@plt>
lea    0xe70(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <loop_till_sentinal_value@plt>
xor    %eax,%eax
call   1090 <get_input@plt>
lea    0xe66(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <nested_loops@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"factorial 5 = %d\0A\00"
@.str.1 = [36 x i8] c"input = %d (inside main function) \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @counter_controlled_loop()
%5 = call i32 (...) @prefix_vs_postfix()
%6 = call i32 @factorial(i32 5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @loop_till_sentinal_value()
%10 = call i32 (...) @get_input()
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i32 (...) @nested_loops()
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"factorial 5 = %d\0A\00"
@.str.1 = [36 x i8] c"input = %d (inside main function) \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @counter_controlled_loop()
%2 = tail call i32 (...) @prefix_vs_postfix()
%3 = tail call i32 @factorial(i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @loop_till_sentinal_value()
%6 = tail call i32 (...) @get_input()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @nested_loops()
ret i32 0
}