#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 EXIT_SUCCESS;
int /*<<< orphan*/ menu();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_course_file(char *);
int /*<<< orphan*/ read_entrant_file(char *);
int /*<<< orphan*/ read_event_file(char *);
int /*<<< orphan*/ read_node_file(char *);
int /*<<< orphan*/ read_track_file(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char **argv) {
  char eventfile[256];
  char nodefile[256];
  char trackfile[256];
  char coursefile[256];
  char entrantfile[256];
  printf("Event file: ");
  scanf(" %255s", eventfile);
  printf("Node file: ");
  scanf(" %255s", nodefile);
  printf("Track file: ");
  scanf(" %255s", trackfile);
  printf("Course file: ");
  scanf(" %255s", coursefile);
  printf("Entrant file: ");
  scanf(" %255s", entrantfile);
  read_event_file(eventfile);
  read_node_file(nodefile);
  read_track_file(trackfile);
  read_course_file(coursefile);
  read_entrant_file(entrantfile);
  menu();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x510,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rsi
lea    0xe5a(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
lea    -0x210(%rbp),%rsi
lea    0xe3b(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe42(%rip),%rdi
call   1040 <printf@plt>
lea    -0x310(%rbp),%rsi
lea    0xe1c(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe30(%rip),%rdi
call   1040 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xdfd(%rip),%rdi
call   1070 <scanf@plt>
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x510(%rbp),%rsi
lea    0xdde(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1060 <read_event_file@plt>
lea    -0x210(%rbp),%rdi
call   1050 <read_node_file@plt>
lea    -0x310(%rbp),%rdi
call   1080 <read_track_file@plt>
lea    -0x410(%rbp),%rdi
call   1090 <read_course_file@plt>
lea    -0x510(%rbp),%rdi
call   10a0 <read_entrant_file@plt>
mov    $0x0,%al
call   1030 <menu@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%eax
add    $0x510,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x508,%rsp
lea    0xe68(%rip),%rdi
call   1040 <printf@plt>
lea    0xe69(%rip),%rbx
lea    0x400(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
lea    0x300(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
lea    0x200(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
lea    0x100(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
lea    0xe20(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1070 <scanf@plt>
mov    %r14,%rdi
call   1060 <read_event_file@plt>
mov    %r15,%rdi
call   1050 <read_node_file@plt>
mov    %r12,%rdi
call   1080 <read_track_file@plt>
mov    %r13,%rdi
call   1090 <read_course_file@plt>
mov    %rbp,%rdi
call   10a0 <read_entrant_file@plt>
xor    %eax,%eax
call   1030 <menu@plt>
mov    0x2d7c(%rip),%rax
mov    (%rax),%eax
add    $0x508,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Event file: \00"
@.str.1 = [7 x i8] c" %255s\00"
@.str.2 = [12 x i8] c"Node file: \00"
@.str.3 = [13 x i8] c"Track file: \00"
@.str.4 = [14 x i8] c"Course file: \00"
@.str.5 = [15 x i8] c"Entrant file: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
%10 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%25 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%27 = call i32 @read_event_file(i8* %26)
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%29 = call i32 @read_node_file(i8* %28)
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%31 = call i32 @read_track_file(i8* %30)
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%33 = call i32 @read_course_file(i8* %32)
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%35 = call i32 @read_entrant_file(i8* %34)
%36 = call i32 (...) @menu()
%37 = load i32, i32* @EXIT_SUCCESS
ret i32 %37
}

LLVM IR (-O2):
@.str = [13 x i8] c"Event file: \00"
@.str.1 = [7 x i8] c" %255s\00"
@.str.2 = [12 x i8] c"Node file: \00"
@.str.3 = [13 x i8] c"Track file: \00"
@.str.4 = [14 x i8] c"Course file: \00"
@.str.5 = [15 x i8] c"Entrant file: \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = alloca [256 x i8]
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%15 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%17 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%21 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%23 = call i32 @read_event_file(i8* %8)
%24 = call i32 @read_node_file(i8* %9)
%25 = call i32 @read_track_file(i8* %10)
%26 = call i32 @read_course_file(i8* %11)
%27 = call i32 @read_entrant_file(i8* %12)
%28 = call i32 (...) @menu()
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}