#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*/ do_run();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i;
  printf("Start main\n");
  for (i = 0; i < 10; i++) {
    do_run();
  }
  printf("Done main\n");
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1168 <main+0x48>
mov    $0x0,%al
call   1040 <do_run@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <main+0x29>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
xor    %eax,%eax
call   1040 <do_run@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Start main\0A\00"
@.str.1 = [11 x i8] c"Done main\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %8
8: ; preds = %13, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = call i32 (...) @do_run()
br label %13
13: ; preds = %11
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %8
16: ; preds = %8
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Start main\00"
@str.2 = [10 x i8] c"Done main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @do_run()
%5 = tail call i32 (...) @do_run()
%6 = tail call i32 (...) @do_run()
%7 = tail call i32 (...) @do_run()
%8 = tail call i32 (...) @do_run()
%9 = tail call i32 (...) @do_run()
%10 = tail call i32 (...) @do_run()
%11 = tail call i32 (...) @do_run()
%12 = tail call i32 (...) @do_run()
%13 = tail call i32 (...) @do_run()
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}