int base64_decode_value(char value_in) {
  static const signed char 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 signed char decoding_size = sizeof(decoding);
  signed char signed_value_in = (signed char)value_in - 43;
  if (signed_value_in < 0 || signed_value_in > decoding_size) {
    return -1;
  }
  return decoding[(int)signed_value_in];
}


x86 assembly (clang, -O0):
<base64_decode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x2b,%eax
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jl     112e <base64_decode_value+0x2e>
movsbl -0x6(%rbp),%eax
cmp    $0x50,%eax
jle    113a <base64_decode_value+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <base64_decode_value+0x4f>
movsbl -0x6(%rbp),%eax
movslq %eax,%rcx
lea    0xeb8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_value>:
add    $0xd5,%dil
mov    $0xffffffff,%eax
cmp    $0x50,%dil
ja     111e <base64_decode_value+0x1e>
movzbl %dil,%eax
lea    0xee6(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@base64_decode_value.decoding = internal constant [80 x i8] c">\FF\FF\FF?456789:;<=\FF\FF\FF\FE\FF\FF\FF\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\FF\FF\FF\FF\FF\FF\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123"
@base64_decode_value.decoding_size = internal constant i8 80
define i32 @base64_decode_value(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 = sub nsw i32 %6, 43
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %1
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 80
br i1 %15, label %16, label %17
16: ; preds = %12, %1
store i32 -1, i32* %2
br label %24
17: ; preds = %12
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [80 x i8], [80 x i8]* @base64_decode_value.decoding, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
store i32 %23, i32* %2
br label %24
24: ; preds = %17, %16
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@base64_decode_value.decoding = internal unnamed_addr constant [80 x i8] c">\FF\FF\FF?456789:;<=\FF\FF\FF\FE\FF\FF\FF\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\FF\FF\FF\FF\FF\FF\1A\1B\1C\1D\1E\1F !\22#$%&'()*+,-./0123"
define i32 @base64_decode_value(i8 signext %0) {
%2 = add i8 %0, -43
%3 = icmp ugt i8 %2, 80
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = zext i8 %2 to i64
%6 = getelementptr inbounds [80 x i8], [80 x i8]* @base64_decode_value.decoding, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}