unsigned int b64e(unsigned char *b) {
  unsigned int o, p = b[2] | (b[1] << 8) | (b[0] << 16);
  const char b64et[] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  o = b64et[p & 0x3f];
  p >>= 6;
  o = (o << 8) | b64et[p & 0x3f];
  p >>= 6;
  o = (o << 8) | b64et[p & 0x3f];
  p >>= 6;
  o = (o << 8) | b64et[p & 0x3f];
  return o;
}


x86 assembly (clang, -O0):
<b64e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x41,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
and    $0x3f,%eax
mov    %eax,%eax
movsbl -0x60(%rbp,%rax,1),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%ecx
and    $0x3f,%ecx
mov    %ecx,%ecx
movsbl -0x60(%rbp,%rcx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%ecx
and    $0x3f,%ecx
mov    %ecx,%ecx
movsbl -0x60(%rbp,%rcx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x6,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%ecx
and    $0x3f,%ecx
mov    %ecx,%ecx
movsbl -0x60(%rbp,%rcx,1),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64e>:
movzbl 0x2(%rdi),%ecx
movzbl 0x1(%rdi),%edx
shl    $0x8,%edx
mov    %ecx,%esi
or     %edx,%esi
movzbl (%rdi),%eax
mov    %eax,%edi
shl    $0x10,%edi
or     %edx,%edi
and    $0x3f,%ecx
lea    0xedd(%rip),%rdx
movzbl (%rcx,%rdx,1),%ecx
shr    $0x6,%esi
and    $0x3f,%esi
movsbl (%rsi,%rdx,1),%esi
shr    $0xc,%edi
and    $0x3f,%edi
shl    $0x10,%ecx
shl    $0x8,%esi
movsbl (%rdi,%rdx,1),%edi
or     %ecx,%edi
or     %esi,%edi
shr    $0x2,%rax
shl    $0x8,%edi
movsbl (%rax,%rdx,1),%eax
or     %edi,%eax
ret

LLVM IR (-O0):
@__const.b64e.b64et = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define i32 @b64e(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [65 x i8]
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %9, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 16
%21 = or i32 %15, %20
store i32 %21, i32* %4
%22 = bitcast [65 x i8]* %5 to i8*
%23 = load i32, i32* %4
%24 = and i32 %23, 63
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
store i32 %28, i32* %3
%29 = load i32, i32* %4
%30 = lshr i32 %29, 6
store i32 %30, i32* %4
%31 = load i32, i32* %3
%32 = shl i32 %31, 8
%33 = load i32, i32* %4
%34 = and i32 %33, 63
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = or i32 %32, %38
store i32 %39, i32* %3
%40 = load i32, i32* %4
%41 = lshr i32 %40, 6
store i32 %41, i32* %4
%42 = load i32, i32* %3
%43 = shl i32 %42, 8
%44 = load i32, i32* %4
%45 = and i32 %44, 63
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = or i32 %43, %49
store i32 %50, i32* %3
%51 = load i32, i32* %4
%52 = lshr i32 %51, 6
store i32 %52, i32* %4
%53 = load i32, i32* %3
%54 = shl i32 %53, 8
%55 = load i32, i32* %4
%56 = and i32 %55, 63
%57 = zext i32 %56 to i64
%58 = getelementptr inbounds [65 x i8], [65 x i8]* %5, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = or i32 %54, %60
store i32 %61, i32* %3
%62 = load i32, i32* %3
ret i32 %62
}

LLVM IR (-O2):
@__const.b64e.b64et = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define i32 @b64e(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = load i8, i8* %0
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = and i32 %4, 63
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [65 x i8], [65 x i8]* @__const.b64e.b64et, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = lshr i32 %9, 6
%20 = and i32 %19, 63
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [65 x i8], [65 x i8]* @__const.b64e.b64et, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = lshr i32 %13, 12
%26 = shl nsw i32 %18, 16
%27 = shl nsw i32 %24, 8
%28 = or i32 %27, %26
%29 = and i32 %25, 63
%30 = zext i32 %29 to i64
%31 = getelementptr inbounds [65 x i8], [65 x i8]* @__const.b64e.b64et, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = or i32 %28, %33
%35 = lshr i32 %11, 2
%36 = shl nsw i32 %34, 8
%37 = zext i32 %35 to i64
%38 = getelementptr inbounds [65 x i8], [65 x i8]* @__const.b64e.b64et, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = or i32 %36, %40
ret i32 %41
}