#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*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
unsigned int f1(int);
unsigned long long f2(int);
main() {
  if (f1(1) != (~(unsigned)0) >> 1)
    abort();
  if (f1(0) != ((~(unsigned)0) >> 1) - 1)
    abort();
  if (f2(1) != (~(unsigned long long)0) >> 1)
    abort();
  if (f2(0) != ((~(unsigned long long)0) >> 1) - 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <f1@plt>
cmp    $0x7fffffff,%eax
je     116b <main+0x2b>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %edi,%edi
call   1050 <f1@plt>
cmp    $0x7ffffffe,%eax
je     1184 <main+0x44>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x1,%edi
call   1030 <f2@plt>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
cmp    %rcx,%rax
je     11a8 <main+0x68>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %edi,%edi
call   1030 <f2@plt>
movabs $0x7ffffffffffffffe,%rcx
ff ff 7f
cmp    %rcx,%rax
je     11c9 <main+0x89>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <f1@plt>
cmp    $0x7fffffff,%eax
jne    1190 <main+0x50>
xor    %edi,%edi
call   1050 <f1@plt>
cmp    $0x7ffffffe,%eax
jne    1190 <main+0x50>
movabs $0x7ffffffffffffffe,%rbx
ff ff 7f
mov    $0x1,%edi
call   1030 <f2@plt>
lea    0x1(%rbx),%rcx
cmp    %rcx,%rax
jne    1190 <main+0x50>
xor    %edi,%edi
call   1030 <f2@plt>
cmp    %rbx,%rax
jne    1190 <main+0x50>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 1)
%3 = icmp ne i32 %2, 2147483647
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @f1(i32 0)
%8 = icmp ne i32 %7, 2147483646
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i64 @f2(i32 1)
%13 = icmp ne i64 %12, 9223372036854775807
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
%17 = call i64 @f2(i32 0)
%18 = icmp ne i64 %17, 9223372036854775806
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %16
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 1)
%2 = icmp eq i32 %1, 2147483647
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @f1(i32 0)
%7 = icmp eq i32 %6, 2147483646
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i64 @f2(i32 1)
%12 = icmp eq i64 %11, 9223372036854775807
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i64 @f2(i32 0)
%17 = icmp eq i64 %16, 9223372036854775806
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %15
%21 = tail call i32 @exit(i32 0)
unreachable
}