#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 EXIT_FAILURE;
int EXIT_SUCCESS;
unsigned int radeon_compiler_optimize_run_tests();
unsigned int radeon_compiler_regalloc_run_tests();
unsigned int radeon_compiler_util_run_tests();
int main(int argc, char **argv) {
  unsigned pass = 1;
  pass &= radeon_compiler_optimize_run_tests();
  pass &= radeon_compiler_regalloc_run_tests();
  pass &= radeon_compiler_util_run_tests();
  if (pass) {
    return EXIT_SUCCESS;
  } else {
    return EXIT_FAILURE;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1040 <radeon_compiler_optimize_run_tests@plt>
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <radeon_compiler_regalloc_run_tests@plt>
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <radeon_compiler_util_run_tests@plt>
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     118f <main+0x5f>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    119b <main+0x6b>
mov    0x2e4a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <radeon_compiler_optimize_run_tests@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <radeon_compiler_regalloc_run_tests@plt>
mov    %eax,%ebp
and    %ebx,%ebp
xor    %eax,%eax
call   1050 <radeon_compiler_util_run_tests@plt>
and    %ebp,%eax
test   $0x1,%al
jne    115d <main+0x2d>
mov    0x2e85(%rip),%rax
jmp    1164 <main+0x34>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = call i32 (...) @radeon_compiler_optimize_run_tests()
%8 = load i32, i32* %6
%9 = and i32 %8, %7
store i32 %9, i32* %6
%10 = call i32 (...) @radeon_compiler_regalloc_run_tests()
%11 = load i32, i32* %6
%12 = and i32 %11, %10
store i32 %12, i32* %6
%13 = call i32 (...) @radeon_compiler_util_run_tests()
%14 = load i32, i32* %6
%15 = and i32 %14, %13
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = load i32, i32* @EXIT_SUCCESS
store i32 %19, i32* %3
br label %22
20: ; preds = %2
%21 = load i32, i32* @EXIT_FAILURE
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %18
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @radeon_compiler_optimize_run_tests()
%4 = and i32 %3, 1
%5 = tail call i32 (...) @radeon_compiler_regalloc_run_tests()
%6 = and i32 %4, %5
%7 = tail call i32 (...) @radeon_compiler_util_run_tests()
%8 = and i32 %6, %7
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* @EXIT_FAILURE
%11 = load i32, i32* @EXIT_SUCCESS
%12 = select i1 %9, i32 %10, i32 %11
ret i32 %12
}