#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 findLineInFile(char *, char *);
int /*<<< orphan*/ printUsage(char *);
scalar_t__ strcmp(char *, char *);
scalar_t__ testArgs(int, char **);
int main(int argc, char **argv) {
  if (testArgs(argc, argv)) {
    printUsage(argv[0]);
    return 1;
  }
  if (argc > 1 &&
      (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) {
    printUsage(argv[0]);
    return 0;
  }
  return findLineInFile(argv[1], argv[2]);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <testArgs@plt>
cmp    $0x0,%rax
je     1184 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <printUsage@plt>
movl   $0x1,-0x4(%rbp)
jmp    11fa <main+0xba>
cmpl   $0x1,-0x8(%rbp)
jle    11e2 <main+0xa2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe63(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11ca <main+0x8a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe48(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11e2 <main+0xa2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <printUsage@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fa <main+0xba>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1060 <findLineInFile@plt>
mov    %eax,-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
call   1040 <testArgs@plt>
test   %rax,%rax
je     1166 <main+0x26>
mov    (%rbx),%rdi
call   1050 <printUsage@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
cmp    $0x2,%ebp
jl     1195 <main+0x55>
mov    0x8(%rbx),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11a8 <main+0x68>
mov    0x8(%rbx),%rdi
lea    0xe78(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     11a8 <main+0x68>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <findLineInFile@plt>
mov    (%rbx),%rdi
call   1050 <printUsage@plt>
xor    %eax,%eax
jmp    115f <main+0x1f>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i64 @testArgs(i32 %6, i8** %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @printUsage(i8* %13)
store i32 1, i32* %3
br label %43
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %35
18: ; preds = %15
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %24, %18
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i32 @printUsage(i8* %33)
store i32 0, i32* %3
br label %43
35: ; preds = %24, %15
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 @findLineInFile(i8* %38, i8* %41)
store i32 %42, i32* %3
br label %43
43: ; preds = %35, %30, %10
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @testArgs(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @printUsage(i8* %6)
br label %28
8: ; preds = %2
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %22
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = load i8*, i8** %11
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15, %10
%20 = load i8*, i8** %1
%21 = tail call i32 @printUsage(i8* %20)
br label %28
22: ; preds = %15, %8
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = getelementptr inbounds i8*, i8** %1, i64 2
%26 = load i8*, i8** %25
%27 = tail call i32 @findLineInFile(i8* %24, i8* %26)
br label %28
28: ; preds = %22, %19, %5
%29 = phi i32 [ 1, %5 ], [ 0, %19 ], [ %27, %22 ]
ret i32 %29
}