#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*/ isblank(char);
int /*<<< orphan*/ iscntrl(char);
bool allowed_env_var_name(char c) {
  return c != '\0' && !isblank(c) && !iscntrl(c) && c != '/' && c != '\\' &&
         c != '=' && c != '$';
}


x86 assembly (clang, -O0):
<allowed_env_var_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     11b5 <allowed_env_var_name+0x95>
movsbl -0x1(%rbp),%edi
call   1040 <isblank@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    11b5 <allowed_env_var_name+0x95>
movsbl -0x1(%rbp),%edi
call   1030 <iscntrl@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jne    11b5 <allowed_env_var_name+0x95>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     11b5 <allowed_env_var_name+0x95>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x2(%rbp)
je     11b5 <allowed_env_var_name+0x95>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x2(%rbp)
je     11b5 <allowed_env_var_name+0x95>
movsbl -0x1(%rbp),%eax
cmp    $0x24,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allowed_env_var_name>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %r14d,%r14d
test   %bl,%bl
je     116a <allowed_env_var_name+0x4a>
movsbl %bl,%ebp
mov    %ebp,%edi
call   1040 <isblank@plt>
test   %eax,%eax
jne    116a <allowed_env_var_name+0x4a>
mov    %ebp,%edi
call   1030 <iscntrl@plt>
test   %eax,%eax
jne    116a <allowed_env_var_name+0x4a>
lea    -0x2f(%rbx),%eax
cmp    $0x2d,%al
ja     1160 <allowed_env_var_name+0x40>
movzbl %al,%eax
movabs $0x200000004001,%rcx
bt     %rax,%rcx
jb     116a <allowed_env_var_name+0x4a>
xor    %r14d,%r14d
cmp    $0x24,%bl
setne  %r14b
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @allowed_env_var_name(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %30
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @isblank(i8 signext %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %30, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i32 @iscntrl(i8 signext %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 47
br i1 %17, label %18, label %30
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 92
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 61
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 36
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6, %1
%31 = phi i1 [ false, %22 ], [ false, %18 ], [ false, %14 ], [ false, %10 ], [ false, %6 ], [ false, %1 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @allowed_env_var_name(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = tail call i32 @isblank(i8 signext %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = tail call i32 @iscntrl(i8 signext %0)
%8 = freeze i32 %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
switch i8 %0, label %11 [
i8 92, label %14
i8 61, label %14
i8 47, label %14
]
11: ; preds = %10
%12 = icmp ne i8 %0, 36
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %10, %10, %10, %6, %11, %3, %1
%15 = phi i32 [ 0, %10 ], [ 0, %3 ], [ 0, %1 ], [ %13, %11 ], [ 0, %6 ], [ 0, %10 ], [ 0, %10 ]
ret i32 %15
}