#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 */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ test_int(int);
int /*<<< orphan*/ test_ptr(void *);
int /*<<< orphan*/ test_uint(int);
int main(void) {
  int32_t a;
  uint32_t b;
  void *c;
  a = 0;
  test_int(a);
  a = -1;
  test_int(a);
  a = 1;
  test_int(a);
  a = (((int32_t)1) << 29) - 2;
  test_int(a);
  a = (((int32_t)1) << 29) - 1;
  test_int(a);
  a = (-(((int32_t)1) << 29)) + 2;
  test_int(a);
  a = (-(((int32_t)1) << 29)) + 1;
  test_int(a);
  a = (-(((int32_t)1) << 29));
  test_int(a);
  b = 0;
  test_uint(b);
  b = 1;
  test_uint(b);
  b = (((uint32_t)1) << 30) - 2;
  test_uint(b);
  b = (((uint32_t)1) << 30) - 1;
  test_uint(b);
  c = NULL;
  test_ptr(c);
  c = (void *)&a;
  test_ptr(c);
  c = (void *)&b;
  test_ptr(c);
  c = (void *)&c;
  test_ptr(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0x1ffffffe,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0x1fffffff,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0xe0000002,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0xe0000001,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0xe0000000,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test_int@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <test_uint@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <test_uint@plt>
movl   $0x3ffffffe,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <test_uint@plt>
movl   $0x3fffffff,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <test_uint@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <test_ptr@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <test_ptr@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <test_ptr@plt>
lea    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <test_ptr@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %edi,%edi
call   1040 <test_int@plt>
mov    $0xffffffff,%edi
call   1040 <test_int@plt>
mov    $0x1,%edi
call   1040 <test_int@plt>
mov    $0x1ffffffe,%edi
call   1040 <test_int@plt>
mov    $0x1fffffff,%edi
call   1040 <test_int@plt>
mov    $0xe0000002,%edi
call   1040 <test_int@plt>
mov    $0xe0000001,%edi
call   1040 <test_int@plt>
movl   $0xe0000000,0xc(%rsp)
e0
mov    $0xe0000000,%edi
call   1040 <test_int@plt>
xor    %edi,%edi
call   1050 <test_uint@plt>
mov    $0x1,%edi
call   1050 <test_uint@plt>
mov    $0x3ffffffe,%edi
call   1050 <test_uint@plt>
movl   $0x3fffffff,0x8(%rsp)
3f
mov    $0x3fffffff,%edi
call   1050 <test_uint@plt>
xor    %edi,%edi
call   1030 <test_ptr@plt>
lea    0xc(%rsp),%rdi
call   1030 <test_ptr@plt>
lea    0x8(%rsp),%rdi
call   1030 <test_ptr@plt>
lea    0x10(%rsp),%rdi
mov    %rdi,0x10(%rsp)
call   1030 <test_ptr@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @test_int(i32 %5)
store i32 -1, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @test_int(i32 %7)
store i32 1, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @test_int(i32 %9)
store i32 536870910, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @test_int(i32 %11)
store i32 536870911, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @test_int(i32 %13)
store i32 -536870910, i32* %2
%15 = load i32, i32* %2
%16 = call i32 @test_int(i32 %15)
store i32 -536870911, i32* %2
%17 = load i32, i32* %2
%18 = call i32 @test_int(i32 %17)
store i32 -536870912, i32* %2
%19 = load i32, i32* %2
%20 = call i32 @test_int(i32 %19)
store i32 0, i32* %3
%21 = load i32, i32* %3
%22 = call i32 @test_uint(i32 %21)
store i32 1, i32* %3
%23 = load i32, i32* %3
%24 = call i32 @test_uint(i32 %23)
store i32 1073741822, i32* %3
%25 = load i32, i32* %3
%26 = call i32 @test_uint(i32 %25)
store i32 1073741823, i32* %3
%27 = load i32, i32* %3
%28 = call i32 @test_uint(i32 %27)
store i8* null, i8** %4
%29 = load i8*, i8** %4
%30 = call i32 @test_ptr(i8* %29)
%31 = bitcast i32* %2 to i8*
store i8* %31, i8** %4
%32 = load i8*, i8** %4
%33 = call i32 @test_ptr(i8* %32)
%34 = bitcast i32* %3 to i8*
store i8* %34, i8** %4
%35 = load i8*, i8** %4
%36 = call i32 @test_ptr(i8* %35)
%37 = bitcast i8** %4 to i8*
store i8* %37, i8** %4
%38 = load i8*, i8** %4
%39 = call i32 @test_ptr(i8* %38)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i8** %3 to i8*
%7 = tail call i32 @test_int(i32 0)
%8 = tail call i32 @test_int(i32 -1)
%9 = tail call i32 @test_int(i32 1)
%10 = tail call i32 @test_int(i32 536870910)
%11 = tail call i32 @test_int(i32 536870911)
%12 = tail call i32 @test_int(i32 -536870910)
%13 = tail call i32 @test_int(i32 -536870911)
store i32 -536870912, i32* %1
%14 = tail call i32 @test_int(i32 -536870912)
%15 = tail call i32 @test_uint(i32 0)
%16 = tail call i32 @test_uint(i32 1)
%17 = tail call i32 @test_uint(i32 1073741822)
store i32 1073741823, i32* %2
%18 = tail call i32 @test_uint(i32 1073741823)
%19 = tail call i32 @test_ptr(i8* null)
%20 = call i32 @test_ptr(i8* %4)
%21 = call i32 @test_ptr(i8* %5)
%22 = bitcast i8** %3 to i8***
store i8** %3, i8*** %22
%23 = call i32 @test_ptr(i8* %6)
ret i32 0
}