#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*/ printf(char *, ...);
int test_int();
int test_long();
int test_longlong();
int test_unsignedint();
int test_unsignedlong();
int test_unsignedlonglong();
int main() {
  int r;
  if ((r = test_int())) {
    printf("failed at int(%d)\n", r);
    return 1;
  }
  if ((r = test_unsignedint())) {
    printf("failed at unsigned int(%d)\n", r);
    return 1;
  }
  if ((r = test_long())) {
    printf("failed at long(%d)\n", r);
    return 1;
  }
  if ((r = test_unsignedlong())) {
    printf("failed at unsigned long(%d)\n", r);
    return 1;
  }
  if ((r = test_longlong())) {
    printf("failed at long long(%d)\n", r);
    return 1;
  }
  if ((r = test_unsignedlonglong())) {
    printf("failed at unsigned long long(%d)\n", r);
    return 1;
  }
  printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <test_int@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     11af <main+0x3f>
mov    -0x8(%rbp),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <main+0x144>
mov    $0x0,%al
call   1080 <test_unsignedint@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     11df <main+0x6f>
mov    -0x8(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <main+0x144>
mov    $0x0,%al
call   1070 <test_long@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     120f <main+0x9f>
mov    -0x8(%rbp),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <main+0x144>
mov    $0x0,%al
call   1040 <test_unsignedlong@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     123f <main+0xcf>
mov    -0x8(%rbp),%esi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <main+0x144>
mov    $0x0,%al
call   1060 <test_longlong@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     126f <main+0xff>
mov    -0x8(%rbp),%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <main+0x144>
mov    $0x0,%al
call   1030 <test_unsignedlonglong@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     129f <main+0x12f>
mov    -0x8(%rbp),%esi
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b4 <main+0x144>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   10a0 <test_int@plt>
test   %eax,%eax
je     1195 <main+0x15>
lea    0xe6d(%rip),%rdi
jmp    11f9 <main+0x79>
xor    %eax,%eax
call   1090 <test_unsignedint@plt>
test   %eax,%eax
je     11a9 <main+0x29>
lea    0xe6c(%rip),%rdi
jmp    11f9 <main+0x79>
xor    %eax,%eax
call   1080 <test_long@plt>
test   %eax,%eax
je     11bd <main+0x3d>
lea    0xe74(%rip),%rdi
jmp    11f9 <main+0x79>
xor    %eax,%eax
call   1050 <test_unsignedlong@plt>
test   %eax,%eax
je     11d1 <main+0x51>
lea    0xe74(%rip),%rdi
jmp    11f9 <main+0x79>
xor    %eax,%eax
call   1070 <test_longlong@plt>
test   %eax,%eax
je     11e5 <main+0x65>
lea    0xe7d(%rip),%rdi
jmp    11f9 <main+0x79>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <test_unsignedlonglong@plt>
test   %eax,%eax
je     120b <main+0x8b>
lea    0xe80(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
jmp    1207 <main+0x87>

LLVM IR (-O0):
@.str = [19 x i8] c"failed at int(%d)\0A\00"
@.str.1 = [28 x i8] c"failed at unsigned int(%d)\0A\00"
@.str.2 = [20 x i8] c"failed at long(%d)\0A\00"
@.str.3 = [29 x i8] c"failed at unsigned long(%d)\0A\00"
@.str.4 = [25 x i8] c"failed at long long(%d)\0A\00"
@.str.5 = [34 x i8] c"failed at unsigned long long(%d)\0A\00"
@.str.6 = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @test_int()
store i32 %3, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 1, i32* %1
br label %40
8: ; preds = %0
%9 = call i32 (...) @test_unsignedint()
store i32 %9, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %12)
store i32 1, i32* %1
br label %40
14: ; preds = %8
%15 = call i32 (...) @test_long()
store i32 %15, i32* %2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i32 1, i32* %1
br label %40
20: ; preds = %14
%21 = call i32 (...) @test_unsignedlong()
store i32 %21, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %24)
store i32 1, i32* %1
br label %40
26: ; preds = %20
%27 = call i32 (...) @test_longlong()
store i32 %27, i32* %2
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %30)
store i32 1, i32* %1
br label %40
32: ; preds = %26
%33 = call i32 (...) @test_unsignedlonglong()
store i32 %33, i32* %2
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i32, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %36)
store i32 1, i32* %1
br label %40
38: ; preds = %32
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %40
40: ; preds = %38, %35, %29, %23, %17, %11, %5
%41 = load i32, i32* %1
ret i32 %41
}

LLVM IR (-O2):
@.str = [19 x i8] c"failed at int(%d)\0A\00"
@.str.1 = [28 x i8] c"failed at unsigned int(%d)\0A\00"
@.str.2 = [20 x i8] c"failed at long(%d)\0A\00"
@.str.3 = [29 x i8] c"failed at unsigned long(%d)\0A\00"
@.str.4 = [25 x i8] c"failed at long long(%d)\0A\00"
@.str.5 = [34 x i8] c"failed at unsigned long long(%d)\0A\00"
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 (...) @test_int()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %32
5: ; preds = %0
%6 = tail call i32 (...) @test_unsignedint()
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %32
10: ; preds = %5
%11 = tail call i32 (...) @test_long()
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %32
15: ; preds = %10
%16 = tail call i32 (...) @test_unsignedlong()
%17 = icmp eq i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %32
20: ; preds = %15
%21 = tail call i32 (...) @test_longlong()
%22 = icmp eq i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %21)
br label %32
25: ; preds = %20
%26 = tail call i32 (...) @test_unsignedlonglong()
%27 = icmp eq i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %26)
br label %32
30: ; preds = %25
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %32
32: ; preds = %30, %28, %23, %18, %13, %8, %3
%33 = phi i32 [ 1, %3 ], [ 1, %8 ], [ 1, %13 ], [ 1, %18 ], [ 1, %23 ], [ 1, %28 ], [ 0, %30 ]
ret i32 %33
}