#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 LONG_MAX;
int LONG_MIN;
int SCHAR_MAX;
int SCHAR_MIN;
int SHRT_MAX;
int SHRT_MIN;
int /*<<< orphan*/ foo_char(int, int);
int /*<<< orphan*/ foo_int(int, int);
int /*<<< orphan*/ foo_long(int, int);
int /*<<< orphan*/ foo_short(int, int);
int main() {
  foo_char(SCHAR_MIN + 1, SCHAR_MAX);
  foo_char(0, 0);
  foo_char(-1, 1);
  foo_char(1, 1);
  foo_char(SCHAR_MAX, SCHAR_MAX);
  foo_int(-1, 1);
  foo_int(0, 0);
  foo_int(INT_MAX, INT_MAX);
  foo_int(INT_MIN + 1, INT_MAX);
  foo_short(-1, 1);
  foo_short(0, 0);
  foo_short(SHRT_MAX, SHRT_MAX);
  foo_short(SHRT_MIN + 1, SHRT_MAX);
  foo_long(-1, 1);
  foo_long(0, 0);
  foo_long(LONG_MAX, LONG_MAX);
  foo_long(LONG_MIN + 1, LONG_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    0x2e5e(%rip),%rax
mov    (%rax),%esi
call   1060 <foo_char@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <foo_char@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1060 <foo_char@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1060 <foo_char@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    0x2e23(%rip),%rax
mov    (%rax),%esi
call   1060 <foo_char@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <foo_int@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <foo_int@plt>
mov    0x2e25(%rip),%rax
mov    (%rax),%edi
mov    0x2e1c(%rip),%rax
mov    (%rax),%esi
call   1030 <foo_int@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
call   1030 <foo_int@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <foo_short@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1040 <foo_short@plt>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
mov    0x2d93(%rip),%rax
mov    (%rax),%esi
call   1040 <foo_short@plt>
mov    0x2d8d(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    0x2d79(%rip),%rax
mov    (%rax),%esi
call   1040 <foo_short@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1050 <foo_long@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <foo_long@plt>
mov    0x2d63(%rip),%rax
mov    (%rax),%edi
mov    0x2d5a(%rip),%rax
mov    (%rax),%esi
call   1050 <foo_long@plt>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    0x2d40(%rip),%rax
mov    (%rax),%esi
call   1050 <foo_long@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    0x2e6c(%rip),%rbx
mov    (%rbx),%esi
call   1060 <foo_char@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <foo_char@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1060 <foo_char@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1060 <foo_char@plt>
mov    (%rbx),%edi
mov    %edi,%esi
call   1060 <foo_char@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <foo_int@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <foo_int@plt>
mov    0x2e3e(%rip),%rbx
mov    (%rbx),%edi
mov    %edi,%esi
call   1030 <foo_int@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    (%rbx),%esi
call   1030 <foo_int@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <foo_short@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <foo_short@plt>
mov    0x2dc3(%rip),%rbx
mov    (%rbx),%edi
mov    %edi,%esi
call   1040 <foo_short@plt>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    (%rbx),%esi
call   1040 <foo_short@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1050 <foo_long@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <foo_long@plt>
mov    0x2d98(%rip),%rbx
mov    (%rbx),%edi
mov    %edi,%esi
call   1050 <foo_long@plt>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
add    $0x1,%edi
mov    (%rbx),%esi
call   1050 <foo_long@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SCHAR_MIN = global i32 0
@SCHAR_MAX = global i32 0
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@SHRT_MAX = global i32 0
@SHRT_MIN = global i32 0
@LONG_MAX = global i32 0
@LONG_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SCHAR_MIN
%3 = add nsw i32 %2, 1
%4 = load i32, i32* @SCHAR_MAX
%5 = call i32 @foo_char(i32 %3, i32 %4)
%6 = call i32 @foo_char(i32 0, i32 0)
%7 = call i32 @foo_char(i32 -1, i32 1)
%8 = call i32 @foo_char(i32 1, i32 1)
%9 = load i32, i32* @SCHAR_MAX
%10 = load i32, i32* @SCHAR_MAX
%11 = call i32 @foo_char(i32 %9, i32 %10)
%12 = call i32 @foo_int(i32 -1, i32 1)
%13 = call i32 @foo_int(i32 0, i32 0)
%14 = load i32, i32* @INT_MAX
%15 = load i32, i32* @INT_MAX
%16 = call i32 @foo_int(i32 %14, i32 %15)
%17 = load i32, i32* @INT_MIN
%18 = add nsw i32 %17, 1
%19 = load i32, i32* @INT_MAX
%20 = call i32 @foo_int(i32 %18, i32 %19)
%21 = call i32 @foo_short(i32 -1, i32 1)
%22 = call i32 @foo_short(i32 0, i32 0)
%23 = load i32, i32* @SHRT_MAX
%24 = load i32, i32* @SHRT_MAX
%25 = call i32 @foo_short(i32 %23, i32 %24)
%26 = load i32, i32* @SHRT_MIN
%27 = add nsw i32 %26, 1
%28 = load i32, i32* @SHRT_MAX
%29 = call i32 @foo_short(i32 %27, i32 %28)
%30 = call i32 @foo_long(i32 -1, i32 1)
%31 = call i32 @foo_long(i32 0, i32 0)
%32 = load i32, i32* @LONG_MAX
%33 = load i32, i32* @LONG_MAX
%34 = call i32 @foo_long(i32 %32, i32 %33)
%35 = load i32, i32* @LONG_MIN
%36 = add nsw i32 %35, 1
%37 = load i32, i32* @LONG_MAX
%38 = call i32 @foo_long(i32 %36, i32 %37)
ret i32 0
}

LLVM IR (-O2):
@SCHAR_MIN = global i32 0
@SCHAR_MAX = global i32 0
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@SHRT_MAX = global i32 0
@SHRT_MIN = global i32 0
@LONG_MAX = global i32 0
@LONG_MIN = global i32 0
define i32 @main() {
%1 = load i32, i32* @SCHAR_MIN
%2 = add nsw i32 %1, 1
%3 = load i32, i32* @SCHAR_MAX
%4 = tail call i32 @foo_char(i32 %2, i32 %3)
%5 = tail call i32 @foo_char(i32 0, i32 0)
%6 = tail call i32 @foo_char(i32 -1, i32 1)
%7 = tail call i32 @foo_char(i32 1, i32 1)
%8 = load i32, i32* @SCHAR_MAX
%9 = tail call i32 @foo_char(i32 %8, i32 %8)
%10 = tail call i32 @foo_int(i32 -1, i32 1)
%11 = tail call i32 @foo_int(i32 0, i32 0)
%12 = load i32, i32* @INT_MAX
%13 = tail call i32 @foo_int(i32 %12, i32 %12)
%14 = load i32, i32* @INT_MIN
%15 = add nsw i32 %14, 1
%16 = load i32, i32* @INT_MAX
%17 = tail call i32 @foo_int(i32 %15, i32 %16)
%18 = tail call i32 @foo_short(i32 -1, i32 1)
%19 = tail call i32 @foo_short(i32 0, i32 0)
%20 = load i32, i32* @SHRT_MAX
%21 = tail call i32 @foo_short(i32 %20, i32 %20)
%22 = load i32, i32* @SHRT_MIN
%23 = add nsw i32 %22, 1
%24 = load i32, i32* @SHRT_MAX
%25 = tail call i32 @foo_short(i32 %23, i32 %24)
%26 = tail call i32 @foo_long(i32 -1, i32 1)
%27 = tail call i32 @foo_long(i32 0, i32 0)
%28 = load i32, i32* @LONG_MAX
%29 = tail call i32 @foo_long(i32 %28, i32 %28)
%30 = load i32, i32* @LONG_MIN
%31 = add nsw i32 %30, 1
%32 = load i32, i32* @LONG_MAX
%33 = tail call i32 @foo_long(i32 %31, i32 %32)
ret i32 0
}