#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*/ doit(int, int);
int /*<<< orphan*/ printf(char *);
main() {
  int i;
  for (i = 0; i < 10; i++)
    doit(10, 10);
  for (i = 0; i < 10; i++)
    doit(30, 30);
  for (i = 0; i < 10; i++)
    doit(30, 50);
  printf("0 0\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115a <main+0x3a>
mov    $0xa,%esi
mov    %esi,%edi
call   1040 <doit@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1185 <main+0x65>
mov    $0x1e,%esi
mov    %esi,%edi
call   1040 <doit@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1161 <main+0x41>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11b3 <main+0x93>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <main+0x6c>
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0xa,%edi
mov    $0xa,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x1e,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
mov    $0x1e,%edi
mov    $0x32,%esi
call   1040 <doit@plt>
lea    0xd16(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"0 0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @doit(i32 10, i32 10)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
store i32 0, i32* %2
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = call i32 @doit(i32 30, i32 30)
br label %17
17: ; preds = %15
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %12
20: ; preds = %12
store i32 0, i32* %2
br label %21
21: ; preds = %26, %20
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = call i32 @doit(i32 30, i32 50)
br label %26
26: ; preds = %24
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %21
29: ; preds = %21
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@str = [4 x i8] c"0 0\00"
define i32 @main() {
%1 = tail call i32 @doit(i32 10, i32 10)
%2 = tail call i32 @doit(i32 10, i32 10)
%3 = tail call i32 @doit(i32 10, i32 10)
%4 = tail call i32 @doit(i32 10, i32 10)
%5 = tail call i32 @doit(i32 10, i32 10)
%6 = tail call i32 @doit(i32 10, i32 10)
%7 = tail call i32 @doit(i32 10, i32 10)
%8 = tail call i32 @doit(i32 10, i32 10)
%9 = tail call i32 @doit(i32 10, i32 10)
%10 = tail call i32 @doit(i32 10, i32 10)
%11 = tail call i32 @doit(i32 30, i32 30)
%12 = tail call i32 @doit(i32 30, i32 30)
%13 = tail call i32 @doit(i32 30, i32 30)
%14 = tail call i32 @doit(i32 30, i32 30)
%15 = tail call i32 @doit(i32 30, i32 30)
%16 = tail call i32 @doit(i32 30, i32 30)
%17 = tail call i32 @doit(i32 30, i32 30)
%18 = tail call i32 @doit(i32 30, i32 30)
%19 = tail call i32 @doit(i32 30, i32 30)
%20 = tail call i32 @doit(i32 30, i32 30)
%21 = tail call i32 @doit(i32 30, i32 50)
%22 = tail call i32 @doit(i32 30, i32 50)
%23 = tail call i32 @doit(i32 30, i32 50)
%24 = tail call i32 @doit(i32 30, i32 50)
%25 = tail call i32 @doit(i32 30, i32 50)
%26 = tail call i32 @doit(i32 30, i32 50)
%27 = tail call i32 @doit(i32 30, i32 50)
%28 = tail call i32 @doit(i32 30, i32 50)
%29 = tail call i32 @doit(i32 30, i32 50)
%30 = tail call i32 @doit(i32 30, i32 50)
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}