#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, ...);
void main() {
  int a = 5, b = 6;
  printf("add(%d,%d) = %d\n", a, b, (a + b));
  printf("square(%d) = %d\n", a, (a * a));
  printf("max(%d,%d) = %d\n", a, b, ((a > b) ? a : b));
  if ((((a % 2) == 0) ? 1 : 0) == 0) {
    printf("even(%d) = %d, %d is not an even number\n", a,
           (((a % 2) == 0) ? 1 : 0), a);
  } else {
    printf("even(%d) = %d, %d is an even number\n", a, (((a % 2) == 0) ? 1 : 0),
           a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    117b <main+0x6b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1181 <main+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%ecx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
cmp    $0x0,%eax
jne    11ec <main+0xdc>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
xor    %edx,%edx
mov    $0x1,%eax
cmp    $0x0,%ecx
cmove  %eax,%edx
mov    -0x4(%rbp),%ecx
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121a <main+0x10a>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
xor    %edx,%edx
mov    $0x1,%eax
cmp    $0x0,%ecx
cmove  %eax,%edx
mov    -0x4(%rbp),%ecx
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x5,%esi
mov    $0x19,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0x6,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x5,%esi
xor    %edx,%edx
mov    $0x5,%ecx
xor    %eax,%eax
pop    %r8
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"add(%d,%d) = %d\0A\00"
@.str.1 = [17 x i8] c"square(%d) = %d\0A\00"
@.str.2 = [17 x i8] c"max(%d,%d) = %d\0A\00"
@.str.3 = [41 x i8] c"even(%d) = %d, %d is not an even number\0A\00"
@.str.4 = [37 x i8] c"even(%d) = %d, %d is an even number\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
store i32 6, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %7)
%9 = load i32, i32* %1
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = mul nsw i32 %10, %11
%13 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %12)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load i32, i32* %1
%17 = load i32, i32* %2
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %0
%20 = load i32, i32* %1
br label %23
21: ; preds = %0
%22 = load i32, i32* %2
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
%25 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32 %15, i32 %24)
%26 = load i32, i32* %1
%27 = srem i32 %26, 2
%28 = icmp eq i32 %27, 0
%29 = zext i1 %28 to i64
%30 = select i1 %28, i32 1, i32 0
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %23
%33 = load i32, i32* %1
%34 = load i32, i32* %1
%35 = srem i32 %34, 2
%36 = icmp eq i32 %35, 0
%37 = zext i1 %36 to i64
%38 = select i1 %36, i32 1, i32 0
%39 = load i32, i32* %1
%40 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %33, i32 %38, i32 %39)
br label %50
41: ; preds = %23
%42 = load i32, i32* %1
%43 = load i32, i32* %1
%44 = srem i32 %43, 2
%45 = icmp eq i32 %44, 0
%46 = zext i1 %45 to i64
%47 = select i1 %45, i32 1, i32 0
%48 = load i32, i32* %1
%49 = call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %42, i32 %47, i32 %48)
br label %50
50: ; preds = %41, %32
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"add(%d,%d) = %d\0A\00"
@.str.1 = [17 x i8] c"square(%d) = %d\0A\00"
@.str.2 = [17 x i8] c"max(%d,%d) = %d\0A\00"
@.str.3 = [41 x i8] c"even(%d) = %d, %d is not an even number\0A\00"
define void @main() {
%1 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 5, i32 6, i32 11)
%2 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 25)
%3 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 6, i32 6)
%4 = tail call i32 (i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 5, i32 0, i32 5)
ret void
}