#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 */
char *crumbwarp_conf_var(char *, int /*<<< orphan*/ *);
scalar_t__ strcasecmp(char *, char *);
int crumbwarp_conf_switch(char *name) {
  char *p = crumbwarp_conf_var(name, NULL);
  if (p == NULL)
    return 0;
  if (strcasecmp(p, "no") == 0 || strcasecmp(p, "off") == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<crumbwarp_conf_switch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <crumbwarp_conf_var@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1154 <crumbwarp_conf_switch+0x34>
movl   $0x0,-0x4(%rbp)
jmp    119b <crumbwarp_conf_switch+0x7b>
mov    -0x18(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
je     1188 <crumbwarp_conf_switch+0x68>
mov    -0x18(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1194 <crumbwarp_conf_switch+0x74>
movl   $0x0,-0x4(%rbp)
jmp    119b <crumbwarp_conf_switch+0x7b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crumbwarp_conf_switch>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %esi,%esi
call   1040 <crumbwarp_conf_var@plt>
test   %rax,%rax
je     1163 <crumbwarp_conf_switch+0x43>
mov    %rax,%rbx
lea    0xec3(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1163 <crumbwarp_conf_switch+0x43>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
setne  %r14b
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"off\00"
define i32 @crumbwarp_conf_switch(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @crumbwarp_conf_var(i8* %5, i32* null)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %20
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i64 @strcasecmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = call i64 @strcasecmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14, %10
store i32 0, i32* %2
br label %20
19: ; preds = %14
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18, %9
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"off\00"
define i32 @crumbwarp_conf_switch(i8* %0) {
%2 = tail call i8* @crumbwarp_conf_var(i8* %0, i32* null)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i64 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}