#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*/ cache_test();
int /*<<< orphan*/ divtest();
int /*<<< orphan*/ edac_test();
int /*<<< orphan*/ fail(int);
int /*<<< orphan*/ fpu_test();
int /*<<< orphan*/ ioport_test();
int /*<<< orphan*/ irq_test();
int /*<<< orphan*/ memtest();
int /*<<< orphan*/ multest();
int regtest();
int /*<<< orphan*/ report(int);
int /*<<< orphan*/ timer_test();
int /*<<< orphan*/ uart_test();
int /*<<< orphan*/ wp_test();
leon_test() {
  report(0);
  report(2);
  if (regtest() != 1)
    fail(1);
  multest();
  divtest();
  wp_test();
  fpu_test();
  memtest();
  edac_test();
  cache_test();
  irq_test();
  uart_test();
  timer_test();
  ioport_test();
  report(19);
}


x86 assembly (clang, -O0):
<leon_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   10f0 <report@plt>
mov    $0x2,%edi
call   10f0 <report@plt>
mov    $0x0,%al
call   1100 <regtest@plt>
cmp    $0x1,%eax
je     1213 <leon_test+0x33>
mov    $0x1,%edi
call   1030 <fail@plt>
mov    $0x0,%al
call   1050 <multest@plt>
mov    $0x0,%al
call   10d0 <divtest@plt>
mov    $0x0,%al
call   1080 <wp_test@plt>
mov    $0x0,%al
call   10a0 <fpu_test@plt>
mov    $0x0,%al
call   10b0 <memtest@plt>
mov    $0x0,%al
call   10c0 <edac_test@plt>
mov    $0x0,%al
call   1060 <cache_test@plt>
mov    $0x0,%al
call   1040 <irq_test@plt>
mov    $0x0,%al
call   1070 <uart_test@plt>
mov    $0x0,%al
call   10e0 <timer_test@plt>
mov    $0x0,%al
call   1090 <ioport_test@plt>
mov    $0x13,%edi
call   10f0 <report@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leon_test>:
push   %rax
xor    %edi,%edi
call   10f0 <report@plt>
mov    $0x2,%edi
call   10f0 <report@plt>
xor    %eax,%eax
call   1100 <regtest@plt>
cmp    $0x1,%eax
je     1208 <leon_test+0x28>
mov    $0x1,%edi
call   1030 <fail@plt>
xor    %eax,%eax
call   1050 <multest@plt>
xor    %eax,%eax
call   10d0 <divtest@plt>
xor    %eax,%eax
call   1080 <wp_test@plt>
xor    %eax,%eax
call   10a0 <fpu_test@plt>
xor    %eax,%eax
call   10b0 <memtest@plt>
xor    %eax,%eax
call   10c0 <edac_test@plt>
xor    %eax,%eax
call   1060 <cache_test@plt>
xor    %eax,%eax
call   1040 <irq_test@plt>
xor    %eax,%eax
call   1070 <uart_test@plt>
xor    %eax,%eax
call   10e0 <timer_test@plt>
xor    %eax,%eax
call   1090 <ioport_test@plt>
mov    $0x13,%edi
pop    %rax
jmp    10f0 <report@plt>

LLVM IR (-O0):
define i32 @leon_test() {
%1 = alloca i32
%2 = call i32 @report(i32 0)
%3 = call i32 @report(i32 2)
%4 = call i32 (...) @regtest()
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @fail(i32 1)
br label %8
8: ; preds = %6, %0
%9 = call i32 (...) @multest()
%10 = call i32 (...) @divtest()
%11 = call i32 (...) @wp_test()
%12 = call i32 (...) @fpu_test()
%13 = call i32 (...) @memtest()
%14 = call i32 (...) @edac_test()
%15 = call i32 (...) @cache_test()
%16 = call i32 (...) @irq_test()
%17 = call i32 (...) @uart_test()
%18 = call i32 (...) @timer_test()
%19 = call i32 (...) @ioport_test()
%20 = call i32 @report(i32 19)
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @leon_test() {
%1 = tail call i32 @report(i32 0)
%2 = tail call i32 @report(i32 2)
%3 = tail call i32 (...) @regtest()
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @fail(i32 1)
br label %7
7: ; preds = %5, %0
%8 = tail call i32 (...) @multest()
%9 = tail call i32 (...) @divtest()
%10 = tail call i32 (...) @wp_test()
%11 = tail call i32 (...) @fpu_test()
%12 = tail call i32 (...) @memtest()
%13 = tail call i32 (...) @edac_test()
%14 = tail call i32 (...) @cache_test()
%15 = tail call i32 (...) @irq_test()
%16 = tail call i32 (...) @uart_test()
%17 = tail call i32 (...) @timer_test()
%18 = tail call i32 (...) @ioport_test()
%19 = tail call i32 @report(i32 19)
ret i32 undef
}