#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 */
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ write_log_standard(char *, char *);
int cfgfile_yesno(char *option, char *value, char *name, int *location) {
  if (strcmp(option, name) != 0)
    return 0;
  if (strcasecmp(value, "yes") == 0 || strcasecmp(value, "y") == 0 ||
      strcasecmp(value, "true") == 0 || strcasecmp(value, "t") == 0)
    *location = 1;
  else if (strcasecmp(value, "no") == 0 || strcasecmp(value, "n") == 0 ||
           strcasecmp(value, "false") == 0 || strcasecmp(value, "f") == 0)
    *location = 0;
  else
    write_log_standard(
        "Option `%s' requires a value of either `yes' or `no'.\n", option);
  return 1;
}


x86 assembly (clang, -O0):
<cfgfile_yesno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     116b <cfgfile_yesno+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1275 <cfgfile_yesno+0x145>
mov    -0x18(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <cfgfile_yesno+0xa3>
mov    -0x18(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <cfgfile_yesno+0xa3>
mov    -0x18(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <cfgfile_yesno+0xa3>
mov    -0x18(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11e2 <cfgfile_yesno+0xb2>
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
jmp    126e <cfgfile_yesno+0x13e>
mov    -0x18(%rbp),%rdi
lea    0xe20(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     124a <cfgfile_yesno+0x11a>
mov    -0x18(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     124a <cfgfile_yesno+0x11a>
mov    -0x18(%rbp),%rdi
lea    0xdf1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     124a <cfgfile_yesno+0x11a>
mov    -0x18(%rbp),%rdi
lea    0xddd(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1259 <cfgfile_yesno+0x129>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
jmp    1269 <cfgfile_yesno+0x139>
mov    -0x10(%rbp),%rsi
lea    0xdb6(%rip),%rdi
call   1050 <write_log_standard@plt>
jmp    126e <cfgfile_yesno+0x13e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgfile_yesno>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1219 <cfgfile_yesno+0xe9>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     120d <cfgfile_yesno+0xdd>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     120d <cfgfile_yesno+0xdd>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     120d <cfgfile_yesno+0xdd>
lea    0xe6c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     120d <cfgfile_yesno+0xdd>
lea    0xe5a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     121f <cfgfile_yesno+0xef>
lea    0xe49(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     121f <cfgfile_yesno+0xef>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     121f <cfgfile_yesno+0xef>
lea    0xe29(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     121f <cfgfile_yesno+0xef>
lea    0xe17(%rip),%rdi
mov    %r15,%rsi
call   1050 <write_log_standard@plt>
jmp    1214 <cfgfile_yesno+0xe4>
movl   $0x1,(%r14)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
movl   $0x0,(%r14)
jmp    1214 <cfgfile_yesno+0xe4>

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [2 x i8] c"y\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [2 x i8] c"t\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [2 x i8] c"n\00"
@.str.6 = [6 x i8] c"false\00"
@.str.7 = [2 x i8] c"f\00"
@.str.8 = [55 x i8] c"Option `%s' requires a value of either `yes' or `no'.\0A\00"
define i32 @cfgfile_yesno(i8* %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 0, i32* %5
br label %56
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = call i64 @strcasecmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %31, label %19
19: ; preds = %15
%20 = load i8*, i8** %7
%21 = call i64 @strcasecmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i8*, i8** %7
%25 = call i64 @strcasecmp(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i8*, i8** %7
%29 = call i64 @strcasecmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27, %23, %19, %15
%32 = load i32*, i32** %9
store i32 1, i32* %32
br label %55
33: ; preds = %27
%34 = load i8*, i8** %7
%35 = call i64 @strcasecmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %49, label %37
37: ; preds = %33
%38 = load i8*, i8** %7
%39 = call i64 @strcasecmp(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %49, label %41
41: ; preds = %37
%42 = load i8*, i8** %7
%43 = call i64 @strcasecmp(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = load i8*, i8** %7
%47 = call i64 @strcasecmp(i8* %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45, %41, %37, %33
%50 = load i32*, i32** %9
store i32 0, i32* %50
br label %54
51: ; preds = %45
%52 = load i8*, i8** %6
%53 = call i32 @write_log_standard(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %51, %49
br label %55
55: ; preds = %54, %31
store i32 1, i32* %5
br label %56
56: ; preds = %55, %14
%57 = load i32, i32* %5
ret i32 %57
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [2 x i8] c"y\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [2 x i8] c"t\00"
@.str.4 = [3 x i8] c"no\00"
@.str.5 = [2 x i8] c"n\00"
@.str.6 = [6 x i8] c"false\00"
@.str.7 = [2 x i8] c"f\00"
@.str.8 = [55 x i8] c"Option `%s' requires a value of either `yes' or `no'.\0A\00"
define i32 @cfgfile_yesno(i8* %0, i8* nocapture %1, i8* %2, i32* nocapture writeonly %3) {
%5 = tail call i64 @strcmp(i8* %0, i8* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %35
7: ; preds = %4
%8 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %7
%11 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16, %13, %10, %7
store i32 1, i32* %3
br label %35
20: ; preds = %16
%21 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %32, label %23
23: ; preds = %20
%24 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %23
%27 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = tail call i64 @strcasecmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29, %26, %23, %20
store i32 0, i32* %3
br label %35
33: ; preds = %29
%34 = tail call i32 @write_log_standard(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0), i8* %0)
br label %35
35: ; preds = %19, %33, %32, %4
%36 = phi i32 [ 0, %4 ], [ 1, %32 ], [ 1, %33 ], [ 1, %19 ]
ret i32 %36
}