#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, j;
  if (i == 1) {
    printf("1\n");
    goto next_1;
  } else if (i == 2) {
    printf("2\n");
    goto next_2;
  } else {
    printf("3\n");
  }
  while (i < 10) {
    printf("loop\n");
    if (j == 111) {
      printf("3\n");
    } else {
      printf("4\n");
    }
  next_1:
    if (j == 222) {
      printf("5\n");
    } else {
      printf("6\n");
    }
  next_2:
    if (j == 333) {
      printf("7\n");
    } else {
      printf("8\n");
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113a <main+0x2a>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    11ad <main+0x9d>
cmpl   $0x2,-0x8(%rbp)
jne    1155 <main+0x45>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xcc>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x56>
jmp    116b <main+0x5b>
cmpl   $0xa,-0x8(%rbp)
jge    1214 <main+0x104>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x6f,-0xc(%rbp)
jne    119c <main+0x8c>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11a8 <main+0x98>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
jmp    11ad <main+0x9d>
cmpl   $0xde,-0xc(%rbp)
jne    11cb <main+0xbb>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
jmp    11d7 <main+0xc7>
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xcc>
cmpl   $0x14d,-0xc(%rbp)
jne    11fa <main+0xea>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
jmp    1206 <main+0xf6>
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <main+0x5b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
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 = [6 x i8] c"loop\0A\00"
@.str.4 = [3 x i8] c"4\0A\00"
@.str.5 = [3 x i8] c"5\0A\00"
@.str.6 = [3 x i8] c"6\0A\00"
@.str.7 = [3 x i8] c"7\0A\00"
@.str.8 = [3 x i8] c"8\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %29
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %37
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13
br label %16
16: ; preds = %15
br label %17
17: ; preds = %44, %16
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %47
20: ; preds = %17
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 111
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %28
26: ; preds = %20
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
br label %29
29: ; preds = %28, %6
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 222
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %36
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
br label %37
37: ; preds = %36, %11
%38 = load i32, i32* %3
%39 = icmp eq i32 %38, 333
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %44
42: ; preds = %37
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
%45 = load i32, i32* %2
%46 = add nsw i32 %45, 1
store i32 %46, i32* %2
br label %17
47: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}