#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*/ printf(char *, ...);
int /*<<< orphan*/ simple();
int /*<<< orphan*/ simple_no_ret();
int /*<<< orphan*/ simple_printing_fun();
int /*<<< orphan*/ simple_stack_frame();
int /*<<< orphan*/ simple_stack_frame_hack();
int /*<<< orphan*/ simple_stack_frame_leave();
void fun() {
  int i = 0;
  i = i + 1;
  printf("one %d\n", 1);
  simple();
  printf("two\n");
  simple_no_ret();
  printf("three\n");
  simple_stack_frame();
  printf("four\n");
  simple_stack_frame_leave();
  printf("five\n");
  simple_stack_frame_hack();
  printf("hack\n");
  printf("print hack\n");
  simple_printing_fun();
  printf("we made it!\n");
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xe71(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <simple@plt>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <simple_no_ret@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <simple_stack_frame@plt>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <simple_stack_frame_leave@plt>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <simple_stack_frame_hack@plt>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <simple_printing_fun@plt>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
lea    0xe78(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1090 <simple@plt>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <simple_no_ret@plt>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10a0 <simple_stack_frame@plt>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <simple_stack_frame_leave@plt>
lea    0xe3c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <simple_stack_frame_hack@plt>
lea    0xe34(%rip),%rdi
call   1030 <puts@plt>
lea    0xe22(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <simple_printing_fun@plt>
lea    0xe1a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"one %d\0A\00"
@.str.1 = [5 x i8] c"two\0A\00"
@.str.2 = [7 x i8] c"three\0A\00"
@.str.3 = [6 x i8] c"four\0A\00"
@.str.4 = [6 x i8] c"five\0A\00"
@.str.5 = [6 x i8] c"hack\0A\00"
@.str.6 = [12 x i8] c"print hack\0A\00"
@.str.7 = [13 x i8] c"we made it!\0A\00"
define void @fun() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 (...) @simple()
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @simple_no_ret()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @simple_stack_frame()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (...) @simple_stack_frame_leave()
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (...) @simple_stack_frame_hack()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (...) @simple_printing_fun()
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"one %d\0A\00"
@str = [4 x i8] c"two\00"
@str.8 = [6 x i8] c"three\00"
@str.9 = [5 x i8] c"four\00"
@str.10 = [5 x i8] c"five\00"
@str.11 = [5 x i8] c"hack\00"
@str.12 = [11 x i8] c"print hack\00"
@str.13 = [12 x i8] c"we made it!\00"
define void @fun() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (...) @simple()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @simple_no_ret()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 (...) @simple_stack_frame()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.9, i64 0, i64 0))
%8 = tail call i32 (...) @simple_stack_frame_leave()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0))
%10 = tail call i32 (...) @simple_stack_frame_hack()
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.11, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
%13 = tail call i32 (...) @simple_printing_fun()
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.13, i64 0, i64 0))
ret void
}