#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 */
bool argflag_on(const char *value) {
  static const char off_flags[] = {'n', 'N', 'f', 'F', '0'};
  static const size_t flags_count = sizeof off_flags;
  if (!value)
    return true;
  for (size_t i = 0; i < flags_count; ++i) {
    if (*value == off_flags[i])
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<argflag_on>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <argflag_on+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1179 <argflag_on+0x79>
movq   $0x0,-0x18(%rbp)
cmpq   $0x5,-0x18(%rbp)
jae    1172 <argflag_on+0x72>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rdx
lea    0xebc(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    115c <argflag_on+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1179 <argflag_on+0x79>
jmp    1161 <argflag_on+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <argflag_on+0x27>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<argflag_on>:
mov    $0x1,%eax
test   %rdi,%rdi
je     1129 <argflag_on+0x29>
mov    (%rdi),%cl
add    $0xd0,%cl
cmp    $0x3e,%cl
ja     112a <argflag_on+0x2a>
xor    %eax,%eax
movzbl %cl,%ecx
movabs $0x4040000040400001,%rdx
bt     %rcx,%rdx
jae    112a <argflag_on+0x2a>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@argflag_on.off_flags = internal constant [5 x i8] c"nNfF0"
@argflag_on.flags_count = internal constant i64 5
define i32 @argflag_on(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %27
8: ; preds = %1
store i64 0, i64* %4
br label %9
9: ; preds = %23, %8
%10 = load i64, i64* %4
%11 = icmp ult i64 %10, 5
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i64, i64* %4
%17 = getelementptr inbounds [5 x i8], [5 x i8]* @argflag_on.off_flags, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %15, %19
br i1 %20, label %21, label %22
21: ; preds = %12
store i32 0, i32* %2
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i64, i64* %4
%25 = add i64 %24, 1
store i64 %25, i64* %4
br label %9
26: ; preds = %9
store i32 1, i32* %2
br label %27
27: ; preds = %26, %21, %7
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @argflag_on(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
switch i8 %4, label %5 [
i8 110, label %6
i8 78, label %6
i8 102, label %6
i8 70, label %6
i8 48, label %6
]
5: ; preds = %3
br label %6
6: ; preds = %3, %3, %3, %3, %3, %5, %1
%7 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %5 ], [ 0, %3 ], [ 0, %3 ], [ 0, %3 ], [ 0, %3 ]
ret i32 %7
}