#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_long_1(long);
long signed_range(long const, long const);
int /*<<< orphan*/ sink(int /*<<< orphan*/);
void test_long_range(long n) {
  const long min = (-0x7fffffffffffffffL - 1L);
  const long max = 0x7fffffffffffffffL;
  sink(f_long_1(n));
  sink(f_long_1(signed_range(min, min + 1)));
  sink(f_long_1(signed_range(min, 0)));
  sink(f_long_1(signed_range(-1, 0)));
  sink(f_long_1(signed_range(-1, 1)));
  sink(f_long_1(signed_range(0, 1)));
  sink(f_long_1(signed_range(0, max - 1)));
  sink(f_long_1(signed_range(1, max)));
  sink(f_long_1(signed_range(max - 1, max)));
}


x86 assembly (clang, -O0):
<test_long_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000000,%rax
mov    %rax,-0x10(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
movabs $0x8000000000000000,%rdi
movabs $0x8000000000000001,%rsi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
movabs $0x8000000000000000,%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    $0xffffffffffffffff,%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    $0xffffffffffffffff,%rdi
mov    $0x1,%esi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
xor    %eax,%eax
mov    %eax,%edi
movabs $0x7ffffffffffffffe,%rsi
ff ff 7f
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    $0x1,%edi
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
movabs $0x7ffffffffffffffe,%rdi
ff ff 7f
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_range>:
push   %r14
push   %rbx
push   %rax
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
movabs $0x7ffffffffffffffe,%r14
ff ff 7f
lea    0x2(%r14),%rbx
lea    0x3(%r14),%rsi
mov    %rbx,%rdi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    $0x1,%esi
mov    $0xffffffffffffffff,%rdi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    $0x1,%esi
xor    %edi,%edi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
lea    0x1(%r14),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
call   1040 <sink@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <signed_range@plt>
mov    %rax,%rdi
call   1050 <f_long_1@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sink@plt>

LLVM IR (-O0):
define void @test_long_range(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 -9223372036854775808, i64* %3
store i64 9223372036854775807, i64* %4
%5 = load i64, i64* %2
%6 = call i32 @f_long_1(i64 %5)
%7 = call i32 @sink(i32 %6)
%8 = call i64 @signed_range(i64 -9223372036854775808, i64 -9223372036854775807)
%9 = call i32 @f_long_1(i64 %8)
%10 = call i32 @sink(i32 %9)
%11 = call i64 @signed_range(i64 -9223372036854775808, i64 0)
%12 = call i32 @f_long_1(i64 %11)
%13 = call i32 @sink(i32 %12)
%14 = call i64 @signed_range(i64 -1, i64 0)
%15 = call i32 @f_long_1(i64 %14)
%16 = call i32 @sink(i32 %15)
%17 = call i64 @signed_range(i64 -1, i64 1)
%18 = call i32 @f_long_1(i64 %17)
%19 = call i32 @sink(i32 %18)
%20 = call i64 @signed_range(i64 0, i64 1)
%21 = call i32 @f_long_1(i64 %20)
%22 = call i32 @sink(i32 %21)
%23 = call i64 @signed_range(i64 0, i64 9223372036854775806)
%24 = call i32 @f_long_1(i64 %23)
%25 = call i32 @sink(i32 %24)
%26 = call i64 @signed_range(i64 1, i64 9223372036854775807)
%27 = call i32 @f_long_1(i64 %26)
%28 = call i32 @sink(i32 %27)
%29 = call i64 @signed_range(i64 9223372036854775806, i64 9223372036854775807)
%30 = call i32 @f_long_1(i64 %29)
%31 = call i32 @sink(i32 %30)
ret void
}

LLVM IR (-O2):
define void @test_long_range(i64 %0) {
%2 = tail call i32 @f_long_1(i64 %0)
%3 = tail call i32 @sink(i32 %2)
%4 = tail call i64 @signed_range(i64 -9223372036854775808, i64 -9223372036854775807)
%5 = tail call i32 @f_long_1(i64 %4)
%6 = tail call i32 @sink(i32 %5)
%7 = tail call i64 @signed_range(i64 -9223372036854775808, i64 0)
%8 = tail call i32 @f_long_1(i64 %7)
%9 = tail call i32 @sink(i32 %8)
%10 = tail call i64 @signed_range(i64 -1, i64 0)
%11 = tail call i32 @f_long_1(i64 %10)
%12 = tail call i32 @sink(i32 %11)
%13 = tail call i64 @signed_range(i64 -1, i64 1)
%14 = tail call i32 @f_long_1(i64 %13)
%15 = tail call i32 @sink(i32 %14)
%16 = tail call i64 @signed_range(i64 0, i64 1)
%17 = tail call i32 @f_long_1(i64 %16)
%18 = tail call i32 @sink(i32 %17)
%19 = tail call i64 @signed_range(i64 0, i64 9223372036854775806)
%20 = tail call i32 @f_long_1(i64 %19)
%21 = tail call i32 @sink(i32 %20)
%22 = tail call i64 @signed_range(i64 1, i64 9223372036854775807)
%23 = tail call i32 @f_long_1(i64 %22)
%24 = tail call i32 @sink(i32 %23)
%25 = tail call i64 @signed_range(i64 9223372036854775806, i64 9223372036854775807)
%26 = tail call i32 @f_long_1(i64 %25)
%27 = tail call i32 @sink(i32 %26)
ret void
}