#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 */
scalar_t__ boot_cpu();
int /*<<< orphan*/ console_init();
int /*<<< orphan*/ cpu_init_detected();
int /*<<< orphan*/ dump_spd_registers();
int /*<<< orphan*/ enable_smbus();
int /*<<< orphan*/ enumerate_ht_chain();
int /*<<< orphan*/ pc87360_enable_serial();
int /*<<< orphan*/ print_pci_devices();
int /*<<< orphan*/ ram_check(int, int);
int /*<<< orphan*/ sdram_initialize();
int /*<<< orphan*/ setup_coherent_ht_domain();
int /*<<< orphan*/ uart_init();
void main(void) {
  pc87360_enable_serial();
  uart_init();
  console_init();
  if (boot_cpu() && !cpu_init_detected()) {
    setup_coherent_ht_domain();
    enumerate_ht_chain();
    print_pci_devices();
    enable_smbus();
    sdram_initialize();
    dump_spd_registers();
    ram_check(0x00000000, 0x00001000);
    ram_check(0x00000000, 0x00180000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10e0 <pc87360_enable_serial@plt>
mov    $0x0,%al
call   1080 <uart_init@plt>
mov    $0x0,%al
call   1030 <console_init@plt>
mov    $0x0,%al
call   10b0 <boot_cpu@plt>
cmp    $0x0,%rax
je     123c <main+0x7c>
mov    $0x0,%al
call   1070 <cpu_init_detected@plt>
cmp    $0x0,%eax
jne    123c <main+0x7c>
mov    $0x0,%al
call   1060 <setup_coherent_ht_domain@plt>
mov    $0x0,%al
call   10a0 <enumerate_ht_chain@plt>
mov    $0x0,%al
call   1040 <print_pci_devices@plt>
mov    $0x0,%al
call   1090 <enable_smbus@plt>
mov    $0x0,%al
call   10d0 <sdram_initialize@plt>
mov    $0x0,%al
call   1050 <dump_spd_registers@plt>
xor    %edi,%edi
mov    $0x1000,%esi
call   10c0 <ram_check@plt>
xor    %edi,%edi
mov    $0x180000,%esi
call   10c0 <ram_check@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10e0 <pc87360_enable_serial@plt>
xor    %eax,%eax
call   1080 <uart_init@plt>
xor    %eax,%eax
call   1030 <console_init@plt>
xor    %eax,%eax
call   10b0 <boot_cpu@plt>
test   %rax,%rax
je     11ed <main+0x2d>
xor    %eax,%eax
call   1070 <cpu_init_detected@plt>
test   %eax,%eax
je     11ef <main+0x2f>
pop    %rax
ret
xor    %eax,%eax
call   1060 <setup_coherent_ht_domain@plt>
xor    %eax,%eax
call   10a0 <enumerate_ht_chain@plt>
xor    %eax,%eax
call   1040 <print_pci_devices@plt>
xor    %eax,%eax
call   1090 <enable_smbus@plt>
xor    %eax,%eax
call   10d0 <sdram_initialize@plt>
xor    %eax,%eax
call   1050 <dump_spd_registers@plt>
xor    %edi,%edi
mov    $0x1000,%esi
call   10c0 <ram_check@plt>
xor    %edi,%edi
mov    $0x180000,%esi
pop    %rax
jmp    10c0 <ram_check@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @pc87360_enable_serial()
%2 = call i32 (...) @uart_init()
%3 = call i32 (...) @console_init()
%4 = call i64 (...) @boot_cpu()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %0
%7 = call i32 (...) @cpu_init_detected()
%8 = icmp ne i32 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = call i32 (...) @setup_coherent_ht_domain()
%11 = call i32 (...) @enumerate_ht_chain()
%12 = call i32 (...) @print_pci_devices()
%13 = call i32 (...) @enable_smbus()
%14 = call i32 (...) @sdram_initialize()
%15 = call i32 (...) @dump_spd_registers()
%16 = call i32 @ram_check(i32 0, i32 4096)
%17 = call i32 @ram_check(i32 0, i32 1572864)
br label %18
18: ; preds = %9, %6, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @pc87360_enable_serial()
%2 = tail call i32 (...) @uart_init()
%3 = tail call i32 (...) @console_init()
%4 = tail call i64 (...) @boot_cpu()
%5 = icmp eq i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %0
%7 = tail call i32 (...) @cpu_init_detected()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = tail call i32 (...) @setup_coherent_ht_domain()
%11 = tail call i32 (...) @enumerate_ht_chain()
%12 = tail call i32 (...) @print_pci_devices()
%13 = tail call i32 (...) @enable_smbus()
%14 = tail call i32 (...) @sdram_initialize()
%15 = tail call i32 (...) @dump_spd_registers()
%16 = tail call i32 @ram_check(i32 0, i32 4096)
%17 = tail call i32 @ram_check(i32 0, i32 1572864)
br label %18
18: ; preds = %9, %6, %0
ret void
}