#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 max(int, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int ret = max(12, 13);
  if (ret != 13) {
    printf("Test failed\n");
  }
  ret = max(13, 12);
  if (ret != 13) {
    printf("Test failed\n");
  }
  printf("All tests performed - if no error all passed\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
mov    $0xd,%esi
call   1040 <max@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x8(%rbp)
je     1157 <main+0x37>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0xd,%edi
mov    $0xc,%esi
call   1040 <max@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x8(%rbp)
je     117f <main+0x5f>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
mov    $0xd,%esi
call   1040 <max@plt>
cmp    $0xd,%eax
je     1141 <main+0x21>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
mov    $0xd,%edi
mov    $0xc,%esi
call   1040 <max@plt>
cmp    $0xd,%eax
je     1161 <main+0x41>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Test failed\0A\00"
@.str.1 = [46 x i8] c"All tests performed - if no error all passed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @max(i32 12, i32 13)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 13
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i32 @max(i32 13, i32 12)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 13
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [45 x i8] c"All tests performed - if no error all passed\00"
@str.3 = [12 x i8] c"Test failed\00"
define i32 @main() {
%1 = tail call i32 @max(i32 12, i32 13)
%2 = icmp eq i32 %1, 13
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @max(i32 13, i32 12)
%7 = icmp eq i32 %6, 13
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 0
}