#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");
        continue;
      }
      if (j == 5) {
        while (1) {
          printf("3\n");
        }
      }
      i++;
      j++;
    }
    if (z == 15) {
      printf("4\n");
      continue;
    }
    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    1143 <main+0x33>
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    11f8 <main+0xe8>
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    %r15d,%r15d
lea    0xedc(%rip),%rbx
lea    0xed9(%rip),%r14
xor    %r13d,%r13d
jmp    1170 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
mov    $0x10,%ebp
mov    $0x8,%r13d
cmp    $0xf,%r15d
lea    0xeac(%rip),%rdi
lea    0xea7(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
add    $0x1,%r15d
cmp    $0x14,%r15d
je     11e7 <main+0xd7>
cmp    $0x9,%r13d
jg     114b <main+0x3b>
lea    0x0(%r13,%r13,1),%eax
cmp    %eax,%ebp
je     114b <main+0x3b>
mov    %r13d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
cmp    $0x8,%r12d
jne    11c0 <main+0xb0>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    $0x8,%r12d
cmp    $0x10,%ebp
jne    1190 <main+0x80>
jmp    1140 <main+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x5,%ebp
je     1204 <main+0xf4>
lea    0x1(%r12),%r13d
add    $0x1,%ebp
cmp    $0x8,%r12d
jg     114b <main+0x3b>
lea    (%r12,%r12,1),%eax
add    $0x2,%eax
cmp    %eax,%ebp
jne    117f <main+0x6f>
jmp    114b <main+0x3b>
lea    0xe12(%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    0xdfd(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1210 <main+0x100>

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