#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 INT_MAX;
int INT_MIN;
int /*<<< orphan*/ printf(char *, int);
int tadd_ok(int, int);
int main() {
  int x1 = INT_MAX;
  int y1 = INT_MAX;
  int x2 = INT_MIN;
  int y2 = INT_MIN;
  printf("tadd_ok(x1, y1) = %d\n", tadd_ok(x1, y1));
  printf("tadd_ok(x2, y2) = %d\n", tadd_ok(x2, y2));
  printf("tadd_ok(x1, y1) = %d\n", tadd_ok(x1, y2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <tadd_ok@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <tadd_ok@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <tadd_ok@plt>
mov    %eax,%esi
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%ebx
mov    0x2eac(%rip),%rax
mov    (%rax),%ebp
mov    %ebx,%edi
mov    %ebx,%esi
call   1030 <tadd_ok@plt>
lea    0xeba(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <tadd_ok@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <tadd_ok@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@.str = [22 x i8] c"tadd_ok(x1, y1) = %d\0A\00"
@.str.1 = [22 x i8] c"tadd_ok(x2, y2) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* @INT_MAX
store i32 %6, i32* %2
%7 = load i32, i32* @INT_MAX
store i32 %7, i32* %3
%8 = load i32, i32* @INT_MIN
store i32 %8, i32* %4
%9 = load i32, i32* @INT_MIN
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @tadd_ok(i32 %10, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @tadd_ok(i32 %14, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %5
%20 = call i32 @tadd_ok(i32 %18, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@.str = [22 x i8] c"tadd_ok(x1, y1) = %d\0A\00"
@.str.1 = [22 x i8] c"tadd_ok(x2, y2) = %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @INT_MAX
%2 = load i32, i32* @INT_MIN
%3 = tail call i32 @tadd_ok(i32 %1, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @tadd_ok(i32 %2, i32 %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @tadd_ok(i32 %1, i32 %2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}