#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 increment();
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int x = 50;
  printf("max of %d and %d is %d\n", x, increment(),
         ((x) > (increment()) ? (x) : (increment())));
  printf("max of %d and %d is %d\n", x, increment(),
         ((x) > (increment()) ? (x) : (increment())));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x32,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jle    1172 <main+0x52>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    117c <main+0x5c>
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%ecx
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
cmp    %ecx,%eax
jle    11c6 <main+0xa6>
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11d0 <main+0xb0>
mov    $0x0,%al
call   1030 <increment@plt>
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%edx
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%ecx
lea    0xe20(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <increment@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <increment@plt>
mov    $0x32,%ebx
mov    $0x32,%ecx
cmp    $0x32,%eax
jl     114b <main+0x2b>
xor    %eax,%eax
call   1030 <increment@plt>
mov    %eax,%ecx
lea    0xeae(%rip),%rdi
mov    $0x32,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <increment@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <increment@plt>
cmp    $0x32,%eax
jl     117c <main+0x5c>
xor    %eax,%eax
call   1030 <increment@plt>
mov    %eax,%ebx
lea    0xe7d(%rip),%rdi
mov    $0x32,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"max of %d and %d is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @increment()
%4 = tail call i32 (...) @increment()
%5 = icmp slt i32 %4, 50
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @increment()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 50, %2 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 50, i32 %3, i32 %9)
%11 = tail call i32 (...) @increment()
%12 = tail call i32 (...) @increment()
%13 = icmp slt i32 %12, 50
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = tail call i32 (...) @increment()
br label %16
16: ; preds = %8, %14
%17 = phi i32 [ %15, %14 ], [ 50, %8 ]
%18 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 50, i32 %11, i32 %17)
ret i32 0
}