#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*/ do_file(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qstr_init();
int /*<<< orphan*/ rt_deinit();
int /*<<< orphan*/ rt_init();
int main(int argc, char **argv) {
  qstr_init();
  rt_init();
  if (argc == 2) {
    do_file(argv[1]);
  } else {
    printf("usage: py [<file>]\n");
    return 1;
  }
  rt_deinit();
  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   1040 <qstr_init@plt>
mov    $0x0,%al
call   1070 <rt_init@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1190 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <do_file@plt>
jmp    11a8 <main+0x58>
lea    0xe69(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b6 <main+0x66>
mov    $0x0,%al
call   1060 <rt_deinit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <qstr_init@plt>
xor    %eax,%eax
call   1070 <rt_init@plt>
cmp    $0x2,%ebp
jne    1180 <main+0x30>
mov    0x8(%r14),%rdi
call   1030 <do_file@plt>
xor    %eax,%eax
call   1060 <rt_deinit@plt>
jmp    1191 <main+0x41>
lea    0xe79(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"usage: py [<file>]\0A\00"
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 (...) @qstr_init()
%7 = call i32 (...) @rt_init()
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @do_file(i8* %13)
br label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %19
17: ; preds = %10
%18 = call i32 (...) @rt_deinit()
store i32 0, i32* %3
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@str = [19 x i8] c"usage: py [<file>]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @qstr_init()
%4 = tail call i32 (...) @rt_init()
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @do_file(i8* %8)
%10 = tail call i32 (...) @rt_deinit()
br label %13
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %6, %11
%14 = phi i32 [ 0, %6 ], [ 1, %11 ]
ret i32 %14
}