#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  char *value;
};
typedef TYPE_1__ CONF_VALUE;

/* Variables and functions */
int /*<<< orphan*/ X509V3_R_INVALID_BOOLEAN_STRING;
int /*<<< orphan*/ X509V3_conf_err(TYPE_1__ const *);
int /*<<< orphan*/ X509V3error(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
int X509V3_get_value_bool(const CONF_VALUE *value, int *asn1_bool) {
  char *btmp;
  if (!(btmp = value->value))
    goto err;
  if (!strcmp(btmp, "TRUE") || !strcmp(btmp, "true") || !strcmp(btmp, "Y") ||
      !strcmp(btmp, "y") || !strcmp(btmp, "YES") || !strcmp(btmp, "yes")) {
    *asn1_bool = 0xff;
    return 1;
  } else if (!strcmp(btmp, "FALSE") || !strcmp(btmp, "false") ||
             !strcmp(btmp, "N") || !strcmp(btmp, "n") || !strcmp(btmp, "NO") ||
             !strcmp(btmp, "no")) {
    *asn1_bool = 0;
    return 1;
  }
err:
  X509V3error(X509V3_R_INVALID_BOOLEAN_STRING);
  X509V3_conf_err(value);
  return 0;
}


x86 assembly (clang, -O0):
<X509V3_get_value_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    115a <X509V3_get_value_bool+0x2a>
jmp    12bc <X509V3_get_value_bool+0x18c>
mov    -0x20(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11f0 <X509V3_get_value_bool+0xc0>
mov    -0x20(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11f0 <X509V3_get_value_bool+0xc0>
mov    -0x20(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11f0 <X509V3_get_value_bool+0xc0>
mov    -0x20(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11f0 <X509V3_get_value_bool+0xc0>
mov    -0x20(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11f0 <X509V3_get_value_bool+0xc0>
mov    -0x20(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1206 <X509V3_get_value_bool+0xd6>
mov    -0x18(%rbp),%rax
movl   $0xff,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    12da <X509V3_get_value_bool+0x1aa>
mov    -0x20(%rbp),%rdi
lea    0xe05(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     129c <X509V3_get_value_bool+0x16c>
mov    -0x20(%rbp),%rdi
lea    0xdf2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     129c <X509V3_get_value_bool+0x16c>
mov    -0x20(%rbp),%rdi
lea    0xddf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     129c <X509V3_get_value_bool+0x16c>
mov    -0x20(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     129c <X509V3_get_value_bool+0x16c>
mov    -0x20(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     129c <X509V3_get_value_bool+0x16c>
mov    -0x20(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12b2 <X509V3_get_value_bool+0x182>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    12da <X509V3_get_value_bool+0x1aa>
jmp    12b7 <X509V3_get_value_bool+0x187>
jmp    12bc <X509V3_get_value_bool+0x18c>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
call   1030 <X509V3error@plt>
mov    -0x10(%rbp),%rdi
call   1050 <X509V3_conf_err@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509V3_get_value_bool>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    (%rdi),%rbx
test   %rbx,%rbx
je     1247 <X509V3_get_value_bool+0x117>
mov    %rsi,%r14
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1261 <X509V3_get_value_bool+0x131>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1261 <X509V3_get_value_bool+0x131>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1261 <X509V3_get_value_bool+0x131>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1261 <X509V3_get_value_bool+0x131>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1261 <X509V3_get_value_bool+0x131>
lea    0xe51(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1261 <X509V3_get_value_bool+0x131>
lea    0xe3e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1273 <X509V3_get_value_bool+0x143>
lea    0xe2d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1273 <X509V3_get_value_bool+0x143>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1273 <X509V3_get_value_bool+0x143>
lea    0xe0f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1273 <X509V3_get_value_bool+0x143>
lea    0xdfe(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1273 <X509V3_get_value_bool+0x143>
lea    0xdee(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1273 <X509V3_get_value_bool+0x143>
mov    0x2d92(%rip),%rax
mov    (%rax),%edi
call   1030 <X509V3error@plt>
mov    %r15,%rdi
call   1050 <X509V3_conf_err@plt>
xor    %eax,%eax
jmp    126d <X509V3_get_value_bool+0x13d>
movl   $0xff,(%r14)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
movl   $0x0,(%r14)
jmp    1268 <X509V3_get_value_bool+0x138>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i8* }
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [2 x i8] c"Y\00"
@.str.3 = [2 x i8] c"y\00"
@.str.4 = [4 x i8] c"YES\00"
@.str.5 = [4 x i8] c"yes\00"
@.str.6 = [6 x i8] c"FALSE\00"
@.str.7 = [6 x i8] c"false\00"
@.str.8 = [2 x i8] c"N\00"
@.str.9 = [2 x i8] c"n\00"
@.str.10 = [3 x i8] c"NO\00"
@.str.11 = [3 x i8] c"no\00"
@X509V3_R_INVALID_BOOLEAN_STRING = global i32 0
define i32 @X509V3_get_value_bool(%struct.TYPE_4__* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_4__*
%5 = alloca i32*
%6 = alloca i8*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %4
store i32* %1, i32** %5
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
br label %66
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %36
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %36
20: ; preds = %16
%21 = load i8*, i8** %6
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %36
24: ; preds = %20
%25 = load i8*, i8** %6
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load i8*, i8** %6
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load i8*, i8** %6
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %32, %28, %24, %20, %16, %12
%37 = load i32*, i32** %5
store i32 255, i32* %37
store i32 1, i32* %3
br label %71
38: ; preds = %32
%39 = load i8*, i8** %6
%40 = call i32 @strcmp(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %62
42: ; preds = %38
%43 = load i8*, i8** %6
%44 = call i32 @strcmp(i8* %43, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %62
46: ; preds = %42
%47 = load i8*, i8** %6
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %62
50: ; preds = %46
%51 = load i8*, i8** %6
%52 = call i32 @strcmp(i8* %51, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %62
54: ; preds = %50
%55 = load i8*, i8** %6
%56 = call i32 @strcmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = load i8*, i8** %6
%60 = call i32 @strcmp(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%61 = icmp ne i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %58, %54, %50, %46, %42, %38
%63 = load i32*, i32** %5
store i32 0, i32* %63
store i32 1, i32* %3
br label %71
64: ; preds = %58
br label %65
65: ; preds = %64
br label %66
66: ; preds = %65, %11
%67 = load i32, i32* @X509V3_R_INVALID_BOOLEAN_STRING
%68 = call i32 @X509V3error(i32 %67)
%69 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%70 = call i32 @X509V3_conf_err(%struct.TYPE_4__* %69)
store i32 0, i32* %3
br label %71
71: ; preds = %66, %62, %36
%72 = load i32, i32* %3
ret i32 %72
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i8* }
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [2 x i8] c"Y\00"
@.str.3 = [2 x i8] c"y\00"
@.str.4 = [4 x i8] c"YES\00"
@.str.5 = [4 x i8] c"yes\00"
@.str.6 = [6 x i8] c"FALSE\00"
@.str.7 = [6 x i8] c"false\00"
@.str.8 = [2 x i8] c"N\00"
@.str.9 = [2 x i8] c"n\00"
@.str.10 = [3 x i8] c"NO\00"
@.str.11 = [3 x i8] c"no\00"
@X509V3_R_INVALID_BOOLEAN_STRING = global i32 0
define i32 @X509V3_get_value_bool(%struct.TYPE_4__* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %44, label %6
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %24, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %24, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %24, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21, %18, %15, %12, %9, %6
store i32 255, i32* %1
br label %48
25: ; preds = %21
%26 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %43, label %28
28: ; preds = %25
%29 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %43, label %31
31: ; preds = %28
%32 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%33 = icmp eq i32 %32, 0
br i1 %33, label %43, label %34
34: ; preds = %31
%35 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %43, label %37
37: ; preds = %34
%38 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = tail call i32 @strcmp(i8* %4, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %40, %37, %34, %31, %28, %25
store i32 0, i32* %1
br label %48
44: ; preds = %40, %2
%45 = load i32, i32* @X509V3_R_INVALID_BOOLEAN_STRING
%46 = tail call i32 @X509V3error(i32 %45)
%47 = tail call i32 @X509V3_conf_err(%struct.TYPE_4__* %0)
br label %48
48: ; preds = %44, %43, %24
%49 = phi i32 [ 0, %44 ], [ 1, %43 ], [ 1, %24 ]
ret i32 %49
}