#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 argc, char *argv[]) {
  int x = 0, y = 1;
  x > 0 ? printf("?: yes\n") : printf("?: no\n");
  if (x == 1)
    printf("x: Yeah\n");
  if (y == 1)
    printf("y: Yeah\n");
  if (y == 1) {
    printf("y: Foo\n");
    printf("y: Bar\n");
  }
  if ((x >= 0) && (y != 0)) {
    printf("Yeah Yeah\n");
  } else if (x >= 0) {
    printf("Yeah\n");
    if (y > 0)
      printf("ah");
  } else {
    printf("Boo.\n");
  }
  if (x < 0)
    printf("x < 0 \n");
  else
    printf("x >= 0 \n");
  switch (x) {
  case 0:
    printf("x==0\n");
    break;
  case 1:
    printf("x==1\n");
  default:
    printf("something else");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114f <main+0x3f>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <main+0x4b>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1171 <main+0x61>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x18(%rbp)
jne    1187 <main+0x77>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x18(%rbp)
jne    11a9 <main+0x99>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
jl     11ce <main+0xbe>
cmpl   $0x0,-0x18(%rbp)
je     11ce <main+0xbe>
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0x100>
cmpl   $0x0,-0x14(%rbp)
jl     11ff <main+0xef>
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x18(%rbp)
jle    11fa <main+0xea>
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
jmp    120b <main+0xfb>
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
jmp    1210 <main+0x100>
cmpl   $0x0,-0x14(%rbp)
jge    122b <main+0x11b>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    1237 <main+0x127>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     125b <main+0x14b>
jmp    124a <main+0x13a>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
je     126c <main+0x15c>
jmp    1278 <main+0x168>
lea    0xdf4(%rip),%rdi
call   1030 <printf@plt>
jmp    1284 <main+0x174>
lea    0xde9(%rip),%rdi
call   1030 <printf@plt>
lea    0xde3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"?: yes\0A\00"
@.str.1 = [7 x i8] c"?: no\0A\00"
@.str.2 = [9 x i8] c"x: Yeah\0A\00"
@.str.3 = [9 x i8] c"y: Yeah\0A\00"
@.str.4 = [8 x i8] c"y: Foo\0A\00"
@.str.5 = [8 x i8] c"y: Bar\0A\00"
@.str.6 = [11 x i8] c"Yeah Yeah\0A\00"
@.str.7 = [6 x i8] c"Yeah\0A\00"
@.str.8 = [3 x i8] c"ah\00"
@.str.9 = [6 x i8] c"Boo.\0A\00"
@.str.10 = [8 x i8] c"x < 0 \0A\00"
@.str.11 = [9 x i8] c"x >= 0 \0A\00"
@.str.12 = [6 x i8] c"x==0\0A\00"
@.str.13 = [6 x i8] c"x==1\0A\00"
@.str.14 = [15 x i8] c"something else\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
%8 = load i32, i32* %6
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %7
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = load i32, i32* %7
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %28, %25
%32 = load i32, i32* %6
%33 = icmp sge i32 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %31
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %52
39: ; preds = %34, %31
%40 = load i32, i32* %6
%41 = icmp sge i32 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%44 = load i32, i32* %7
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
br label %48
48: ; preds = %46, %42
br label %51
49: ; preds = %39
%50 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %51
51: ; preds = %49, %48
br label %52
52: ; preds = %51, %37
%53 = load i32, i32* %6
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %59
57: ; preds = %52
%58 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %59
59: ; preds = %57, %55
%60 = load i32, i32* %6
switch i32 %60, label %65 [
i32 0, label %61
i32 1, label %63
]
61: ; preds = %59
%62 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %67
63: ; preds = %59
%64 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %65
65: ; preds = %59, %63
%66 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"?: no\00"
@str.15 = [8 x i8] c"y: Yeah\00"
@str.16 = [7 x i8] c"y: Foo\00"
@str.17 = [7 x i8] c"y: Bar\00"
@str.18 = [10 x i8] c"Yeah Yeah\00"
@str.19 = [8 x i8] c"x >= 0 \00"
@str.20 = [5 x i8] c"x==0\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.15, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.16, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.17, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.20, i64 0, i64 0))
ret i32 0
}