#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*/ strcasecmp(char *, char *);
char *parseboolARGUMENT(char *str) {
  register char *truestr = "TRUE", *falsestr = "FALSE";
  if (!str)
    return NULL;
  if (!strcasecmp(str, "YES"))
    return truestr;
  if (!strcasecmp(str, "ON"))
    return truestr;
  if (!strcasecmp(str, "TRUE"))
    return truestr;
  if (!strcasecmp(str, "YEAH"))
    return truestr;
  if (!strcasecmp(str, "NO"))
    return falsestr;
  if (!strcasecmp(str, "OFF"))
    return falsestr;
  if (!strcasecmp(str, "FALSE"))
    return falsestr;
  if (!strcasecmp(str, "NOPE"))
    return falsestr;
  return NULL;
}


x86 assembly (clang, -O0):
<parseboolARGUMENT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <parseboolARGUMENT+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1170 <parseboolARGUMENT+0x60>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1196 <parseboolARGUMENT+0x86>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11bc <parseboolARGUMENT+0xac>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11e2 <parseboolARGUMENT+0xd2>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1208 <parseboolARGUMENT+0xf8>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    122e <parseboolARGUMENT+0x11e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xdcc(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1254 <parseboolARGUMENT+0x144>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
mov    -0x10(%rbp),%rdi
lea    0xdbf(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    127a <parseboolARGUMENT+0x16a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1282 <parseboolARGUMENT+0x172>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseboolARGUMENT>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     11df <parseboolARGUMENT+0xcf>
mov    %rdi,%rbx
lea    0xee4(%rip),%rsi
call   1030 <strcasecmp@plt>
lea    0xecd(%rip),%r14
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xea7(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
lea    0xe74(%rip),%r14
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xe56(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e2 <parseboolARGUMENT+0xd2>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %r14d,%r14d
test   %eax,%eax
lea    0xe2c(%rip),%rax
cmove  %rax,%r14
jmp    11e2 <parseboolARGUMENT+0xd2>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
@.str.2 = [4 x i8] c"YES\00"
@.str.3 = [3 x i8] c"ON\00"
@.str.4 = [5 x i8] c"YEAH\00"
@.str.5 = [3 x i8] c"NO\00"
@.str.6 = [4 x i8] c"OFF\00"
@.str.7 = [5 x i8] c"NOPE\00"
define i8* @parseboolARGUMENT(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* null, i8** %2
br label %58
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcasecmp(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %58
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i32 @strcasecmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = load i8*, i8** %4
store i8* %20, i8** %2
br label %58
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i32 @strcasecmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = load i8*, i8** %4
store i8* %26, i8** %2
br label %58
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i32 @strcasecmp(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = load i8*, i8** %4
store i8* %32, i8** %2
br label %58
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i32 @strcasecmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %33
%38 = load i8*, i8** %5
store i8* %38, i8** %2
br label %58
39: ; preds = %33
%40 = load i8*, i8** %3
%41 = call i32 @strcasecmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp ne i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %39
%44 = load i8*, i8** %5
store i8* %44, i8** %2
br label %58
45: ; preds = %39
%46 = load i8*, i8** %3
%47 = call i32 @strcasecmp(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%48 = icmp ne i32 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %45
%50 = load i8*, i8** %5
store i8* %50, i8** %2
br label %58
51: ; preds = %45
%52 = load i8*, i8** %3
%53 = call i32 @strcasecmp(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%54 = icmp ne i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %51
%56 = load i8*, i8** %5
store i8* %56, i8** %2
br label %58
57: ; preds = %51
store i8* null, i8** %2
br label %58
58: ; preds = %57, %55, %49, %43, %37, %31, %25, %19, %13, %8
%59 = load i8*, i8** %2
ret i8* %59
}

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
@.str.2 = [4 x i8] c"YES\00"
@.str.3 = [3 x i8] c"ON\00"
@.str.4 = [5 x i8] c"YEAH\00"
@.str.5 = [3 x i8] c"NO\00"
@.str.6 = [4 x i8] c"OFF\00"
@.str.7 = [5 x i8] c"NOPE\00"
define i8* @parseboolARGUMENT(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %28, label %3
3: ; preds = %1
%4 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %28, label %6
6: ; preds = %3
%7 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %28, label %9
9: ; preds = %6
%10 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %28, label %12
12: ; preds = %9
%13 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %28, label %15
15: ; preds = %12
%16 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %15
%19 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %28, label %21
21: ; preds = %18
%22 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %28, label %24
24: ; preds = %21
%25 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* null
br label %28
28: ; preds = %24, %21, %18, %15, %12, %9, %6, %3, %1
%29 = phi i8* [ null, %1 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %12 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %15 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %18 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %21 ], [ %27, %24 ]
ret i8* %29
}