#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*/ INT_MAX;
int /*<<< orphan*/ INT_MIN;
int /*<<< orphan*/ SCHAR_MAX;
int /*<<< orphan*/ SCHAR_MIN;
int /*<<< orphan*/ SHRT_MAX;
int /*<<< orphan*/ SHRT_MIN;
int /*<<< orphan*/ UCHAR_MAX;
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ USHRT_MAX;
int /*<<< orphan*/ test1(int /*<<< orphan*/, int);
int /*<<< orphan*/ test2(int /*<<< orphan*/, int);
int /*<<< orphan*/ test3(int /*<<< orphan*/, int);
int /*<<< orphan*/ test4(int /*<<< orphan*/, int);
int /*<<< orphan*/ test5(int /*<<< orphan*/, int);
int /*<<< orphan*/ test6(int /*<<< orphan*/, int);
int /*<<< orphan*/ test7(int, int);
int /*<<< orphan*/ test8(int, int);
int main() {
  test1(0, 0);
  test1(SCHAR_MAX, 0);
  test1(SCHAR_MIN, 1);
  test1(UCHAR_MAX, 1);
  test2(0, 0);
  test2(SCHAR_MAX, 0);
  test2(SCHAR_MIN, 1);
  test2(UCHAR_MAX, 1);
  test3(0, 0);
  test3(SHRT_MAX, 0);
  test3(SHRT_MIN, 1);
  test3(USHRT_MAX, 1);
  test4(0, 0);
  test4(SHRT_MAX, 0);
  test4(SHRT_MIN, 1);
  test4(USHRT_MAX, 1);
  test5(0, 0);
  test5(INT_MAX, 0);
  test5(INT_MIN, 1);
  test5(UINT_MAX, 1);
  test6(0, 0);
  test6(INT_MAX, 0);
  test6(INT_MIN, 1);
  test6(UINT_MAX, 1);
  test7(0, 0);
  test7(0x7fffffffffffffffLL, 0);
  test7((-0x7fffffffffffffffLL - 1), 1);
  test7((0x7fffffffffffffffLL * 2ULL + 1), 1);
  test8(0, 0);
  test8(0x7fffffffffffffffLL, 0);
  test8((-0x7fffffffffffffffLL - 1), 1);
  test8((0x7fffffffffffffffLL * 2ULL + 1), 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1060 <test1@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1060 <test1@plt>
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <test1@plt>
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1060 <test1@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1090 <test2@plt>
mov    0x2dd2(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1090 <test2@plt>
mov    0x2dca(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1090 <test2@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1090 <test2@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <test3@plt>
mov    0x2d83(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <test3@plt>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <test3@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <test3@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1080 <test4@plt>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1080 <test4@plt>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1080 <test4@plt>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1080 <test4@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <test5@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <test5@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <test5@plt>
mov    0x2d12(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <test5@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <test6@plt>
mov    0x2cfe(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1070 <test6@plt>
mov    0x2cde(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1070 <test6@plt>
mov    0x2cd3(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1070 <test6@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <test7@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <test7@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <test7@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <test7@plt>
xor    %esi,%esi
mov    %esi,%edi
call   10a0 <test8@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   10a0 <test8@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <test8@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   10a0 <test8@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <test1@plt>
mov    0x2e1b(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1060 <test1@plt>
mov    0x2e12(%rip),%r15
mov    (%r15),%edi
mov    $0x1,%esi
call   1060 <test1@plt>
mov    0x2e36(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1060 <test1@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1090 <test2@plt>
mov    (%r14),%edi
xor    %esi,%esi
call   1090 <test2@plt>
mov    (%r15),%edi
mov    $0x1,%esi
call   1090 <test2@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1090 <test2@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <test3@plt>
mov    0x2d9e(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1050 <test3@plt>
mov    0x2d95(%rip),%r15
mov    (%r15),%edi
mov    $0x1,%esi
call   1050 <test3@plt>
mov    0x2db9(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1050 <test3@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1080 <test4@plt>
mov    (%r14),%edi
xor    %esi,%esi
call   1080 <test4@plt>
mov    (%r15),%edi
mov    $0x1,%esi
call   1080 <test4@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1080 <test4@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <test5@plt>
mov    0x2d69(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1040 <test5@plt>
mov    0x2d48(%rip),%r15
mov    (%r15),%edi
mov    $0x1,%esi
call   1040 <test5@plt>
mov    0x2d3c(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1040 <test5@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <test6@plt>
mov    (%r14),%edi
xor    %esi,%esi
call   1070 <test6@plt>
mov    (%r15),%edi
mov    $0x1,%esi
call   1070 <test6@plt>
mov    (%rbx),%edi
mov    $0x1,%esi
call   1070 <test6@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <test7@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <test7@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <test7@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <test7@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10a0 <test8@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   10a0 <test8@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   10a0 <test8@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   10a0 <test8@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SCHAR_MAX = global i32 0
@SCHAR_MIN = global i32 0
@UCHAR_MAX = global i32 0
@SHRT_MAX = global i32 0
@SHRT_MIN = global i32 0
@USHRT_MAX = global i32 0
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@UINT_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test1(i32 0, i32 0)
%3 = load i32, i32* @SCHAR_MAX
%4 = call i32 @test1(i32 %3, i32 0)
%5 = load i32, i32* @SCHAR_MIN
%6 = call i32 @test1(i32 %5, i32 1)
%7 = load i32, i32* @UCHAR_MAX
%8 = call i32 @test1(i32 %7, i32 1)
%9 = call i32 @test2(i32 0, i32 0)
%10 = load i32, i32* @SCHAR_MAX
%11 = call i32 @test2(i32 %10, i32 0)
%12 = load i32, i32* @SCHAR_MIN
%13 = call i32 @test2(i32 %12, i32 1)
%14 = load i32, i32* @UCHAR_MAX
%15 = call i32 @test2(i32 %14, i32 1)
%16 = call i32 @test3(i32 0, i32 0)
%17 = load i32, i32* @SHRT_MAX
%18 = call i32 @test3(i32 %17, i32 0)
%19 = load i32, i32* @SHRT_MIN
%20 = call i32 @test3(i32 %19, i32 1)
%21 = load i32, i32* @USHRT_MAX
%22 = call i32 @test3(i32 %21, i32 1)
%23 = call i32 @test4(i32 0, i32 0)
%24 = load i32, i32* @SHRT_MAX
%25 = call i32 @test4(i32 %24, i32 0)
%26 = load i32, i32* @SHRT_MIN
%27 = call i32 @test4(i32 %26, i32 1)
%28 = load i32, i32* @USHRT_MAX
%29 = call i32 @test4(i32 %28, i32 1)
%30 = call i32 @test5(i32 0, i32 0)
%31 = load i32, i32* @INT_MAX
%32 = call i32 @test5(i32 %31, i32 0)
%33 = load i32, i32* @INT_MIN
%34 = call i32 @test5(i32 %33, i32 1)
%35 = load i32, i32* @UINT_MAX
%36 = call i32 @test5(i32 %35, i32 1)
%37 = call i32 @test6(i32 0, i32 0)
%38 = load i32, i32* @INT_MAX
%39 = call i32 @test6(i32 %38, i32 0)
%40 = load i32, i32* @INT_MIN
%41 = call i32 @test6(i32 %40, i32 1)
%42 = load i32, i32* @UINT_MAX
%43 = call i32 @test6(i32 %42, i32 1)
%44 = call i32 @test7(i32 0, i32 0)
%45 = call i32 @test7(i32 -1, i32 0)
%46 = call i32 @test7(i32 0, i32 1)
%47 = call i32 @test7(i32 -1, i32 1)
%48 = call i32 @test8(i32 0, i32 0)
%49 = call i32 @test8(i32 -1, i32 0)
%50 = call i32 @test8(i32 0, i32 1)
%51 = call i32 @test8(i32 -1, i32 1)
ret i32 0
}

LLVM IR (-O2):
@SCHAR_MAX = global i32 0
@SCHAR_MIN = global i32 0
@UCHAR_MAX = global i32 0
@SHRT_MAX = global i32 0
@SHRT_MIN = global i32 0
@USHRT_MAX = global i32 0
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@UINT_MAX = global i32 0
define i32 @main() {
%1 = tail call i32 @test1(i32 0, i32 0)
%2 = load i32, i32* @SCHAR_MAX
%3 = tail call i32 @test1(i32 %2, i32 0)
%4 = load i32, i32* @SCHAR_MIN
%5 = tail call i32 @test1(i32 %4, i32 1)
%6 = load i32, i32* @UCHAR_MAX
%7 = tail call i32 @test1(i32 %6, i32 1)
%8 = tail call i32 @test2(i32 0, i32 0)
%9 = load i32, i32* @SCHAR_MAX
%10 = tail call i32 @test2(i32 %9, i32 0)
%11 = load i32, i32* @SCHAR_MIN
%12 = tail call i32 @test2(i32 %11, i32 1)
%13 = load i32, i32* @UCHAR_MAX
%14 = tail call i32 @test2(i32 %13, i32 1)
%15 = tail call i32 @test3(i32 0, i32 0)
%16 = load i32, i32* @SHRT_MAX
%17 = tail call i32 @test3(i32 %16, i32 0)
%18 = load i32, i32* @SHRT_MIN
%19 = tail call i32 @test3(i32 %18, i32 1)
%20 = load i32, i32* @USHRT_MAX
%21 = tail call i32 @test3(i32 %20, i32 1)
%22 = tail call i32 @test4(i32 0, i32 0)
%23 = load i32, i32* @SHRT_MAX
%24 = tail call i32 @test4(i32 %23, i32 0)
%25 = load i32, i32* @SHRT_MIN
%26 = tail call i32 @test4(i32 %25, i32 1)
%27 = load i32, i32* @USHRT_MAX
%28 = tail call i32 @test4(i32 %27, i32 1)
%29 = tail call i32 @test5(i32 0, i32 0)
%30 = load i32, i32* @INT_MAX
%31 = tail call i32 @test5(i32 %30, i32 0)
%32 = load i32, i32* @INT_MIN
%33 = tail call i32 @test5(i32 %32, i32 1)
%34 = load i32, i32* @UINT_MAX
%35 = tail call i32 @test5(i32 %34, i32 1)
%36 = tail call i32 @test6(i32 0, i32 0)
%37 = load i32, i32* @INT_MAX
%38 = tail call i32 @test6(i32 %37, i32 0)
%39 = load i32, i32* @INT_MIN
%40 = tail call i32 @test6(i32 %39, i32 1)
%41 = load i32, i32* @UINT_MAX
%42 = tail call i32 @test6(i32 %41, i32 1)
%43 = tail call i32 @test7(i32 0, i32 0)
%44 = tail call i32 @test7(i32 -1, i32 0)
%45 = tail call i32 @test7(i32 0, i32 1)
%46 = tail call i32 @test7(i32 -1, i32 1)
%47 = tail call i32 @test8(i32 0, i32 0)
%48 = tail call i32 @test8(i32 -1, i32 0)
%49 = tail call i32 @test8(i32 0, i32 1)
%50 = tail call i32 @test8(i32 -1, i32 1)
ret i32 0
}