#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 const *, char *);
int /*<<< orphan*/ test_error(char *, int, char *, char const *);
int parse_boolean(const char *value, int *result) {
  if (strcasecmp(value, "Yes") == 0) {
    *result = 1;
    return 1;
  } else if (strcasecmp(value, "No") == 0) {
    *result = 0;
    return 1;
  }
  test_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
             "master/Src/OSF/OpenSSL-111/test/ssl_test_ctx.c",
             36, "parse_boolean given: '%s'", value);
  return 0;
}


x86 assembly (clang, -O0):
<parse_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1160 <parse_boolean+0x40>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11b8 <parse_boolean+0x98>
mov    -0x10(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1190 <parse_boolean+0x70>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    11b8 <parse_boolean+0x98>
jmp    1195 <parse_boolean+0x75>
mov    -0x10(%rbp),%rcx
lea    0xe67(%rip),%rdi
mov    $0x24,%esi
lea    0xf0b(%rip),%rdx
call   1040 <test_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_boolean>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     116e <parse_boolean+0x4e>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1177 <parse_boolean+0x57>
lea    0xeb1(%rip),%rdi
lea    0xf5a(%rip),%rdx
mov    $0x24,%esi
mov    %rbx,%rcx
call   1040 <test_error@plt>
xor    %eax,%eax
jmp    1183 <parse_boolean+0x63>
movl   $0x1,(%r14)
jmp    117e <parse_boolean+0x5e>
movl   $0x0,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
@.str.2 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/ssl_test_ctx.c\00"
@.str.3 = [26 x i8] c"parse_boolean given: '%s'\00"
define i32 @parse_boolean(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 i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32*, i32** %5
store i32 1, i32* %10
store i32 1, i32* %3
br label %21
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i64 @strcasecmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32*, i32** %5
store i32 0, i32* %16
store i32 1, i32* %3
br label %21
17: ; preds = %11
br label %18
18: ; preds = %17
%19 = load i8*, i8** %4
%20 = call i32 @test_error(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.2, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %19)
store i32 0, i32* %3
br label %21
21: ; preds = %18, %15, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
@.str.2 = [176 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/ssl_test_ctx.c\00"
@.str.3 = [26 x i8] c"parse_boolean given: '%s'\00"
define i32 @parse_boolean(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
store i32 1, i32* %1
br label %12
6: ; preds = %2
%7 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 0, i32* %1
br label %12
10: ; preds = %6
%11 = tail call i32 @test_error(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str.2, i64 0, i64 0), i32 36, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %9, %5
%13 = phi i32 [ 1, %5 ], [ 1, %9 ], [ 0, %10 ]
ret i32 %13
}