#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 */
typedef char int8_t;

/* Variables and functions */
int8_t getAlphanumeric(char c) {
  if (c >= '0' && c <= '9') {
    return (c - '0');
  }
  if (c >= 'A' && c <= 'Z') {
    return (c - 'A' + 10);
  }
  switch (c) {
  case ' ':
    return 36;
  case '$':
    return 37;
  case '%':
    return 38;
  case '*':
    return 39;
  case '+':
    return 40;
  case '-':
    return 41;
  case '.':
    return 42;
  case '/':
    return 43;
  case ':':
    return 44;
  }
  return -1;
}


x86 assembly (clang, -O0):
<getAlphanumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <getAlphanumeric+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <getAlphanumeric+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115f <getAlphanumeric+0x5f>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     115f <getAlphanumeric+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movsbl -0x2(%rbp),%eax
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1a,%eax
ja     11da <getAlphanumeric+0xda>
mov    -0x10(%rbp),%rax
lea    0xe80(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x24,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x25,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x26,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x27,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x28,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x29,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x2a,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x2b,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0x2c,-0x1(%rbp)
jmp    11de <getAlphanumeric+0xde>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAlphanumeric>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
jae    1108 <getAlphanumeric+0x8>
ret
lea    -0x41(%rdi),%eax
cmp    $0x19,%al
ja     1113 <getAlphanumeric+0x13>
lea    -0x37(%rdi),%eax
ret
add    $0xffffffe0,%edi
cmp    $0x1a,%edi
ja     1130 <getAlphanumeric+0x30>
mov    $0x24,%al
lea    0xedc(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x25,%al
ret
mov    $0xff,%al
ret
mov    $0x26,%al
ret
mov    $0x27,%al
ret
mov    $0x28,%al
ret
mov    $0x29,%al
ret
mov    $0x2a,%al
ret
mov    $0x2b,%al
ret
mov    $0x2c,%al
ret

LLVM IR (-O0):
define signext i8 @getAlphanumeric(i8 signext %0) {
%2 = alloca i8
%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 %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %43
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 90
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = add nsw i32 %27, 10
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %43
30: ; preds = %20, %16
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
switch i32 %32, label %42 [
i32 32, label %33
i32 36, label %34
i32 37, label %35
i32 42, label %36
i32 43, label %37
i32 45, label %38
i32 46, label %39
i32 47, label %40
i32 58, label %41
]
33: ; preds = %30
store i8 36, i8* %2
br label %43
34: ; preds = %30
store i8 37, i8* %2
br label %43
35: ; preds = %30
store i8 38, i8* %2
br label %43
36: ; preds = %30
store i8 39, i8* %2
br label %43
37: ; preds = %30
store i8 40, i8* %2
br label %43
38: ; preds = %30
store i8 41, i8* %2
br label %43
39: ; preds = %30
store i8 42, i8* %2
br label %43
40: ; preds = %30
store i8 43, i8* %2
br label %43
41: ; preds = %30
store i8 44, i8* %2
br label %43
42: ; preds = %30
store i8 -1, i8* %2
br label %43
43: ; preds = %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %24, %11
%44 = load i8, i8* %2
ret i8 %44
}

LLVM IR (-O2):
define signext i8 @getAlphanumeric(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = add i8 %0, -65
%7 = icmp ult i8 %6, 26
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = add nsw i8 %0, -55
br label %20
10: ; preds = %5
switch i32 %2, label %19 [
i32 32, label %20
i32 36, label %11
i32 37, label %12
i32 42, label %13
i32 43, label %14
i32 45, label %15
i32 46, label %16
i32 47, label %17
i32 58, label %18
]
11: ; preds = %10
br label %20
12: ; preds = %10
br label %20
13: ; preds = %10
br label %20
14: ; preds = %10
br label %20
15: ; preds = %10
br label %20
16: ; preds = %10
br label %20
17: ; preds = %10
br label %20
18: ; preds = %10
br label %20
19: ; preds = %10
br label %20
20: ; preds = %1, %10, %19, %18, %17, %16, %15, %14, %13, %12, %11, %8
%21 = phi i8 [ %9, %8 ], [ -1, %19 ], [ 44, %18 ], [ 43, %17 ], [ 42, %16 ], [ 41, %15 ], [ 40, %14 ], [ 39, %13 ], [ 38, %12 ], [ 37, %11 ], [ 36, %10 ], [ %3, %1 ]
ret i8 %21
}