#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ begin_indexing();
int /*<<< orphan*/ efclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *efopen(char *, char *);
int /*<<< orphan*/ end_indexing();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ parse(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  FILE *xmlfile;
  if (argc != 2) {
    fprintf(stderr, "Please specify the file to index as an argument!\n");
    return EXIT_FAILURE;
  }
  xmlfile = efopen(argv[1], "r");
  begin_indexing();
  parse(xmlfile);
  end_indexing();
  efclose(xmlfile);
  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)
cmpl   $0x2,-0x8(%rbp)
je     11a6 <main+0x46>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
lea    0xe70(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11e5 <main+0x85>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <efopen@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <begin_indexing@plt>
mov    -0x18(%rbp),%rdi
call   1070 <parse@plt>
mov    $0x0,%al
call   1030 <end_indexing@plt>
mov    -0x18(%rbp),%rdi
call   1080 <efclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    119e <main+0x3e>
mov    0x8(%rsi),%rdi
lea    0xebe(%rip),%rsi
call   1040 <efopen@plt>
mov    %rax,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <begin_indexing@plt>
mov    %r14,%rdi
call   1070 <parse@plt>
xor    %eax,%eax
call   1030 <end_indexing@plt>
mov    %r14,%rdi
call   1080 <efclose@plt>
jmp    11bc <main+0x5c>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Please specify the file to index as an argument!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %3
br label %24
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32* @efopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %6
%18 = call i32 (...) @begin_indexing()
%19 = load i32*, i32** %6
%20 = call i32 @parse(i32* %19)
%21 = call i32 (...) @end_indexing()
%22 = load i32*, i32** %6
%23 = call i32 @efclose(i32* %22)
store i32 0, i32* %3
br label %24
24: ; preds = %13, %9
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Please specify the file to index as an argument!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
br label %16
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @efopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 (...) @begin_indexing()
%13 = tail call i32 @parse(i32* %11)
%14 = tail call i32 (...) @end_indexing()
%15 = tail call i32 @efclose(i32* %11)
br label %16
16: ; preds = %8, %4
%17 = phi i32 [ %7, %4 ], [ 0, %8 ]
ret i32 %17
}