#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 *);
int get_bool(char *value, int *result) {
  if (!strcasecmp(value, "y") || !strcasecmp(value, "yes") ||
      !strcasecmp(value, "true")) {
    *result = 1;
    return 1;
  } else if (!strcasecmp(value, "n") || !strcasecmp(value, "no") ||
             !strcasecmp(value, "false")) {
    *result = 0;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     116b <get_bool+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     116b <get_bool+0x5b>
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1181 <get_bool+0x71>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11ee <get_bool+0xde>
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11cc <get_bool+0xbc>
mov    -0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     11cc <get_bool+0xbc>
mov    -0x10(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11e2 <get_bool+0xd2>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11ee <get_bool+0xde>
jmp    11e7 <get_bool+0xd7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bool>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1192 <get_bool+0x82>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1192 <get_bool+0x82>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1192 <get_bool+0x82>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1192 <get_bool+0x82>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1192 <get_bool+0x82>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    119a <get_bool+0x8a>
mov    %ebp,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"y\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [2 x i8] c"n\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [6 x i8] c"false\00"
define i32 @get_bool(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2
%6 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %11, %14, %17, %2, %5, %8
%21 = phi i32 [ 1, %8 ], [ 1, %5 ], [ 1, %2 ], [ 0, %17 ], [ 0, %14 ], [ 0, %11 ]
store i32 %21, i32* %1
br label %22
22: ; preds = %20, %17
%23 = phi i32 [ 0, %17 ], [ 1, %20 ]
ret i32 %23
}