#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*/ led_init(int);
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rcc_init();
int /*<<< orphan*/ serial_init();
int /*<<< orphan*/ serial_puts(char *);
int /*<<< orphan*/ systick_init_int(int);
int /*<<< orphan*/ usb_init();
void startup(void) {
  int t;
  unsigned long systick_next;
  rcc_init();
  serial_init();
  printf(" -- Booting ------------------------------\n");
  usb_init();
  led_init(13);
  led_off();
  systick_init_int(72 * 1000);
  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   10a0 <serial_init@plt>
lea    0xe63(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1090 <usb_init@plt>
mov    $0xd,%edi
call   1070 <led_init@plt>
mov    $0x0,%al
call   1040 <led_off@plt>
mov    $0x11940,%edi
call   1030 <systick_init_int@plt>
lea    0xe61(%rip),%rdi
call   1080 <serial_puts@plt>
jmp    11d0 <startup+0x50>

x86 assembly (clang, -O2):
<startup>:
push   %rax
xor    %eax,%eax
call   1060 <rcc_init@plt>
xor    %eax,%eax
call   10a0 <serial_init@plt>
lea    0xe7c(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1090 <usb_init@plt>
mov    $0xd,%edi
call   1070 <led_init@plt>
xor    %eax,%eax
call   1040 <led_off@plt>
mov    $0x11940,%edi
call   1030 <systick_init_int@plt>
lea    0xe3c(%rip),%rdi
call   1080 <serial_puts@plt>
nopl   0x0(%rax)
jmp    11d0 <startup+0x50>

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 (...) @usb_init()
%7 = call i32 @led_init(i32 13)
%8 = call i32 (...) @led_off()
%9 = call i32 @systick_init_int(i32 72000)
%10 = 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
}

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 (...) @usb_init()
%5 = tail call i32 @led_init(i32 13)
%6 = tail call i32 (...) @led_off()
%7 = tail call i32 @systick_init_int(i32 72000)
%8 = tail call i32 @serial_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %9, %0
br label %9
}