#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;
  } else {
    printf("2\n");
  }
  while (i < 1) {
    printf("loop\n");
    if (j == 6) {
      printf("3\n");
    } else {
      printf("4\n");
    }
  next:
    if (j == 5) {
      printf("5\n");
    } else {
      printf("6\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    118d <main+0x7d>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    114b <main+0x3b>
cmpl   $0x1,-0x8(%rbp)
jge    11c2 <main+0xb2>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x6,-0xc(%rbp)
jne    117c <main+0x6c>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x78>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <main+0x7d>
cmpl   $0x5,-0xc(%rbp)
jne    11a8 <main+0x98>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    11b4 <main+0xa4>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <main+0x3b>
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 = [6 x i8] c"loop\0A\00"
@.str.3 = [3 x i8] c"3\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"
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 %23
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8
br label %11
11: ; preds = %30, %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 1
br i1 %13, label %14, label %33
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 6
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %23
23: ; preds = %22, %6
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %30
28: ; preds = %23
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %11
33: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"2\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
}