#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 main() {
  int i = 0;
  while (i < 20) {
    printf("1\n");
    if (i == 15) {
      printf("2\n");
      int j;
      for (j = 0; j < 10; j++) {
        printf("3\n");
        if (j == 5) {
          printf("4\n");
          if (i == 2) {
            printf("foo\n");
          } else {
            printf("bar\n");
          }
          printf("11\n");
        } else {
          printf("5\n");
          goto out;
        }
      }
      printf("6\n");
    }
  out:
    printf("7\n");
    if (i == 16) {
      printf("8\n");
    } else {
      printf("9\n");
    }
    printf("10\n");
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    123f <main+0x12f>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xf,-0x8(%rbp)
jne    11ed <main+0xdd>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11e1 <main+0xd1>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,-0xc(%rbp)
jne    11bd <main+0xad>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    11a0 <main+0x90>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11ac <main+0x9c>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
jmp    11ce <main+0xbe>
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
jmp    11f2 <main+0xe2>
jmp    11d3 <main+0xc3>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x49>
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
jmp    11f2 <main+0xe2>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x10,-0x8(%rbp)
jne    1219 <main+0x109>
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x115>
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
lea    0xdfa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xf,%r12d
lea    0xed8(%rip),%r13
lea    0xed3(%rip),%rbx
lea    0xece(%rip),%r14
lea    0xec9(%rip),%rbp
mov    $0xf,%r15d
jmp    1195 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r15d,%r12d
cmp    $0xfffffffb,%r15d
je     11ba <main+0xaa>
mov    %r13,%rdi
call   1030 <puts@plt>
sub    $0x1,%r15d
jb     1150 <main+0x40>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe57(%rip),%rdi
cmp    $0xffffffff,%r12d
jne    117c <main+0x6c>
jmp    117f <main+0x6f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [3 x i8] c"3\0A\00"
@.str.3 = [3 x i8] c"4\0A\00"
@.str.4 = [5 x i8] c"foo\0A\00"
@.str.5 = [5 x i8] c"bar\0A\00"
@.str.6 = [4 x i8] c"11\0A\00"
@.str.7 = [3 x i8] c"5\0A\00"
@.str.8 = [3 x i8] c"6\0A\00"
@.str.9 = [3 x i8] c"7\0A\00"
@.str.10 = [3 x i8] c"8\0A\00"
@.str.11 = [3 x i8] c"9\0A\00"
@.str.12 = [4 x i8] c"10\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %47, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 20
br i1 %6, label %7, label %51
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 15
br i1 %10, label %11, label %38
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %13
13: ; preds = %33, %11
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 10
br i1 %15, label %16, label %36
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 5
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %28
26: ; preds = %20
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %32
30: ; preds = %16
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %39
32: ; preds = %28
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %13
36: ; preds = %13
%37 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %38
38: ; preds = %36, %7
br label %39
39: ; preds = %38, %30
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 16
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %47
45: ; preds = %39
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %4
51: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
@str.13 = [2 x i8] c"7\00"
@str.14 = [2 x i8] c"9\00"
@str.15 = [3 x i8] c"10\00"
@str.16 = [2 x i8] c"8\00"
@str.17 = [2 x i8] c"2\00"
@str.18 = [2 x i8] c"3\00"
@str.19 = [2 x i8] c"5\00"
define i32 @main() {
br label %1
1: ; preds = %0, %14
%2 = phi i32 [ 0, %0 ], [ %18, %14 ]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = icmp eq i32 %2, 15
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.17, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.13, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.13, i64 0, i64 0))
%12 = icmp eq i32 %2, 16
br i1 %12, label %14, label %13
13: ; preds = %5, %10
br label %14
14: ; preds = %10, %13
%15 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.14, i64 0, i64 0), %13 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.16, i64 0, i64 0), %10 ]
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.15, i64 0, i64 0))
%18 = add nuw nsw i32 %2, 1
%19 = icmp eq i32 %18, 20
br i1 %19, label %20, label %1
20: ; preds = %14
ret i32 0
}