#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 = 123;
  if (i > 0) {
    if (i == 5) {
      printf("1\n");
    } else if (i == 6) {
      printf("2\n");
    } else {
      if (i == 7)
        printf("3\n");
      else
        printf("4\n");
    }
  }
  printf("5\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    119c <main+0x8c>
cmpl   $0x5,-0x8(%rbp)
jne    114b <main+0x3b>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1197 <main+0x87>
cmpl   $0x6,-0x8(%rbp)
jne    1166 <main+0x56>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x82>
cmpl   $0x7,-0x8(%rbp)
jne    1181 <main+0x71>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
jmp    118d <main+0x7d>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    1192 <main+0x82>
jmp    1197 <main+0x87>
jmp    119c <main+0x8c>
lea    0xe69(%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>
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"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %25
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %24
10: ; preds = %5
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 6
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %23
15: ; preds = %10
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 7
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %22
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %23
23: ; preds = %22, %13
br label %24
24: ; preds = %23, %8
br label %25
25: ; preds = %24, %0
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"4\00"
@str.5 = [2 x i8] c"5\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 ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}