int base64_encode(int dstsiz, char *dst, int buflen, const char *buf) {
  static void *ptr[] = {&&_L0, &&_L1};
  static int inited = 0;
  goto *ptr[inited];
_L0:
  SetupTable8192(), inited = 1;
_L1:
  return ToBase64Fast(buf, buflen, dst, dstsiz);
}


x86 assembly (clang, -O0):
<base64_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movslq 0x2f17(%rip),%rcx
lea    0x2efc(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
jmp    117d <base64_encode+0x5d>
mov    $0x0,%al
call   1040 <SetupTable8192@plt>
movl   $0x1,0x2ef2(%rip)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    $0x0,%al
call   1030 <ToBase64Fast@plt>
add    $0x30,%rsp
pop    %rbp
ret
mov    -0x28(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<base64_encode>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edi,%ebx
movzbl 0x2efc(%rip),%eax
lea    0x2cd1(%rip),%rcx
jmp    *(%rcx,%rax,8)
xor    %eax,%eax
call   1040 <SetupTable8192@plt>
movb   $0x1,0x2ee4(%rip)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <ToBase64Fast@plt>

LLVM IR (-O0):
@base64_encode.ptr = internal global [2 x i8*] [i8* blockaddress(@base64_encode, %13), i8* blockaddress(@base64_encode, %15)]
@base64_encode.inited = internal global i32 0
define i32 @base64_encode(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @base64_encode.inited
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* @base64_encode.ptr, i64 0, i64 %10
%12 = load i8*, i8** %11
br label %21
13: ; preds = %21
%14 = call i32 (...) @SetupTable8192()
store i32 1, i32* @base64_encode.inited
br label %15
15: ; preds = %13, %21
%16 = load i8*, i8** %8
%17 = load i32, i32* %7
%18 = load i8*, i8** %6
%19 = load i32, i32* %5
%20 = call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @ToBase64Fast to i32 (i8*, i32, i8*, i32, ...)*)(i8* %16, i32 %17, i8* %18, i32 %19)
ret i32 %20
21: ; preds = %4
%22 = phi i8* [ %12, %4 ]
indirectbr i8* %22, [label %13, label %15]
}

LLVM IR (-O2):
@base64_encode.ptr = internal unnamed_addr constant [2 x i8*] [i8* blockaddress(@base64_encode, %9), i8* blockaddress(@base64_encode, %11)]
@base64_encode.inited = internal unnamed_addr global i1 false
define i32 @base64_encode(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = load i1, i1* @base64_encode.inited
%6 = zext i1 %5 to i64
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* @base64_encode.ptr, i64 0, i64 %6
%8 = load i8*, i8** %7
indirectbr i8* %8, [label %9, label %11]
9: ; preds = %4
%10 = tail call i32 (...) @SetupTable8192()
store i1 true, i1* @base64_encode.inited
br label %11
11: ; preds = %9, %4
%12 = tail call i32 (i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @ToBase64Fast to i32 (i8*, i32, i8*, i32, ...)*)(i8* %3, i32 %2, i8* %1, i32 %0)
ret i32 %12
}