#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;
  if (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   $0x0,-0x10(%rbp)
je     1175 <main+0x65>
jmp    112e <main+0x1e>
cmpl   $0x1e,-0x8(%rbp)
jge    1170 <main+0x60>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0xf,-0xc(%rbp)
jne    115f <main+0x4f>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    11a1 <main+0x91>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    112e <main+0x1e>
jmp    1175 <main+0x65>
cmpl   $0x7b,-0x8(%rbp)
jne    1190 <main+0x80>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
jmp    11ad <main+0x9d>
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    11a1 <main+0x91>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
lea    0xe60(%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
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %0
br label %8
8: ; preds = %17, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 30
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 15
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %8
19: ; preds = %8
br label %20
20: ; preds = %19, %0
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 123
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %30
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25
br label %28
28: ; preds = %27, %15
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %30
30: ; preds = %28, %23
%31 = 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
}