int valid_number_character(char ch) {
  char lower_ch;
  if ('0' <= ch && ch <= '9')
    return 1;
  if (ch == '-' || ch == '+' || ch == '.')
    return 1;
  lower_ch = ch | 0x20;
  if ('a' <= lower_ch && lower_ch <= 'y')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<valid_number_character>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1134 <valid_number_character+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1134 <valid_number_character+0x34>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <valid_number_character+0xa2>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     115b <valid_number_character+0x5b>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     115b <valid_number_character+0x5b>
movsbl -0x5(%rbp),%eax
cmp    $0x2e,%eax
jne    1167 <valid_number_character+0x67>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <valid_number_character+0xa2>
movsbl -0x5(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     119b <valid_number_character+0x9b>
movsbl -0x6(%rbp),%eax
cmp    $0x79,%eax
jg     119b <valid_number_character+0x9b>
movl   $0x1,-0x4(%rbp)
jmp    11a2 <valid_number_character+0xa2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_number_character>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%cl
jb     1127 <valid_number_character+0x27>
cmp    $0x2e,%dil
ja     1128 <valid_number_character+0x28>
movzbl %dil,%ecx
movabs $0x680000000000,%rdx
bt     %rcx,%rdx
jae    1128 <valid_number_character+0x28>
ret
or     $0x20,%dil
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x19,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_number_character(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %10, label %4
4: ; preds = %1
switch i8 %0, label %5 [
i8 46, label %10
i8 45, label %10
i8 43, label %10
]
5: ; preds = %4
%6 = or i8 %0, 32
%7 = add i8 %6, -97
%8 = icmp ult i8 %7, 25
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %4, %4, %4, %1
%11 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ %9, %5 ]
ret i32 %11
}