#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*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int max3(int, int, int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int i = 1;
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(0, 0, 0) == 0);
  fprintf(stdout, "OK\n");
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(0, 1, 0) == 1);
  fprintf(stdout, "OK\n");
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(100, -1, 10) == 100);
  fprintf(stdout, "OK\n");
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(-40, -5, -1) == -1);
  fprintf(stdout, "OK\n");
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(60, -100, 70) == 70);
  fprintf(stdout, "OK\n");
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(0, 9, 9) == 9);
  fprintf(stdout, "OK\n");
  fprintf(stdout, "Test %d: ", i++);
  assert(max3(-139, -139, -139) == -139);
  fprintf(stdout, "OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <max3@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0xe70(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe44(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %edx,%edx
mov    $0x1,%esi
mov    %edx,%edi
call   1050 <max3@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
lea    0xe19(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x64,%edi
mov    $0xffffffff,%esi
mov    $0xa,%edx
call   1050 <max3@plt>
cmp    $0x64,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d84(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0xffffffd8,%edi
mov    $0xfffffffb,%esi
mov    $0xffffffff,%edx
call   1050 <max3@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2d3e(%rip),%rax
mov    (%rax),%edi
lea    0xd5f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xd33(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x3c,%edi
mov    $0xffffff9c,%esi
mov    $0x46,%edx
call   1050 <max3@plt>
cmp    $0x46,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2ce1(%rip),%rax
mov    (%rax),%edi
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xcd6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %edi,%edi
mov    $0x9,%edx
mov    %edx,%esi
call   1050 <max3@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2c8a(%rip),%rax
mov    (%rax),%edi
lea    0xcab(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xc7f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0xffffff75,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <max3@plt>
cmp    $0xffffff75,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2c31(%rip),%rax
mov    (%rax),%edi
lea    0xc52(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2ea4(%rip),%rbx
mov    (%rbx),%edi
lea    0xebb(%rip),%r14
mov    %r14,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <max3@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
lea    0xe95(%rip),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <max3@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x64,%edi
mov    $0xffffffff,%esi
mov    $0xa,%edx
call   1050 <max3@plt>
xor    %edi,%edi
cmp    $0x64,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xffffffd8,%edi
mov    $0xfffffffb,%esi
mov    $0xffffffff,%edx
call   1050 <max3@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x3c,%edi
mov    $0xffffff9c,%esi
mov    $0x46,%edx
call   1050 <max3@plt>
xor    %edi,%edi
cmp    $0x46,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %edi,%edi
mov    $0x9,%esi
mov    $0x9,%edx
call   1050 <max3@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xffffff75,%edi
mov    $0xffffff75,%esi
mov    $0xffffff75,%edx
call   1050 <max3@plt>
xor    %edi,%edi
cmp    $0xffffff75,%eax
sete   %dil
call   1030 <assert@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"Test %d: \00"
@.str.1 = [4 x i8] c"OK\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 1, i32* %6
%7 = load i32, i32* @stdout
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
%11 = call i32 @max3(i32 0, i32 0, i32 0)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* @stdout
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* @stdout
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18)
%21 = call i32 @max3(i32 0, i32 1, i32 0)
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* @stdout
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %28)
%31 = call i32 @max3(i32 100, i32 -1, i32 10)
%32 = icmp eq i32 %31, 100
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = load i32, i32* @stdout
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%37 = load i32, i32* @stdout
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %38)
%41 = call i32 @max3(i32 -40, i32 -5, i32 -1)
%42 = icmp eq i32 %41, -1
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load i32, i32* @stdout
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%47 = load i32, i32* @stdout
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %48)
%51 = call i32 @max3(i32 60, i32 -100, i32 70)
%52 = icmp eq i32 %51, 70
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = load i32, i32* @stdout
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%57 = load i32, i32* @stdout
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %58)
%61 = call i32 @max3(i32 0, i32 9, i32 9)
%62 = icmp eq i32 %61, 9
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = load i32, i32* @stdout
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%67 = load i32, i32* @stdout
%68 = load i32, i32* %6
%69 = add nsw i32 %68, 1
store i32 %69, i32* %6
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %68)
%71 = call i32 @max3(i32 -139, i32 -139, i32 -139)
%72 = icmp eq i32 %71, -139
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = load i32, i32* @stdout
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"Test %d: \00"
@.str.1 = [4 x i8] c"OK\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @max3(i32 0, i32 0, i32 0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%13 = tail call i32 @max3(i32 0, i32 1, i32 0)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = load i32, i32* @stdout
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @stdout
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%21 = tail call i32 @max3(i32 100, i32 -1, i32 10)
%22 = icmp eq i32 %21, 100
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = load i32, i32* @stdout
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
%29 = tail call i32 @max3(i32 -40, i32 -5, i32 -1)
%30 = icmp eq i32 %29, -1
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = load i32, i32* @stdout
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%35 = load i32, i32* @stdout
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5)
%37 = tail call i32 @max3(i32 60, i32 -100, i32 70)
%38 = icmp eq i32 %37, 70
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = load i32, i32* @stdout
%42 = tail call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%43 = load i32, i32* @stdout
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6)
%45 = tail call i32 @max3(i32 0, i32 9, i32 9)
%46 = icmp eq i32 %45, 9
%47 = zext i1 %46 to i32
%48 = tail call i32 @assert(i32 %47)
%49 = load i32, i32* @stdout
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%51 = load i32, i32* @stdout
%52 = tail call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7)
%53 = tail call i32 @max3(i32 -139, i32 -139, i32 -139)
%54 = icmp eq i32 %53, -139
%55 = zext i1 %54 to i32
%56 = tail call i32 @assert(i32 %55)
%57 = load i32, i32* @stdout
%58 = tail call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}