int htp_base64_decode_single(signed 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);
  value_in -= 43;
  if ((value_in < 0) || (value_in > decoding_size - 1))
    return -1;
  return decoding[(int)value_in];
}


x86 assembly (clang, -O0):
<htp_base64_decode_single>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
sub    $0x2b,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jl     112e <htp_base64_decode_single+0x2e>
movsbl -0x5(%rbp),%eax
cmp    $0x4f,%eax
jle    113a <htp_base64_decode_single+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <htp_base64_decode_single+0x4f>
movsbl -0x5(%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):
<htp_base64_decode_single>:
add    $0xd5,%dil
mov    $0xffffffff,%eax
cmp    $0x4f,%dil
ja     111e <htp_base64_decode_single+0x1e>
movzbl %dil,%eax
lea    0xee6(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
@htp_base64_decode_single.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"
@htp_base64_decode_single.decoding_size = internal constant i8 80
define i32 @htp_base64_decode_single(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 43
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sgt i32 %13, 79
br i1 %14, label %15, label %16
15: ; preds = %11, %1
store i32 -1, i32* %2
br label %23
16: ; preds = %11
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [80 x i8], [80 x i8]* @htp_base64_decode_single.decoding, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
store i32 %22, i32* %2
br label %23
23: ; preds = %16, %15
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@htp_base64_decode_single.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 @htp_base64_decode_single(i8 signext %0) {
%2 = add i8 %0, -43
%3 = icmp ugt i8 %2, 79
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]* @htp_base64_decode_single.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
}