#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_ll();
int /*<<< orphan*/ printError();
int process_file(char *);
int /*<<< orphan*/ run();
int main(int argc, char *argv[]) {
  init_ll();
  if (argc == 1) {
    run();
  } else if (argc == 2) {
    return process_file(argv[1]);
  } else {
    printError();
    return 1;
  }
  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    $0x0,%al
call   1050 <init_ll@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1173 <main+0x33>
mov    $0x0,%al
call   1030 <run@plt>
jmp    11a5 <main+0x65>
cmpl   $0x2,-0x8(%rbp)
jne    1192 <main+0x52>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <process_file@plt>
mov    %eax,-0x4(%rbp)
jmp    11ac <main+0x6c>
mov    $0x0,%al
call   1060 <printError@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ac <main+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <init_ll@plt>
cmp    $0x2,%ebp
je     1164 <main+0x24>
cmp    $0x1,%ebp
jne    1173 <main+0x33>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <run@plt>
jmp    117f <main+0x3f>
mov    0x8(%rbx),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <process_file@plt>
xor    %eax,%eax
call   1060 <printError@plt>
mov    $0x1,%ebx
mov    %ebx,%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 = call i32 (...) @init_ll()
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @run()
br label %21
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @process_file(i8* %17)
store i32 %18, i32* %3
br label %22
19: ; preds = %11
%20 = call i32 (...) @printError()
store i32 1, i32* %3
br label %22
21: ; preds = %9
store i32 0, i32* %3
br label %22
22: ; preds = %21, %19, %14
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @init_ll()
switch i32 %0, label %10 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %2
%5 = tail call i32 (...) @run()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @process_file(i8* %8)
br label %12
10: ; preds = %2
%11 = tail call i32 (...) @printError()
br label %12
12: ; preds = %4, %10, %6
%13 = phi i32 [ 0, %4 ], [ %9, %6 ], [ 1, %10 ]
ret i32 %13
}