#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 */
int sscanf(char const *, char *, int *);
int /*<<< orphan*/ strcasecmp(char const *, char *);
int isNegatory(const char *value) {
  int n;
  if (!strcasecmp(value, "off"))
    return 1;
  if (!strcasecmp(value, "no"))
    return 1;
  if (!strcasecmp(value, "none"))
    return 1;
  if (!strcasecmp(value, "false"))
    return 1;
  if (!strcasecmp(value, "disabled"))
    return 1;
  if (sscanf(value, "%d", &n) == 1) {
    if (n == 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isNegatory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1151 <isNegatory+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1224 <isNegatory+0x104>
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1176 <isNegatory+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1224 <isNegatory+0x104>
mov    -0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    119b <isNegatory+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    1224 <isNegatory+0x104>
mov    -0x10(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11c0 <isNegatory+0xa0>
movl   $0x1,-0x4(%rbp)
jmp    1224 <isNegatory+0x104>
mov    -0x10(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11e5 <isNegatory+0xc5>
movl   $0x1,-0x4(%rbp)
jmp    1224 <isNegatory+0x104>
mov    -0x10(%rbp),%rdi
lea    0xe2b(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    121d <isNegatory+0xfd>
cmpl   $0x0,-0x14(%rbp)
jne    1218 <isNegatory+0xf8>
movl   $0x1,-0x4(%rbp)
jmp    1224 <isNegatory+0x104>
jmp    121d <isNegatory+0xfd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNegatory>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     11a8 <isNegatory+0x88>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11a8 <isNegatory+0x88>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11a8 <isNegatory+0x88>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11a8 <isNegatory+0x88>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11a8 <isNegatory+0x88>
lea    0xe8d(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
xor    $0x1,%eax
xor    %ebp,%ebp
or     0x4(%rsp),%eax
sete   %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"off\00"
@.str.1 = [3 x i8] c"no\00"
@.str.2 = [5 x i8] c"none\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [9 x i8] c"disabled\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @isNegatory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strcasecmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 1, i32* %2
br label %39
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @strcasecmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9
store i32 1, i32* %2
br label %39
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = call i32 @strcasecmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %14
store i32 1, i32* %2
br label %39
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = call i32 @strcasecmp(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %19
store i32 1, i32* %2
br label %39
24: ; preds = %19
%25 = load i8*, i8** %3
%26 = call i32 @strcasecmp(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %24
store i32 1, i32* %2
br label %39
29: ; preds = %24
%30 = load i8*, i8** %3
%31 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %38
33: ; preds = %29
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %33
store i32 1, i32* %2
br label %39
37: ; preds = %33
br label %38
38: ; preds = %37, %29
store i32 0, i32* %2
br label %39
39: ; preds = %38, %36, %28, %23, %18, %13, %8
%40 = load i32, i32* %2
ret i32 %40
}

LLVM IR (-O2):
@.str = [4 x i8] c"off\00"
@.str.1 = [3 x i8] c"no\00"
@.str.2 = [5 x i8] c"none\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [9 x i8] c"disabled\00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @isNegatory(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %25, label %6
6: ; preds = %1
%7 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %25, label %12
12: ; preds = %9
%13 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %25, label %15
15: ; preds = %12
%16 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %15
%19 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%20 = icmp eq i32 %19, 1
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 0
%23 = select i1 %20, i1 %22, i1 false
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %18, %15, %12, %9, %6, %1
%26 = phi i32 [ 1, %1 ], [ 1, %6 ], [ 1, %9 ], [ 1, %12 ], [ 1, %15 ], [ %24, %18 ]
ret i32 %26
}