#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 /*<<< orphan*/ *strchr(char const *, char);
int whitelisted_char_for_devnode(char c, const char *white) {
  if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') ||
      (c >= 'a' && c <= 'z') || strchr("#+-.:=@_", c) != NULL ||
      (white != NULL && strchr(white, c) != NULL))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<whitelisted_char_for_devnode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     113c <whitelisted_char_for_devnode+0x2c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    11ac <whitelisted_char_for_devnode+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <whitelisted_char_for_devnode+0x46>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    11ac <whitelisted_char_for_devnode+0x9c>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1170 <whitelisted_char_for_devnode+0x60>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    11ac <whitelisted_char_for_devnode+0x9c>
lea    0xe89(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    11ac <whitelisted_char_for_devnode+0x9c>
cmpq   $0x0,-0x10(%rbp)
je     11b8 <whitelisted_char_for_devnode+0xa8>
mov    -0x10(%rbp),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11b8 <whitelisted_char_for_devnode+0xa8>
movl   $0x1,-0x4(%rbp)
jmp    11bf <whitelisted_char_for_devnode+0xaf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitelisted_char_for_devnode>:
push   %rbp
push   %r14
push   %rbx
lea    -0x30(%rdi),%eax
mov    $0x1,%ebx
cmp    $0xa,%al
jb     115a <whitelisted_char_for_devnode+0x4a>
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
jb     115a <whitelisted_char_for_devnode+0x4a>
mov    %rsi,%r14
movsbl %dil,%ebp
lea    0xec8(%rip),%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    115a <whitelisted_char_for_devnode+0x4a>
test   %r14,%r14
je     1158 <whitelisted_char_for_devnode+0x48>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    115a <whitelisted_char_for_devnode+0x4a>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"#+-.:=@_\00"
define i32 @whitelisted_char_for_devnode(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 48
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 57
br i1 %12, label %41, label %13
13: ; preds = %9, %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp sle i32 %19, 90
br i1 %20, label %41, label %21
21: ; preds = %17, %13
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 122
br i1 %28, label %41, label %29
29: ; preds = %25, %21
%30 = load i8, i8* %4
%31 = call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %30)
%32 = icmp ne i32* %31, null
br i1 %32, label %41, label %33
33: ; preds = %29
%34 = load i8*, i8** %5
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %42
36: ; preds = %33
%37 = load i8*, i8** %5
%38 = load i8, i8* %4
%39 = call i32* @strchr(i8* %37, i8 signext %38)
%40 = icmp ne i32* %39, null
br i1 %40, label %41, label %42
41: ; preds = %36, %29, %25, %17, %9
store i32 1, i32* %3
br label %43
42: ; preds = %36, %33
store i32 0, i32* %3
br label %43
43: ; preds = %42, %41
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [9 x i8] c"#+-.:=@_\00"
define i32 @whitelisted_char_for_devnode(i8 signext %0, i8* %1) {
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = and i8 %0, -33
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 26
%8 = or i1 %4, %7
br i1 %8, label %18, label %9
9: ; preds = %2
%10 = tail call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = icmp eq i8* %1, null
br i1 %13, label %17, label %14
14: ; preds = %12
%15 = tail call i32* @strchr(i8* %1, i8 signext %0)
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %18
17: ; preds = %14, %12
br label %18
18: ; preds = %9, %14, %2, %17
%19 = phi i32 [ 0, %17 ], [ 1, %2 ], [ 1, %14 ], [ 1, %9 ]
ret i32 %19
}