#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");
  } else {
    printf("2\n");
    goto next;
  }
  for (;;) {
    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    114b <main+0x3b>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x78>
jmp    1150 <main+0x40>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x6,-0xc(%rbp)
jne    1177 <main+0x67>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    1183 <main+0x73>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x78>
cmpl   $0x5,-0xc(%rbp)
jne    11a3 <main+0x93>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
jmp    11af <main+0x9f>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x40>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeda(%rip),%r14
lea    0xed5(%rip),%r15
lea    0xed3(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1140 <main+0x30>

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 %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %20
10: ; preds = %6
br label %11
11: ; preds = %27, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 6
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %19
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19, %8
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 5
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %27
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %11
}

LLVM IR (-O2):
@str = [2 x i8] c"2\00"
@str.7 = [2 x i8] c"6\00"
@str.8 = [5 x i8] c"loop\00"
@str.9 = [2 x i8] c"4\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))
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.9, i64 0, i64 0))
br label %2
}