#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, j = 2, z;
  for (z = 0; z < 20; z++) {
    while (i < 10 && j != i * 2) {
      printf("1\n");
      if (i == 8) {
        printf("2\n");
        break;
      }
      if (j == 5) {
        while (1) {
          printf("3\n");
        }
      }
      i++;
      j++;
    }
    if (z == 15) {
      printf("4\n");
      break;
    }
    printf("5\n");
  }
  printf("6\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    1206 <main+0xf6>
jmp    1143 <main+0x33>
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jge    1163 <main+0x53>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1173 <main+0x63>
jmp    11d1 <main+0xc1>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x8,-0x8(%rbp)
jne    119a <main+0x8a>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    11d1 <main+0xc1>
cmpl   $0x5,-0xc(%rbp)
jne    11ba <main+0xaa>
jmp    11a9 <main+0x99>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <main+0x99>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <main+0x33>
cmpl   $0xf,-0x10(%rbp)
jne    11ec <main+0xdc>
lea    0xe27(%rip),%rdi
call   1030 <printf@plt>
jmp    1206 <main+0xf6>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x2,%ebp
xor    %r12d,%r12d
lea    0xedc(%rip),%r13
xor    %ebx,%ebx
cmp    $0x9,%ebx
jg     1190 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbx,1),%r15d
cmp    %r15d,%ebp
je     11a0 <main+0x90>
add    $0x2,%r15d
nopl   (%rax)
mov    %r13,%rdi
call   1030 <puts@plt>
cmp    $0x8,%ebx
je     11d0 <main+0xc0>
cmp    $0x5,%ebp
je     1211 <main+0x101>
lea    0x1(%rbx),%r14d
add    $0x1,%ebp
cmp    $0x8,%ebx
jg     11a3 <main+0x93>
lea    0x2(%r15),%eax
mov    %r14d,%ebx
cmp    %ebp,%r15d
mov    %eax,%r15d
jne    1150 <main+0x40>
jmp    11a3 <main+0x93>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%r14d
cmp    $0xf,%r12d
jne    11a9 <main+0x99>
jmp    11e8 <main+0xd8>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r14d
cmp    $0xf,%r12d
je     11e8 <main+0xd8>
lea    0xe52(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%r12d
mov    %r14d,%ebx
cmp    $0x9,%ebx
jle    1140 <main+0x30>
jmp    1190 <main+0x80>
nopw   0x0(%rax,%rax,1)
lea    0xe33(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%r14d
cmp    $0xf,%r12d
jne    11a9 <main+0x99>
lea    0xe15(%rip),%rdi
call   1030 <puts@plt>
lea    0xe05(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1220 <main+0x110>

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

LLVM IR (-O2):
@str = [2 x i8] c"6\00"
@str.6 = [2 x i8] c"5\00"
@str.7 = [2 x i8] c"4\00"
@str.8 = [2 x i8] c"1\00"
@str.9 = [2 x i8] c"3\00"
@str.10 = [2 x i8] c"2\00"
define i32 @main() {
br label %1
1: ; preds = %31, %0
%2 = phi i32 [ 0, %0 ], [ %33, %31 ]
%3 = phi i32 [ 2, %0 ], [ %29, %31 ]
%4 = phi i32 [ 0, %0 ], [ %28, %31 ]
%5 = icmp slt i32 %4, 10
%6 = shl nsw i32 %4, 1
%7 = icmp ne i32 %3, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %27
9: ; preds = %1, %20
%10 = phi i32 [ %22, %20 ], [ %3, %1 ]
%11 = phi i32 [ %21, %20 ], [ %4, %1 ]
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%13 = icmp eq i32 %11, 8
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.10, i64 0, i64 0))
br label %27
16: ; preds = %9
%17 = icmp eq i32 %10, 5
br i1 %17, label %18, label %20
18: ; preds = %16, %18
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0))
br label %18
20: ; preds = %16
%21 = add nsw i32 %11, 1
%22 = add nsw i32 %10, 1
%23 = icmp slt i32 %11, 9
%24 = shl nsw i32 %21, 1
%25 = icmp ne i32 %22, %24
%26 = select i1 %23, i1 %25, i1 false
br i1 %26, label %9, label %27
27: ; preds = %20, %1, %14
%28 = phi i32 [ 8, %14 ], [ %4, %1 ], [ %21, %20 ]
%29 = phi i32 [ %10, %14 ], [ %3, %1 ], [ %22, %20 ]
%30 = icmp eq i32 %2, 15
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0))
%33 = add nuw nsw i32 %2, 1
br label %1
34: ; preds = %27
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}