#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*/ adc_init();
int /*<<< orphan*/ gpio_a_output(int);
int /*<<< orphan*/ led_init(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rcc_init();
int /*<<< orphan*/ relay_open();
int /*<<< orphan*/ serial_cmd();
int /*<<< orphan*/ serial_init();
int /*<<< orphan*/ serial_puts(char *);
int /*<<< orphan*/ systick_init_int(int);
void startup(void) {
  int t;
  unsigned long systick_next;
  rcc_init();
  serial_init();
  printf(" -- Booting ------------------------------\n");
  adc_init();
  led_init(13);
  gpio_a_output(2);
  systick_init_int(72 * 1000 * 2000);
  relay_open();
  serial_cmd();
  serial_puts("Main is spinning\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <rcc_init@plt>
mov    $0x0,%al
call   10c0 <serial_init@plt>
lea    0xe43(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <adc_init@plt>
mov    $0xd,%edi
call   1070 <led_init@plt>
mov    $0x2,%edi
call   1090 <gpio_a_output@plt>
mov    $0x8954400,%edi
call   1040 <systick_init_int@plt>
mov    $0x0,%al
call   1080 <relay_open@plt>
mov    $0x0,%al
call   1030 <serial_cmd@plt>
lea    0xe30(%rip),%rdi
call   10a0 <serial_puts@plt>
jmp    1201 <startup+0x61>

x86 assembly (clang, -O2):
<startup>:
push   %rax
xor    %eax,%eax
call   1060 <rcc_init@plt>
xor    %eax,%eax
call   10c0 <serial_init@plt>
lea    0xe5c(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10b0 <adc_init@plt>
mov    $0xd,%edi
call   1070 <led_init@plt>
mov    $0x2,%edi
call   1090 <gpio_a_output@plt>
mov    $0x8954400,%edi
call   1040 <systick_init_int@plt>
xor    %eax,%eax
call   1080 <relay_open@plt>
xor    %eax,%eax
call   1030 <serial_cmd@plt>
lea    0xe0b(%rip),%rdi
call   10a0 <serial_puts@plt>
nopw   0x0(%rax,%rax,1)
jmp    1200 <startup+0x60>

LLVM IR (-O0):
@.str = [44 x i8] c" -- Booting ------------------------------\0A\00"
@.str.1 = [18 x i8] c"Main is spinning\0A\00"
define void @startup() {
%1 = alloca i32
%2 = alloca i64
%3 = call i32 (...) @rcc_init()
%4 = call i32 (...) @serial_init()
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @adc_init()
%7 = call i32 @led_init(i32 13)
%8 = call i32 @gpio_a_output(i32 2)
%9 = call i32 @systick_init_int(i32 144000000)
%10 = call i32 (...) @relay_open()
%11 = call i32 (...) @serial_cmd()
%12 = call i32 @serial_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %13, %0
br label %13
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"Main is spinning\0A\00"
@str = [43 x i8] c" -- Booting ------------------------------\00"
define void @startup() {
%1 = tail call i32 (...) @rcc_init()
%2 = tail call i32 (...) @serial_init()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @adc_init()
%5 = tail call i32 @led_init(i32 13)
%6 = tail call i32 @gpio_a_output(i32 2)
%7 = tail call i32 @systick_init_int(i32 144000000)
%8 = tail call i32 (...) @relay_open()
%9 = tail call i32 (...) @serial_cmd()
%10 = tail call i32 @serial_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %11, %0
br label %11
}