int goodchar(int ch) {
  if ((ch >= 'a') && (ch <= 'z'))
    return 1;
  if ((ch >= 'A') && (ch <= 'Z'))
    return 1;
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  if (ch == ' ')
    return 1;
  if (ch == '.')
    return 1;
  if (ch == '-')
    return 1;
  if (ch == '_')
    return 1;
  if (ch == '/')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<goodchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <goodchar+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <goodchar+0x27>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x41,-0x8(%rbp)
jl     1147 <goodchar+0x47>
cmpl   $0x5a,-0x8(%rbp)
jg     1147 <goodchar+0x47>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x30,-0x8(%rbp)
jl     1167 <goodchar+0x67>
cmpl   $0x39,-0x8(%rbp)
jg     1167 <goodchar+0x67>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x20,-0x8(%rbp)
jne    117d <goodchar+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x2e,-0x8(%rbp)
jne    1193 <goodchar+0x93>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x2d,-0x8(%rbp)
jne    11a9 <goodchar+0xa9>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x5f,-0x8(%rbp)
jne    11bf <goodchar+0xbf>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
cmpl   $0x2f,-0x8(%rbp)
jne    11d5 <goodchar+0xd5>
movl   $0x1,-0x4(%rbp)
jmp    11dc <goodchar+0xdc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<goodchar>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%ecx
jb     1132 <goodchar+0x32>
mov    %edi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
cmp    $0x1a,%ecx
jb     1132 <goodchar+0x32>
add    $0xffffffe0,%edi
cmp    $0x3f,%edi
ja     1133 <goodchar+0x33>
movabs $0x800000000000e001,%rcx
bt     %rdi,%rcx
jae    1133 <goodchar+0x33>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @goodchar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %45
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %45
17: ; preds = %13, %10
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 48
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp sle i32 %21, 57
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %2
br label %45
24: ; preds = %20, %17
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 32
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %2
br label %45
28: ; preds = %24
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 46
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 1, i32* %2
br label %45
32: ; preds = %28
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 45
br i1 %34, label %35, label %36
35: ; preds = %32
store i32 1, i32* %2
br label %45
36: ; preds = %32
%37 = load i32, i32* %3
%38 = icmp eq i32 %37, 95
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 1, i32* %2
br label %45
40: ; preds = %36
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 47
br i1 %42, label %43, label %44
43: ; preds = %40
store i32 1, i32* %2
br label %45
44: ; preds = %40
store i32 0, i32* %2
br label %45
45: ; preds = %44, %43, %39, %35, %31, %27, %23, %16, %9
%46 = load i32, i32* %2
ret i32 %46
}

LLVM IR (-O2):
define i32 @goodchar(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
br i1 %7, label %10, label %8
8: ; preds = %1
switch i32 %0, label %9 [
i32 32, label %10
i32 46, label %10
i32 45, label %10
i32 95, label %10
i32 47, label %10
]
9: ; preds = %8
br label %10
10: ; preds = %8, %8, %8, %8, %8, %1, %9
%11 = phi i32 [ 0, %9 ], [ 1, %1 ], [ 1, %8 ], [ 1, %8 ], [ 1, %8 ], [ 1, %8 ], [ 1, %8 ]
ret i32 %11
}