#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*/ close_files();
int /*<<< orphan*/ generate_idt();
int /*<<< orphan*/ generate_interrupt_vector_bitmap();
int /*<<< orphan*/ get_exec_name(char *);
int /*<<< orphan*/ get_options(int, char **);
int /*<<< orphan*/ open_files();
int /*<<< orphan*/ read_input_file();
int /*<<< orphan*/ validate_input_file();
int main(int argc, char *argv[]) {
  get_exec_name(argv[0]);
  get_options(argc, argv);
  open_files();
  read_input_file();
  validate_input_file();
  generate_interrupt_vector_bitmap();
  generate_idt();
  close_files();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <get_exec_name@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <get_options@plt>
mov    $0x0,%al
call   1050 <open_files@plt>
mov    $0x0,%al
call   1070 <read_input_file@plt>
mov    $0x0,%al
call   10a0 <validate_input_file@plt>
mov    $0x0,%al
call   1040 <generate_interrupt_vector_bitmap@plt>
mov    $0x0,%al
call   1030 <generate_idt@plt>
mov    $0x0,%al
call   1080 <close_files@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rdi
call   1060 <get_exec_name@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <get_options@plt>
xor    %eax,%eax
call   1050 <open_files@plt>
xor    %eax,%eax
call   1070 <read_input_file@plt>
xor    %eax,%eax
call   10a0 <validate_input_file@plt>
xor    %eax,%eax
call   1040 <generate_interrupt_vector_bitmap@plt>
xor    %eax,%eax
call   1030 <generate_idt@plt>
xor    %eax,%eax
call   1080 <close_files@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @get_exec_name(i8* %8)
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
%12 = call i32 @get_options(i32 %10, i8** %11)
%13 = call i32 (...) @open_files()
%14 = call i32 (...) @read_input_file()
%15 = call i32 (...) @validate_input_file()
%16 = call i32 (...) @generate_interrupt_vector_bitmap()
%17 = call i32 (...) @generate_idt()
%18 = call i32 (...) @close_files()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @get_exec_name(i8* %3)
%5 = tail call i32 @get_options(i32 %0, i8** %1)
%6 = tail call i32 (...) @open_files()
%7 = tail call i32 (...) @read_input_file()
%8 = tail call i32 (...) @validate_input_file()
%9 = tail call i32 (...) @generate_interrupt_vector_bitmap()
%10 = tail call i32 (...) @generate_idt()
%11 = tail call i32 (...) @close_files()
ret i32 0
}