#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_basic();
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_basic())) {
    printf("failed at basic(%d)\n", r);
    return 1;
  }
  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   10a0 <test_basic@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     11bf <main+0x3f>
mov    -0x8(%rbp),%esi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
mov    $0x0,%al
call   1090 <test_int@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     11ef <main+0x6f>
mov    -0x8(%rbp),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
mov    $0x0,%al
call   1080 <test_unsignedint@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     121f <main+0x9f>
mov    -0x8(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
mov    $0x0,%al
call   1070 <test_long@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     124f <main+0xcf>
mov    -0x8(%rbp),%esi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
mov    $0x0,%al
call   1040 <test_unsignedlong@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     127f <main+0xff>
mov    -0x8(%rbp),%esi
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
mov    $0x0,%al
call   1060 <test_longlong@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     12af <main+0x12f>
mov    -0x8(%rbp),%esi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
mov    $0x0,%al
call   1030 <test_unsignedlonglong@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     12df <main+0x15f>
mov    -0x8(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12f4 <main+0x174>
lea    0xdca(%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   10b0 <test_basic@plt>
test   %eax,%eax
je     11a5 <main+0x15>
lea    0xe5d(%rip),%rdi
jmp    121d <main+0x8d>
xor    %eax,%eax
call   10a0 <test_int@plt>
test   %eax,%eax
je     11b9 <main+0x29>
lea    0xe5e(%rip),%rdi
jmp    121d <main+0x8d>
xor    %eax,%eax
call   1090 <test_unsignedint@plt>
test   %eax,%eax
je     11cd <main+0x3d>
lea    0xe5d(%rip),%rdi
jmp    121d <main+0x8d>
xor    %eax,%eax
call   1080 <test_long@plt>
test   %eax,%eax
je     11e1 <main+0x51>
lea    0xe65(%rip),%rdi
jmp    121d <main+0x8d>
xor    %eax,%eax
call   1050 <test_unsignedlong@plt>
test   %eax,%eax
je     11f5 <main+0x65>
lea    0xe65(%rip),%rdi
jmp    121d <main+0x8d>
xor    %eax,%eax
call   1070 <test_longlong@plt>
test   %eax,%eax
je     1209 <main+0x79>
lea    0xe6e(%rip),%rdi
jmp    121d <main+0x8d>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <test_unsignedlonglong@plt>
test   %eax,%eax
je     122f <main+0x9f>
lea    0xe71(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
jmp    122b <main+0x9b>

LLVM IR (-O0):
@.str = [21 x i8] c"failed at basic(%d)\0A\00"
@.str.1 = [19 x i8] c"failed at int(%d)\0A\00"
@.str.2 = [28 x i8] c"failed at unsigned int(%d)\0A\00"
@.str.3 = [20 x i8] c"failed at long(%d)\0A\00"
@.str.4 = [29 x i8] c"failed at unsigned long(%d)\0A\00"
@.str.5 = [25 x i8] c"failed at long long(%d)\0A\00"
@.str.6 = [34 x i8] c"failed at unsigned long long(%d)\0A\00"
@.str.7 = [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_basic()
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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 1, i32* %1
br label %46
8: ; preds = %0
%9 = call i32 (...) @test_int()
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 ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %12)
store i32 1, i32* %1
br label %46
14: ; preds = %8
%15 = call i32 (...) @test_unsignedint()
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 ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %18)
store i32 1, i32* %1
br label %46
20: ; preds = %14
%21 = call i32 (...) @test_long()
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 ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %24)
store i32 1, i32* %1
br label %46
26: ; preds = %20
%27 = call i32 (...) @test_unsignedlong()
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 ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %30)
store i32 1, i32* %1
br label %46
32: ; preds = %26
%33 = call i32 (...) @test_longlong()
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 ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %36)
store i32 1, i32* %1
br label %46
38: ; preds = %32
%39 = call i32 (...) @test_unsignedlonglong()
store i32 %39, i32* %2
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %2
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %42)
store i32 1, i32* %1
br label %46
44: ; preds = %38
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %46
46: ; preds = %44, %41, %35, %29, %23, %17, %11, %5
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [21 x i8] c"failed at basic(%d)\0A\00"
@.str.1 = [19 x i8] c"failed at int(%d)\0A\00"
@.str.2 = [28 x i8] c"failed at unsigned int(%d)\0A\00"
@.str.3 = [20 x i8] c"failed at long(%d)\0A\00"
@.str.4 = [29 x i8] c"failed at unsigned long(%d)\0A\00"
@.str.5 = [25 x i8] c"failed at long long(%d)\0A\00"
@.str.6 = [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_basic()
%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 ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %37
5: ; preds = %0
%6 = tail call i32 (...) @test_int()
%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 ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %37
10: ; preds = %5
%11 = tail call i32 (...) @test_unsignedint()
%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 ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %37
15: ; preds = %10
%16 = tail call i32 (...) @test_long()
%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 ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %37
20: ; preds = %15
%21 = tail call i32 (...) @test_unsignedlong()
%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 ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i32 %21)
br label %37
25: ; preds = %20
%26 = tail call i32 (...) @test_longlong()
%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 ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %26)
br label %37
30: ; preds = %25
%31 = tail call i32 (...) @test_unsignedlonglong()
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %31)
br label %37
35: ; preds = %30
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %37
37: ; preds = %35, %33, %28, %23, %18, %13, %8, %3
%38 = phi i32 [ 1, %3 ], [ 1, %8 ], [ 1, %13 ], [ 1, %18 ], [ 1, %23 ], [ 1, %28 ], [ 1, %33 ], [ 0, %35 ]
ret i32 %38
}