#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, ...);
int main() {
  int bar = 100;
  int foo = 0;
  printf("In main foo = %d\n", foo);
  printf("bar = %d\n", bar);
  if (bar > foo) {
    printf("bar %d is greater than foo %d", bar, foo);
  } else {
    printf("bar %d is not greater than foo %d", bar, foo);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1174 <main+0x64>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <main+0x78>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x64,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"In main foo = %d\0A\00"
@.str.1 = [10 x i8] c"bar = %d\0A\00"
@.str.2 = [30 x i8] c"bar %d is greater than foo %d\00"
@.str.3 = [34 x i8] c"bar %d is not greater than foo %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
br label %19
15: ; preds = %0
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %15, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"In main foo = %d\0A\00"
@.str.1 = [10 x i8] c"bar = %d\0A\00"
@.str.2 = [30 x i8] c"bar %d is greater than foo %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 100)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 0)
ret i32 0
}