#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*/ execute(int, char **);
int /*<<< orphan*/ print_usage();
int /*<<< orphan*/ print_version();
int /*<<< orphan*/ *strstr(char *, char *);
void parse_args(int argc, char *argv[]) {
  if (argc == 1 || strstr(argv[1], "-h") != NULL)
    print_usage();
  else if (strstr(argv[1], "-v") != NULL)
    print_version();
  else
    execute(argc, argv);
}


x86 assembly (clang, -O0):
<parse_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     1177 <parse_args+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe98(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1183 <parse_args+0x43>
mov    $0x0,%al
call   1050 <print_usage@plt>
jmp    11be <parse_args+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe71(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     11ad <parse_args+0x6d>
mov    $0x0,%al
call   1030 <print_version@plt>
jmp    11b9 <parse_args+0x79>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <execute@plt>
jmp    11be <parse_args+0x7e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_args>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%edi
je     1166 <parse_args+0x26>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1171 <parse_args+0x31>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <print_usage@plt>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     1190 <parse_args+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <print_version@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <execute@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [3 x i8] c"-v\00"
define void @parse_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32* @strstr(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %7, %2
%14 = call i32 (...) @print_usage()
br label %28
15: ; preds = %7
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @strstr(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 (...) @print_version()
br label %27
23: ; preds = %15
%24 = load i32, i32* %3
%25 = load i8**, i8*** %4
%26 = call i32 @execute(i32 %24, i8** %25)
br label %27
27: ; preds = %23, %21
br label %28
28: ; preds = %27, %13
ret void
}

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