#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 *);
int config_param_val_bool(char *val, int *res) {
  if (val == NULL)
    return 0;
  if (strcasecmp(val, "on") == 0 || strcasecmp(val, "yes") == 0 ||
      strcasecmp(val, "y") == 0 || strcasecmp(val, "true") == 0 ||
      strcasecmp(val, "t") == 0 || strcasecmp(val, "1") == 0) {
    *res = 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<config_param_val_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <config_param_val_bool+0x27>
movl   $0x0,-0x4(%rbp)
jmp    11e4 <config_param_val_bool+0xd4>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <config_param_val_bool+0xc3>
mov    -0x10(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <config_param_val_bool+0xc3>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <config_param_val_bool+0xc3>
mov    -0x10(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <config_param_val_bool+0xc3>
mov    -0x10(%rbp),%rdi
lea    0xe64(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     11d3 <config_param_val_bool+0xc3>
mov    -0x10(%rbp),%rdi
lea    0xe4c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11dd <config_param_val_bool+0xcd>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_param_val_bool>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     11ae <config_param_val_bool+0x9e>
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed6(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11a0 <config_param_val_bool+0x90>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11a0 <config_param_val_bool+0x90>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11a0 <config_param_val_bool+0x90>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11a0 <config_param_val_bool+0x90>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     11a0 <config_param_val_bool+0x90>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    11b0 <config_param_val_bool+0xa0>
movl   $0x1,(%r14)
mov    $0x1,%eax
jmp    11b0 <config_param_val_bool+0xa0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [2 x i8] c"y\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [2 x i8] c"t\00"
@.str.5 = [2 x i8] c"1\00"
define i32 @config_param_val_bool(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 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %36
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i64 @strcasecmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %33, label %13
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %33, label %17
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = call i64 @strcasecmp(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %33, label %21
21: ; preds = %17
%22 = load i8*, i8** %4
%23 = call i64 @strcasecmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %33, label %25
25: ; preds = %21
%26 = load i8*, i8** %4
%27 = call i64 @strcasecmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8*, i8** %4
%31 = call i64 @strcasecmp(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29, %25, %21, %17, %13, %9
%34 = load i32*, i32** %5
store i32 1, i32* %34
br label %35
35: ; preds = %33, %29
store i32 1, i32* %3
br label %36
36: ; preds = %35, %8
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@.str = [3 x i8] c"on\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [2 x i8] c"y\00"
@.str.3 = [5 x i8] c"true\00"
@.str.4 = [2 x i8] c"t\00"
@.str.5 = [2 x i8] c"1\00"
define i32 @config_param_val_bool(i8* %0, i32* nocapture writeonly %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %23, label %4
4: ; preds = %2
%5 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %22, label %7
7: ; preds = %4
%8 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %22, label %10
10: ; preds = %7
%11 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %22, label %13
13: ; preds = %10
%14 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %13
%17 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = tail call i64 @strcasecmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19, %16, %13, %10, %7, %4
store i32 1, i32* %1
br label %23
23: ; preds = %19, %22, %2
%24 = phi i32 [ 0, %2 ], [ 1, %22 ], [ 1, %19 ]
ret i32 %24
}