#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 */
unsigned int INT_MAX;
unsigned long LONG_MAX;
int SCHAR_MAX;
int SHRT_MAX;
int UCHAR_MAX;
unsigned int UINT_MAX;
unsigned long ULONG_MAX;
int USHRT_MAX;
int /*<<< orphan*/ testc(int, int);
int /*<<< orphan*/ testi(unsigned int, int);
int /*<<< orphan*/ testl(unsigned long, int);
int /*<<< orphan*/ tests(int, int);
int main() {
  testc(0, 0);
  testc(1, 1);
  testc(SCHAR_MAX, 1);
  testc(SCHAR_MAX + 1, 0);
  testc(UCHAR_MAX, 0);
  tests(0, 0);
  tests(1, 1);
  tests(SHRT_MAX, 1);
  tests(SHRT_MAX + 1, 0);
  tests(USHRT_MAX, 0);
  testi(0, 0);
  testi(1, 1);
  testi(INT_MAX, 1);
  testi(INT_MAX + 1U, 0);
  testi(UINT_MAX, 0);
  testl(0, 0);
  testl(1, 1);
  testl(LONG_MAX, 1);
  testl(LONG_MAX + 1UL, 0);
  testl(ULONG_MAX, 0);
  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   1030 <testc@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <testc@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <testc@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1030 <testc@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <testc@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <tests@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <tests@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1040 <tests@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1040 <tests@plt>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <tests@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <testi@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <testi@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1050 <testi@plt>
mov    0x2dc4(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1050 <testi@plt>
mov    0x2da9(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <testi@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <testl@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1060 <testl@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%rdi
mov    $0x1,%esi
call   1060 <testl@plt>
mov    0x2d53(%rip),%rax
mov    (%rax),%rdi
add    $0x1,%rdi
xor    %esi,%esi
call   1060 <testl@plt>
mov    0x2d26(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1060 <testl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <testc@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <testc@plt>
mov    0x2e60(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1030 <testc@plt>
mov    (%rbx),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1030 <testc@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <testc@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <tests@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <tests@plt>
mov    0x2e09(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1040 <tests@plt>
mov    (%rbx),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1040 <tests@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <tests@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <testi@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <testi@plt>
mov    0x2dea(%rip),%rbx
mov    (%rbx),%edi
mov    $0x1,%esi
call   1050 <testi@plt>
mov    (%rbx),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1050 <testi@plt>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1050 <testi@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <testl@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1060 <testl@plt>
mov    0x2d83(%rip),%rbx
mov    (%rbx),%rdi
mov    $0x1,%esi
call   1060 <testl@plt>
mov    (%rbx),%rdi
add    $0x1,%rdi
xor    %esi,%esi
call   1060 <testl@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1060 <testl@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SCHAR_MAX = global i32 0
@UCHAR_MAX = global i32 0
@SHRT_MAX = global i32 0
@USHRT_MAX = global i32 0
@INT_MAX = global i32 0
@UINT_MAX = global i32 0
@LONG_MAX = global i64 0
@ULONG_MAX = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @testc(i32 0, i32 0)
%3 = call i32 @testc(i32 1, i32 1)
%4 = load i32, i32* @SCHAR_MAX
%5 = call i32 @testc(i32 %4, i32 1)
%6 = load i32, i32* @SCHAR_MAX
%7 = add nsw i32 %6, 1
%8 = call i32 @testc(i32 %7, i32 0)
%9 = load i32, i32* @UCHAR_MAX
%10 = call i32 @testc(i32 %9, i32 0)
%11 = call i32 @tests(i32 0, i32 0)
%12 = call i32 @tests(i32 1, i32 1)
%13 = load i32, i32* @SHRT_MAX
%14 = call i32 @tests(i32 %13, i32 1)
%15 = load i32, i32* @SHRT_MAX
%16 = add nsw i32 %15, 1
%17 = call i32 @tests(i32 %16, i32 0)
%18 = load i32, i32* @USHRT_MAX
%19 = call i32 @tests(i32 %18, i32 0)
%20 = call i32 @testi(i32 0, i32 0)
%21 = call i32 @testi(i32 1, i32 1)
%22 = load i32, i32* @INT_MAX
%23 = call i32 @testi(i32 %22, i32 1)
%24 = load i32, i32* @INT_MAX
%25 = add i32 %24, 1
%26 = call i32 @testi(i32 %25, i32 0)
%27 = load i32, i32* @UINT_MAX
%28 = call i32 @testi(i32 %27, i32 0)
%29 = call i32 @testl(i64 0, i32 0)
%30 = call i32 @testl(i64 1, i32 1)
%31 = load i64, i64* @LONG_MAX
%32 = call i32 @testl(i64 %31, i32 1)
%33 = load i64, i64* @LONG_MAX
%34 = add i64 %33, 1
%35 = call i32 @testl(i64 %34, i32 0)
%36 = load i64, i64* @ULONG_MAX
%37 = call i32 @testl(i64 %36, i32 0)
ret i32 0
}

LLVM IR (-O2):
@SCHAR_MAX = global i32 0
@UCHAR_MAX = global i32 0
@SHRT_MAX = global i32 0
@USHRT_MAX = global i32 0
@INT_MAX = global i32 0
@UINT_MAX = global i32 0
@LONG_MAX = global i64 0
@ULONG_MAX = global i64 0
define i32 @main() {
%1 = tail call i32 @testc(i32 0, i32 0)
%2 = tail call i32 @testc(i32 1, i32 1)
%3 = load i32, i32* @SCHAR_MAX
%4 = tail call i32 @testc(i32 %3, i32 1)
%5 = load i32, i32* @SCHAR_MAX
%6 = add nsw i32 %5, 1
%7 = tail call i32 @testc(i32 %6, i32 0)
%8 = load i32, i32* @UCHAR_MAX
%9 = tail call i32 @testc(i32 %8, i32 0)
%10 = tail call i32 @tests(i32 0, i32 0)
%11 = tail call i32 @tests(i32 1, i32 1)
%12 = load i32, i32* @SHRT_MAX
%13 = tail call i32 @tests(i32 %12, i32 1)
%14 = load i32, i32* @SHRT_MAX
%15 = add nsw i32 %14, 1
%16 = tail call i32 @tests(i32 %15, i32 0)
%17 = load i32, i32* @USHRT_MAX
%18 = tail call i32 @tests(i32 %17, i32 0)
%19 = tail call i32 @testi(i32 0, i32 0)
%20 = tail call i32 @testi(i32 1, i32 1)
%21 = load i32, i32* @INT_MAX
%22 = tail call i32 @testi(i32 %21, i32 1)
%23 = load i32, i32* @INT_MAX
%24 = add i32 %23, 1
%25 = tail call i32 @testi(i32 %24, i32 0)
%26 = load i32, i32* @UINT_MAX
%27 = tail call i32 @testi(i32 %26, i32 0)
%28 = tail call i32 @testl(i64 0, i32 0)
%29 = tail call i32 @testl(i64 1, i32 1)
%30 = load i64, i64* @LONG_MAX
%31 = tail call i32 @testl(i64 %30, i32 1)
%32 = load i64, i64* @LONG_MAX
%33 = add i64 %32, 1
%34 = tail call i32 @testl(i64 %33, i32 0)
%35 = load i64, i64* @ULONG_MAX
%36 = tail call i32 @testl(i64 %35, i32 0)
ret i32 0
}