#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*/ fprintf(int /*<<< orphan*/, char *);
char getchar();
int /*<<< orphan*/ load_bsp_map(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char t;
  fprintf(stderr, "BSP Tree contains: \n");
  fprintf(stderr, "----------------------\n");
  load_bsp_map("c:\\quake2\\baseq2\\maps\\q2dm2.bsp");
  fprintf(stderr, "----------------------\n\n\n\n");
  printf("waiting for your input  ");
  t = getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xea6(%rip),%rdi
call   1030 <load_bsp_map@plt>
mov    0x2e4d(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x11(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e98(%rip),%rbx
mov    (%rbx),%edi
lea    0xeaf(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb6(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xec2(%rip),%rdi
call   1030 <load_bsp_map@plt>
mov    (%rbx),%edi
lea    0xed4(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xee3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"BSP Tree contains: \0A\00"
@.str.1 = [24 x i8] c"----------------------\0A\00"
@.str.2 = [32 x i8] c"c:\\quake2\\baseq2\\maps\\q2dm2.bsp\00"
@.str.3 = [27 x i8] c"----------------------\0A\0A\0A\0A\00"
@.str.4 = [25 x i8] c"waiting for your input \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @load_bsp_map(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%15 = call signext i8 (...) @getchar()
store i8 %15, i8* %6
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"BSP Tree contains: \0A\00"
@.str.1 = [24 x i8] c"----------------------\0A\00"
@.str.2 = [32 x i8] c"c:\\quake2\\baseq2\\maps\\q2dm2.bsp\00"
@.str.3 = [27 x i8] c"----------------------\0A\0A\0A\0A\00"
@.str.4 = [25 x i8] c"waiting for your input \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @load_bsp_map(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%11 = tail call signext i8 (...) @getchar()
ret i32 0
}