int base64_decode_value(int value) {
  static const int decoding[] = {
      62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
      -1, -1, -2, -1, -1, -1, 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
      10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
      -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
      36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51};
  static const int decoding_size = sizeof(decoding);
  int codepos = value;
  codepos -= 43;
  if (codepos < 0 || codepos > decoding_size)
    return -1;
  return decoding[codepos];
}


x86 assembly (clang, -O0):
<base64_decode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     112d <base64_decode_value+0x2d>
cmpl   $0x140,-0xc(%rbp)
jle    1139 <base64_decode_value+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <base64_decode_value+0x4a>
movslq -0xc(%rbp),%rcx
lea    0xebc(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_value>:
lea    -0x16c(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0xfffffebf,%ecx
jb     1120 <base64_decode_value+0x20>
add    $0xffffffd5,%edi
lea    0xee3(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@base64_decode_value.decoding = internal constant [80 x i32] [i32 62, i32 -1, i32 -1, i32 -1, i32 63, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 -1, i32 -1, i32 -1, i32 -2, i32 -1, i32 -1, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51]
@base64_decode_value.decoding_size = internal constant i32 320
define i32 @base64_decode_value(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 43
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 320
br i1 %12, label %13, label %14
13: ; preds = %10, %1
store i32 -1, i32* %2
br label %19
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [80 x i32], [80 x i32]* @base64_decode_value.decoding, i64 0, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@base64_decode_value.decoding = internal unnamed_addr constant [80 x i32] [i32 62, i32 -1, i32 -1, i32 -1, i32 63, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 -1, i32 -1, i32 -1, i32 -2, i32 -1, i32 -1, i32 -1, i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38, i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49, i32 50, i32 51]
define i32 @base64_decode_value(i32 %0) {
%2 = add i32 %0, -364
%3 = icmp ult i32 %2, -321
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -43
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [80 x i32], [80 x i32]* @base64_decode_value.decoding, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}