#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*/ strcmp(char *, char *);
int config_parser_bool_parser(char *data, int *out) {
  static char *true_strings[] = {"true", "yes", 0};
  static char *false_strings[] = {"false", "no", 0};
  char **s = &true_strings[0];
  while (*s) {
    if (!strcmp(data, *s)) {
      *out = 1;
      return 0;
    }
    ++s;
  }
  s = &false_strings[0];
  while (*s) {
    if (!strcmp(data, *s)) {
      *out = 0;
      return 0;
    }
    ++s;
  }
  return -1;
}


x86 assembly (clang, -O0):
<config_parser_bool_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0x2f09(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1179 <config_parser_bool_parser+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1168 <config_parser_bool_parser+0x58>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    11d9 <config_parser_bool_parser+0xc9>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <config_parser_bool_parser+0x1b>
lea    0x2ed0(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     11d2 <config_parser_bool_parser+0xc2>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11c1 <config_parser_bool_parser+0xb1>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    11d9 <config_parser_bool_parser+0xc9>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1184 <config_parser_bool_parser+0x74>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_parser_bool_parser>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     1171 <config_parser_bool_parser+0x61>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1171 <config_parser_bool_parser+0x61>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     1171 <config_parser_bool_parser+0x61>
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    1176 <config_parser_bool_parser+0x66>
mov    %ebp,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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