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


x86 assembly (clang, -O0):
<base64_decode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x2b,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     112e <base64_decode_value+0x2e>
movsbl -0x1(%rbp),%eax
cmp    $0x50,%eax
jl     113b <base64_decode_value+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <base64_decode_value+0x50>
movsbl -0x1(%rbp),%eax
movslq %eax,%rcx
lea    0xeb7(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode_value>:
add    $0xd5,%dil
mov    $0xff,%al
cmp    $0x4f,%dil
ja     111a <base64_decode_value+0x1a>
movzbl %dil,%eax
lea    0xee9(%rip),%rcx
mov    (%rax,%rcx,1),%al
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 signext i8 @base64_decode_value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 43
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 80
br i1 %13, label %14, label %15
14: ; preds = %10, %1
br label %22
15: ; preds = %10
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [80 x i8], [80 x i8]* @base64_decode_value.decoding, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
br label %22
22: ; preds = %15, %14
%23 = phi i32 [ -1, %14 ], [ %21, %15 ]
%24 = trunc i32 %23 to i8
ret i8 %24
}

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 signext i8 @base64_decode_value(i8 signext %0) {
%2 = add i8 %0, -43
%3 = icmp ugt i8 %2, 79
br i1 %3, label %8, 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
br label %8
8: ; preds = %1, %4
%9 = phi i8 [ %7, %4 ], [ -1, %1 ]
ret i8 %9
}