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


x86 assembly (clang, -O0):
<needs_encoding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1138 <needs_encoding+0x28>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1186 <needs_encoding+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1152 <needs_encoding+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1186 <needs_encoding+0x76>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     116c <needs_encoding+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1186 <needs_encoding+0x76>
lea    0xe8d(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1192 <needs_encoding+0x82>
movl   $0x0,-0x4(%rbp)
jmp    1199 <needs_encoding+0x89>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<needs_encoding>:
lea    -0x30(%rdi),%ecx
xor    %eax,%eax
cmp    $0xa,%cl
jb     1147 <needs_encoding+0x37>
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
jb     1147 <needs_encoding+0x37>
push   %rax
movsbl %dil,%esi
lea    0xecd(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

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