#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*/ f_schar_1(char const);
int /*<<< orphan*/ f_schar_2(char const, char const);
char const signed_range(char const, char const);
int /*<<< orphan*/ sink(int /*<<< orphan*/);
void test_schar_range(signed char n) {
  const signed char min = (-0x7f - 1);
  const signed char max = 0x7f;
  sink(f_schar_1(n));
  sink(f_schar_1(signed_range(min, min + 1)));
  sink(f_schar_1(signed_range(min, 0)));
  sink(f_schar_1(signed_range(-1, 0)));
  sink(f_schar_1(signed_range(-1, 1)));
  sink(f_schar_1(signed_range(0, 1)));
  sink(f_schar_1(signed_range(0, max - 1)));
  sink(f_schar_1(signed_range(1, max)));
  sink(f_schar_1(signed_range(max - 1, max)));
  sink(f_schar_2(n, n));
  sink(f_schar_2(signed_range(min, min + 1), n));
  sink(f_schar_2(n, signed_range(min, min + 1)));
  sink(f_schar_2(signed_range(min, min + 1), 0));
  sink(f_schar_2(0, signed_range(min, min + 1)));
  sink(f_schar_2(signed_range(min, min + 1), min));
  sink(f_schar_2(min, signed_range(min, min + 1)));
  sink(f_schar_2(signed_range(-1, 0), 0));
  sink(f_schar_2(0, signed_range(-1, 0)));
  sink(f_schar_2(signed_range(-1, 0), 1));
  sink(f_schar_2(1, signed_range(-1, 0)));
  sink(f_schar_2(signed_range(-1, 0), n));
  sink(f_schar_2(n, signed_range(-1, 0)));
  sink(f_schar_2(max, signed_range(1, max)));
  sink(f_schar_2(signed_range(1, max), max));
}


x86 assembly (clang, -O0):
<test_schar_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x80,-0x2(%rbp)
movb   $0x7f,-0x3(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
xor    %edi,%edi
mov    $0x7e,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x1,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x7e,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x1(%rbp),%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
movsbl -0x1(%rbp),%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x5(%rbp)
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
mov    -0x5(%rbp),%cl
movsbl %cl,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
xor    %esi,%esi
movsbl %al,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
xor    %edi,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
mov    $0xffffff80,%esi
movsbl %al,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
mov    $0xffffff80,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
xor    %esi,%esi
movsbl %al,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
xor    %edi,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
mov    $0x1,%esi
movsbl %al,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
mov    $0x1,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
movsbl -0x1(%rbp),%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x4(%rbp)
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
mov    -0x4(%rbp),%cl
movsbl %cl,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x1,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
mov    $0x7f,%edi
movsbl %al,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x1,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
mov    $0x7f,%esi
movsbl %al,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_schar_range>:
push   %rbx
mov    %edi,%ebx
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
xor    %edi,%edi
mov    $0x7e,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x1,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x7e,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
call   1030 <f_schar_1@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    %ebx,%edi
mov    %ebx,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
mov    %ebx,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
mov    %ebx,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
xor    %edi,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
mov    $0xffffff80,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffff80,%edi
mov    $0xffffff81,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
mov    $0xffffff80,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
xor    %esi,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
xor    %edi,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
mov    $0x1,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
mov    $0x1,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
mov    %ebx,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
mov    %ebx,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x1,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
movsbl %al,%esi
mov    $0x7f,%edi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
call   1060 <sink@plt>
mov    $0x1,%edi
mov    $0x7f,%esi
call   1040 <signed_range@plt>
movsbl %al,%edi
mov    $0x7f,%esi
call   1050 <f_schar_2@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <sink@plt>

LLVM IR (-O0):
define void @test_schar_range(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
store i8 -128, i8* %3
store i8 127, i8* %4
%5 = load i8, i8* %2
%6 = call i32 @f_schar_1(i8 signext %5)
%7 = call i32 @sink(i32 %6)
%8 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%9 = call i32 @f_schar_1(i8 signext %8)
%10 = call i32 @sink(i32 %9)
%11 = call signext i8 @signed_range(i8 signext -128, i8 signext 0)
%12 = call i32 @f_schar_1(i8 signext %11)
%13 = call i32 @sink(i32 %12)
%14 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%15 = call i32 @f_schar_1(i8 signext %14)
%16 = call i32 @sink(i32 %15)
%17 = call signext i8 @signed_range(i8 signext -1, i8 signext 1)
%18 = call i32 @f_schar_1(i8 signext %17)
%19 = call i32 @sink(i32 %18)
%20 = call signext i8 @signed_range(i8 signext 0, i8 signext 1)
%21 = call i32 @f_schar_1(i8 signext %20)
%22 = call i32 @sink(i32 %21)
%23 = call signext i8 @signed_range(i8 signext 0, i8 signext 126)
%24 = call i32 @f_schar_1(i8 signext %23)
%25 = call i32 @sink(i32 %24)
%26 = call signext i8 @signed_range(i8 signext 1, i8 signext 127)
%27 = call i32 @f_schar_1(i8 signext %26)
%28 = call i32 @sink(i32 %27)
%29 = call signext i8 @signed_range(i8 signext 126, i8 signext 127)
%30 = call i32 @f_schar_1(i8 signext %29)
%31 = call i32 @sink(i32 %30)
%32 = load i8, i8* %2
%33 = load i8, i8* %2
%34 = call i32 @f_schar_2(i8 signext %32, i8 signext %33)
%35 = call i32 @sink(i32 %34)
%36 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%37 = load i8, i8* %2
%38 = call i32 @f_schar_2(i8 signext %36, i8 signext %37)
%39 = call i32 @sink(i32 %38)
%40 = load i8, i8* %2
%41 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%42 = call i32 @f_schar_2(i8 signext %40, i8 signext %41)
%43 = call i32 @sink(i32 %42)
%44 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%45 = call i32 @f_schar_2(i8 signext %44, i8 signext 0)
%46 = call i32 @sink(i32 %45)
%47 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%48 = call i32 @f_schar_2(i8 signext 0, i8 signext %47)
%49 = call i32 @sink(i32 %48)
%50 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%51 = call i32 @f_schar_2(i8 signext %50, i8 signext -128)
%52 = call i32 @sink(i32 %51)
%53 = call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%54 = call i32 @f_schar_2(i8 signext -128, i8 signext %53)
%55 = call i32 @sink(i32 %54)
%56 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%57 = call i32 @f_schar_2(i8 signext %56, i8 signext 0)
%58 = call i32 @sink(i32 %57)
%59 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%60 = call i32 @f_schar_2(i8 signext 0, i8 signext %59)
%61 = call i32 @sink(i32 %60)
%62 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%63 = call i32 @f_schar_2(i8 signext %62, i8 signext 1)
%64 = call i32 @sink(i32 %63)
%65 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%66 = call i32 @f_schar_2(i8 signext 1, i8 signext %65)
%67 = call i32 @sink(i32 %66)
%68 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%69 = load i8, i8* %2
%70 = call i32 @f_schar_2(i8 signext %68, i8 signext %69)
%71 = call i32 @sink(i32 %70)
%72 = load i8, i8* %2
%73 = call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%74 = call i32 @f_schar_2(i8 signext %72, i8 signext %73)
%75 = call i32 @sink(i32 %74)
%76 = call signext i8 @signed_range(i8 signext 1, i8 signext 127)
%77 = call i32 @f_schar_2(i8 signext 127, i8 signext %76)
%78 = call i32 @sink(i32 %77)
%79 = call signext i8 @signed_range(i8 signext 1, i8 signext 127)
%80 = call i32 @f_schar_2(i8 signext %79, i8 signext 127)
%81 = call i32 @sink(i32 %80)
ret void
}

LLVM IR (-O2):
define void @test_schar_range(i8 signext %0) {
%2 = tail call i32 @f_schar_1(i8 signext %0)
%3 = tail call i32 @sink(i32 %2)
%4 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%5 = tail call i32 @f_schar_1(i8 signext %4)
%6 = tail call i32 @sink(i32 %5)
%7 = tail call signext i8 @signed_range(i8 signext -128, i8 signext 0)
%8 = tail call i32 @f_schar_1(i8 signext %7)
%9 = tail call i32 @sink(i32 %8)
%10 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%11 = tail call i32 @f_schar_1(i8 signext %10)
%12 = tail call i32 @sink(i32 %11)
%13 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 1)
%14 = tail call i32 @f_schar_1(i8 signext %13)
%15 = tail call i32 @sink(i32 %14)
%16 = tail call signext i8 @signed_range(i8 signext 0, i8 signext 1)
%17 = tail call i32 @f_schar_1(i8 signext %16)
%18 = tail call i32 @sink(i32 %17)
%19 = tail call signext i8 @signed_range(i8 signext 0, i8 signext 126)
%20 = tail call i32 @f_schar_1(i8 signext %19)
%21 = tail call i32 @sink(i32 %20)
%22 = tail call signext i8 @signed_range(i8 signext 1, i8 signext 127)
%23 = tail call i32 @f_schar_1(i8 signext %22)
%24 = tail call i32 @sink(i32 %23)
%25 = tail call signext i8 @signed_range(i8 signext 126, i8 signext 127)
%26 = tail call i32 @f_schar_1(i8 signext %25)
%27 = tail call i32 @sink(i32 %26)
%28 = tail call i32 @f_schar_2(i8 signext %0, i8 signext %0)
%29 = tail call i32 @sink(i32 %28)
%30 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%31 = tail call i32 @f_schar_2(i8 signext %30, i8 signext %0)
%32 = tail call i32 @sink(i32 %31)
%33 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%34 = tail call i32 @f_schar_2(i8 signext %0, i8 signext %33)
%35 = tail call i32 @sink(i32 %34)
%36 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%37 = tail call i32 @f_schar_2(i8 signext %36, i8 signext 0)
%38 = tail call i32 @sink(i32 %37)
%39 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%40 = tail call i32 @f_schar_2(i8 signext 0, i8 signext %39)
%41 = tail call i32 @sink(i32 %40)
%42 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%43 = tail call i32 @f_schar_2(i8 signext %42, i8 signext -128)
%44 = tail call i32 @sink(i32 %43)
%45 = tail call signext i8 @signed_range(i8 signext -128, i8 signext -127)
%46 = tail call i32 @f_schar_2(i8 signext -128, i8 signext %45)
%47 = tail call i32 @sink(i32 %46)
%48 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%49 = tail call i32 @f_schar_2(i8 signext %48, i8 signext 0)
%50 = tail call i32 @sink(i32 %49)
%51 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%52 = tail call i32 @f_schar_2(i8 signext 0, i8 signext %51)
%53 = tail call i32 @sink(i32 %52)
%54 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%55 = tail call i32 @f_schar_2(i8 signext %54, i8 signext 1)
%56 = tail call i32 @sink(i32 %55)
%57 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%58 = tail call i32 @f_schar_2(i8 signext 1, i8 signext %57)
%59 = tail call i32 @sink(i32 %58)
%60 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%61 = tail call i32 @f_schar_2(i8 signext %60, i8 signext %0)
%62 = tail call i32 @sink(i32 %61)
%63 = tail call signext i8 @signed_range(i8 signext -1, i8 signext 0)
%64 = tail call i32 @f_schar_2(i8 signext %0, i8 signext %63)
%65 = tail call i32 @sink(i32 %64)
%66 = tail call signext i8 @signed_range(i8 signext 1, i8 signext 127)
%67 = tail call i32 @f_schar_2(i8 signext 127, i8 signext %66)
%68 = tail call i32 @sink(i32 %67)
%69 = tail call signext i8 @signed_range(i8 signext 1, i8 signext 127)
%70 = tail call i32 @f_schar_2(i8 signext %69, i8 signext 127)
%71 = tail call i32 @sink(i32 %70)
ret void
}