#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*/ show_help();
int /*<<< orphan*/ strcmp(char *, char *);
int parse_argument(int argc, char *argv[]) {
  int argNum = 1;
  if (argc <= 1) {
    show_help();
    return -1;
  }
  if (argv[argNum][0] == '-' && !strcmp(&argv[argNum][1], ("daemon")))
    return 0;
  else {
    show_help();
    return -1;
  }
}


x86 assembly (clang, -O0):
<parse_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1153 <parse_argument+0x33>
mov    $0x0,%al
call   1040 <show_help@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11aa <parse_argument+0x8a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    119c <parse_argument+0x7c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x1,%rdi
lea    0xe7e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    119c <parse_argument+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    11aa <parse_argument+0x8a>
mov    $0x0,%al
call   1040 <show_help@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_argument>:
push   %rax
cmp    $0x2,%edi
jl     1143 <parse_argument+0x23>
mov    0x8(%rsi),%rdi
cmpb   $0x2d,(%rdi)
jne    1143 <parse_argument+0x23>
add    $0x1,%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1151 <parse_argument+0x31>
xor    %eax,%eax
call   1040 <show_help@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"daemon\00"
define i32 @parse_argument(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @show_help()
store i32 -1, i32* %3
br label %33
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 45
br i1 %20, label %21, label %31
21: ; preds = %11
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %21
store i32 0, i32* %3
br label %33
31: ; preds = %21, %11
%32 = call i32 (...) @show_help()
store i32 -1, i32* %3
br label %33
33: ; preds = %31, %30, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [7 x i8] c"daemon\00"
define i32 @parse_argument(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 45
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %4, %9, %2
%14 = tail call i32 (...) @show_help()
br label %15
15: ; preds = %13, %9
%16 = phi i32 [ 0, %9 ], [ -1, %13 ]
ret i32 %16
}