int _eml_b64_input(char c) {
  const char table[64] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  int i;
  for (i = 0; i < 64; i++) {
    if (table[i] == c)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<_eml_b64_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x40,-0x54(%rbp)
jge    1177 <_eml_b64_input+0x67>
movslq -0x54(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1164 <_eml_b64_input+0x54>
mov    -0x54(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117e <_eml_b64_input+0x6e>
jmp    1169 <_eml_b64_input+0x59>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    113a <_eml_b64_input+0x2a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eml_b64_input>:
xor    %eax,%eax
lea    0xef7(%rip),%rcx
nopl   0x0(%rax)
cmp    %dil,(%rax,%rcx,1)
je     1144 <_eml_b64_input+0x44>
cmp    %dil,0x1(%rax,%rcx,1)
je     113b <_eml_b64_input+0x3b>
cmp    %dil,0x2(%rax,%rcx,1)
je     1140 <_eml_b64_input+0x40>
cmp    %dil,0x3(%rax,%rcx,1)
je     1145 <_eml_b64_input+0x45>
add    $0x4,%rax
cmp    $0x40,%rax
jne    1110 <_eml_b64_input+0x10>
mov    $0xffffffff,%eax
ret
add    $0x1,%rax
ret
add    $0x2,%rax
ret
add    $0x3,%rax
ret

LLVM IR (-O0):
@__const._eml_b64_input.table = [64 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
define i32 @_eml_b64_input(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [64 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [64 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %22, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 64
br i1 %9, label %10, label %25
10: ; preds = %7
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = load i32, i32* %5
store i32 %20, i32* %2
br label %26
21: ; preds = %10
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %7
25: ; preds = %7
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %19
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@__const._eml_b64_input.table = [64 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
define i32 @_eml_b64_input(i8 signext %0) {
br label %2
2: ; preds = %22, %1
%3 = phi i64 [ 0, %1 ], [ %23, %22 ]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* @__const._eml_b64_input.table, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %0
br i1 %6, label %25, label %7
7: ; preds = %2
%8 = or i64 %3, 1
%9 = getelementptr inbounds [64 x i8], [64 x i8]* @__const._eml_b64_input.table, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %0
br i1 %11, label %25, label %12
12: ; preds = %7
%13 = or i64 %3, 2
%14 = getelementptr inbounds [64 x i8], [64 x i8]* @__const._eml_b64_input.table, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, %0
br i1 %16, label %25, label %17
17: ; preds = %12
%18 = or i64 %3, 3
%19 = getelementptr inbounds [64 x i8], [64 x i8]* @__const._eml_b64_input.table, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, %0
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = add nuw nsw i64 %3, 4
%24 = icmp eq i64 %23, 64
br i1 %24, label %28, label %2
25: ; preds = %17, %12, %7, %2
%26 = phi i64 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ], [ %18, %17 ]
%27 = trunc i64 %26 to i32
br label %28
28: ; preds = %22, %25
%29 = phi i32 [ %27, %25 ], [ -1, %22 ]
ret i32 %29
}