#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*/ init_ethmac();
int /*<<< orphan*/ init_led();
int /*<<< orphan*/ init_malloc();
int /*<<< orphan*/ init_serial();
int /*<<< orphan*/ init_tftp();
int /*<<< orphan*/ init_timer();
int /*<<< orphan*/ listen_telnet();
int /*<<< orphan*/ print_serial(char *);
int /*<<< orphan*/ process_led();
int /*<<< orphan*/ process_sockets();
int /*<<< orphan*/ process_tftp();
int main(void) {
  init_serial();
  print_serial("Amber debug port\n\r");
  init_malloc();
  init_timer();
  init_led();
  init_ethmac();
  listen_telnet();
  init_tftp();
  while (1) {
    process_led();
    process_tftp();
    process_sockets();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10d0 <init_serial@plt>
lea    0xe33(%rip),%rdi
call   1030 <print_serial@plt>
mov    $0x0,%al
call   1050 <init_malloc@plt>
mov    $0x0,%al
call   1090 <init_timer@plt>
mov    $0x0,%al
call   1060 <init_led@plt>
mov    $0x0,%al
call   10c0 <init_ethmac@plt>
mov    $0x0,%al
call   10b0 <listen_telnet@plt>
mov    $0x0,%al
call   1070 <init_tftp@plt>
mov    $0x0,%al
call   1080 <process_led@plt>
mov    $0x0,%al
call   1040 <process_tftp@plt>
mov    $0x0,%al
call   10a0 <process_sockets@plt>
jmp    11fc <main+0x4c>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10d0 <init_serial@plt>
lea    0xe41(%rip),%rdi
call   1030 <print_serial@plt>
xor    %eax,%eax
call   1050 <init_malloc@plt>
xor    %eax,%eax
call   1090 <init_timer@plt>
xor    %eax,%eax
call   1060 <init_led@plt>
xor    %eax,%eax
call   10c0 <init_ethmac@plt>
xor    %eax,%eax
call   10b0 <listen_telnet@plt>
xor    %eax,%eax
call   1070 <init_tftp@plt>
xchg   %ax,%ax
xor    %eax,%eax
call   1080 <process_led@plt>
xor    %eax,%eax
call   1040 <process_tftp@plt>
xor    %eax,%eax
call   10a0 <process_sockets@plt>
jmp    11f0 <main+0x40>

LLVM IR (-O0):
@.str = [19 x i8] c"Amber debug port\0A\0D\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_serial()
%3 = call i32 @print_serial(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @init_malloc()
%5 = call i32 (...) @init_timer()
%6 = call i32 (...) @init_led()
%7 = call i32 (...) @init_ethmac()
%8 = call i32 (...) @listen_telnet()
%9 = call i32 (...) @init_tftp()
br label %10
10: ; preds = %0, %10
%11 = call i32 (...) @process_led()
%12 = call i32 (...) @process_tftp()
%13 = call i32 (...) @process_sockets()
br label %10
}

LLVM IR (-O2):
@.str = [19 x i8] c"Amber debug port\0A\0D\00"
define i32 @main() {
%1 = tail call i32 (...) @init_serial()
%2 = tail call i32 @print_serial(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @init_malloc()
%4 = tail call i32 (...) @init_timer()
%5 = tail call i32 (...) @init_led()
%6 = tail call i32 (...) @init_ethmac()
%7 = tail call i32 (...) @listen_telnet()
%8 = tail call i32 (...) @init_tftp()
br label %9
9: ; preds = %0, %9
%10 = tail call i32 (...) @process_led()
%11 = tail call i32 (...) @process_tftp()
%12 = tail call i32 (...) @process_sockets()
br label %9
}