#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*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 2, b = 3, c;
  c = (a > b) ? a : b;
  print("c  3");
  printid(c);
  c = a < b ? a : b;
  print("c  2");
  printid(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1154 <main+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    115a <main+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118b <main+0x6b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1191 <main+0x71>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    0xe67(%rip),%rdi
call   1030 <print@plt>
mov    -0x10(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x3,%edi
call   1040 <printid@plt>
lea    0xec7(%rip),%rdi
call   1030 <print@plt>
mov    $0x2,%edi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"c 3\00"
@.str.1 = [5 x i8] c"c 2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i32, i32* %2
br label %12
10: ; preds = %0
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %4
%14 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = call i32 @printid(i32 %15)
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = load i32, i32* %2
br label %24
22: ; preds = %12
%23 = load i32, i32* %3
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
store i32 %25, i32* %4
%26 = call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* %4
%28 = call i32 @printid(i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"c 3\00"
@.str.1 = [5 x i8] c"c 2\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 3)
%3 = tail call i32 @print(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printid(i32 2)
ret i32 0
}