#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 *);
scalar_t__ newfile(char *);
int /*<<< orphan*/ printrefs();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ yylex();
int main(int argc, char **argv) {
  int i;
  if (argc < 2) {
    fprintf(stderr, "need filename\n");
    return 1;
  }
  for (i = 1; i < argc; i++) {
    if (newfile(argv[i]))
      yylex();
  }
  printrefs();
  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)
jge    1181 <main+0x41>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11d7 <main+0x97>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c9 <main+0x89>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <newfile@plt>
cmp    $0x0,%rax
je     11b6 <main+0x76>
mov    $0x0,%al
call   1050 <yylex@plt>
jmp    11bb <main+0x7b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1188 <main+0x48>
mov    $0x0,%al
call   1030 <printrefs@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jge    1166 <main+0x26>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%ebx
jmp    11a9 <main+0x69>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
jmp    1189 <main+0x49>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     11a0 <main+0x60>
mov    (%r14,%rbx,8),%rdi
call   1060 <newfile@plt>
test   %rax,%rax
je     1180 <main+0x40>
xor    %eax,%eax
call   1050 <yylex@plt>
jmp    1180 <main+0x40>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printrefs@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"need filename\0A\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 slt i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %33
12: ; preds = %2
store i32 1, i32* %6
br label %13
13: ; preds = %28, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %31
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i64 @newfile(i8* %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %17
%26 = call i32 (...) @yylex()
br label %27
27: ; preds = %25, %17
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %13
31: ; preds = %13
%32 = call i32 (...) @printrefs()
store i32 0, i32* %3
br label %33
33: ; preds = %31, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"need filename\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %22
9: ; preds = %4, %17
%10 = phi i64 [ 1, %4 ], [ %18, %17 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i64 @newfile(i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %9
%16 = tail call i32 (...) @yylex()
br label %17
17: ; preds = %9, %15
%18 = add nuw nsw i64 %10, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %20, label %9
20: ; preds = %17
%21 = tail call i32 (...) @printrefs()
br label %22
22: ; preds = %20, %6
%23 = phi i32 [ 1, %6 ], [ 0, %20 ]
ret i32 %23
}