#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_registers1();
int /*<<< orphan*/ dump_spd_registers2();
int /*<<< orphan*/ enable_smbus();
int /*<<< orphan*/ enumerate_ht_chain();
int /*<<< orphan*/ print_pci_devices();
int /*<<< orphan*/ ram_fill(int, int);
int /*<<< orphan*/ ram_verify(int, int);
int /*<<< orphan*/ sdram_initialize();
int /*<<< orphan*/ setup_coherent_ht_domain();
int /*<<< orphan*/ uart_init();
void main(void) {
  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_registers1();
    dump_spd_registers2();
    ram_fill(0x00000000, 0x00001000);
    ram_verify(0x00000000, 0x00001000);
  }
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <uart_init@plt>
xor    %eax,%eax
call   1030 <console_init@plt>
xor    %eax,%eax
call   10e0 <boot_cpu@plt>
test   %rax,%rax
je     11f6 <main+0x26>
xor    %eax,%eax
call   1070 <cpu_init_detected@plt>
test   %eax,%eax
je     11f8 <main+0x28>
pop    %rax
ret
xor    %eax,%eax
call   1060 <setup_coherent_ht_domain@plt>
xor    %eax,%eax
call   10d0 <enumerate_ht_chain@plt>
xor    %eax,%eax
call   1050 <print_pci_devices@plt>
xor    %eax,%eax
call   1090 <enable_smbus@plt>
xor    %eax,%eax
call   10f0 <sdram_initialize@plt>
xor    %eax,%eax
call   10a0 <dump_spd_registers1@plt>
xor    %eax,%eax
call   10b0 <dump_spd_registers2@plt>
xor    %edi,%edi
mov    $0x1000,%esi
call   1040 <ram_fill@plt>
xor    %edi,%edi
mov    $0x1000,%esi
pop    %rax
jmp    10c0 <ram_verify@plt>

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

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