#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 */
scalar_t__ eq(char const *, char *);
int /*<<< orphan*/ read_file(char const *);
int /*<<< orphan*/ usg();
int main(int argc, const char **argv) {
  if (argc > 1 && eq(argv[1], "-h"))
    usg();
  if (argc != 2)
    usg();
  read_file(argv[1]);
}


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)
cmpl   $0x1,-0x8(%rbp)
jle    1175 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1050 <eq@plt>
cmp    $0x0,%rax
je     1175 <main+0x45>
mov    $0x0,%al
call   1030 <usg@plt>
cmpl   $0x2,-0x8(%rbp)
je     1186 <main+0x56>
mov    $0x0,%al
call   1030 <usg@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <read_file@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     115e <main+0x2e>
mov    %edi,%ebp
mov    0x8(%rbx),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <eq@plt>
test   %rax,%rax
je     1159 <main+0x29>
xor    %eax,%eax
call   1030 <usg@plt>
cmp    $0x2,%ebp
je     1165 <main+0x35>
xor    %eax,%eax
call   1030 <usg@plt>
mov    0x8(%rbx),%rdi
call   1040 <read_file@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\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 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @eq(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (...) @usg()
br label %16
16: ; preds = %14, %8, %2
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 2
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @usg()
br label %21
21: ; preds = %19, %16
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @read_file(i8* %24)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @eq(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @usg()
br label %11
11: ; preds = %9, %4
%12 = icmp eq i32 %0, 2
br i1 %12, label %15, label %13
13: ; preds = %2, %11
%14 = tail call i32 (...) @usg()
br label %15
15: ; preds = %13, %11
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @read_file(i8* %17)
ret i32 0
}