#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*/ parse_error();
int parse_option(char const *, char *);
void assign_boolean(int *target, const char *data) {
  if (parse_option(data, "true\0yes\0on\0"
                         "1\0\0") != -1) {
    *target = 1;
  } else if (parse_option(data, "false\0no\0off\0"
                                "0\0\0") != -1) {
    *target = 0;
  } else {
    parse_error();
  }
}


x86 assembly (clang, -O0):
<assign_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <parse_option@plt>
cmp    $0xffffffff,%eax
je     1158 <assign_boolean+0x38>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
jmp    118c <assign_boolean+0x6c>
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <parse_option@plt>
cmp    $0xffffffff,%eax
je     1180 <assign_boolean+0x60>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1187 <assign_boolean+0x67>
mov    $0x0,%al
call   1040 <parse_error@plt>
jmp    118c <assign_boolean+0x6c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_boolean>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <parse_option@plt>
cmp    $0xffffffff,%eax
je     1147 <assign_boolean+0x27>
movl   $0x1,(%r14)
jmp    1162 <assign_boolean+0x42>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <parse_option@plt>
cmp    $0xffffffff,%eax
je     116a <assign_boolean+0x4a>
movl   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <parse_error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"true\00yes\00on\001\00\00\00"
@.str.1 = [17 x i8] c"false\00no\00off\000\00\00\00"
define void @assign_boolean(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @parse_option(i8* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32*, i32** %3
store i32 1, i32* %9
br label %19
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @parse_option(i8* %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32*, i32** %3
store i32 0, i32* %15
br label %18
16: ; preds = %10
%17 = call i32 (...) @parse_error()
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18, %8
ret void
}

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