#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*/ check(int, int);
int /*<<< orphan*/ printf(char *);
void test(int i) {
  check(0, i);
  check(1, i);
  check(-1, i);
  check(INT_MAX, i);
  check(INT_MIN, i);
  check(0x000f, i);
  check(0xf000, i);
  check(0xdeadbeef, i);
  printf("\n");
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <check@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <check@plt>
mov    -0x4(%rbp),%esi
mov    $0xffffffff,%edi
call   1040 <check@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1040 <check@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1040 <check@plt>
mov    -0x4(%rbp),%esi
mov    $0xf,%edi
call   1040 <check@plt>
mov    -0x4(%rbp),%esi
mov    $0xf000,%edi
call   1040 <check@plt>
mov    -0x4(%rbp),%esi
mov    $0xdeadbeef,%edi
call   1040 <check@plt>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    $0xffffffff,%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    $0xf,%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    $0xf000,%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    $0xdeadbeef,%edi
mov    %ebx,%esi
call   1040 <check@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define void @test(i32 %0) {
%2 = tail call i32 @check(i32 0, i32 %0)
%3 = tail call i32 @check(i32 1, i32 %0)
%4 = tail call i32 @check(i32 -1, i32 %0)
%5 = load i32, i32* @INT_MAX
%6 = tail call i32 @check(i32 %5, i32 %0)
%7 = load i32, i32* @INT_MIN
%8 = tail call i32 @check(i32 %7, i32 %0)
%9 = tail call i32 @check(i32 15, i32 %0)
%10 = tail call i32 @check(i32 61440, i32 %0)
%11 = tail call i32 @check(i32 -559038737, i32 %0)
%12 = tail call i32 @putchar(i32 10)
ret void
}