#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, k;
  while (i < 30) {
    printf("1\n");
    if (j == 15) {
      printf("2\n");
      goto end;
    }
    printf("3\n");
  }
  if (i == 123) {
    printf("4\n");
    goto finish;
  } else {
    printf("5\n");
  }
end:
  printf("end\n");
finish:
  printf("finish\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    1161 <main+0x51>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xf,-0xc(%rbp)
jne    1150 <main+0x40>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <main+0x7d>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>
cmpl   $0x7b,-0x8(%rbp)
jne    117c <main+0x6c>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x89>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <main+0x7d>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%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 = [3 x i8] c"4\0A\00"
@.str.4 = [3 x i8] c"5\0A\00"
@.str.5 = [5 x i8] c"end\0A\00"
@.str.6 = [8 x i8] c"finish\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 30
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 15
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
14: ; preds = %8
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %5
16: ; preds = %5
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 123
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %26
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21
br label %24
24: ; preds = %23, %12
%25 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %26
26: ; preds = %24, %19
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

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