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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118b <main+0x7b>
cmpl   $0x1,-0x8(%rbp)
jle    118b <main+0x7b>
cmpl   $0x2,-0x8(%rbp)
jle    118b <main+0x7b>
cmpl   $0x0,-0xc(%rbp)
je     117a <main+0x6a>
cmpl   $0x1,-0xc(%rbp)
jle    117a <main+0x6a>
cmpl   $0x2,-0xc(%rbp)
jle    117a <main+0x6a>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x76>
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
jmp    1197 <main+0x87>
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
lea    0xe6b(%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"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %26
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %26
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 2
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 2
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %25
23: ; preds = %18, %15, %12
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %28
26: ; preds = %9, %6, %0
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %25
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

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