Function at 0x140021850
Capabilities:
Encode data using base64

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x20
mov r12d, 1
mov edi, r8d
shr edi, 0x1b
mov esi, r8d
shr esi, 0x1c
and dil, r12b
and sil, r12b
mov r14d, 0x4000
mov r13, rdx
mov rbx, rcx
test r14d, r8d
je 0x140021897
cmp byte [rdx], 0
je 0x140021897
mov bpl, r12b
jmp 0x14002189a
xor bpl, bpl
test rbx, rbx
je 0x1400218ac
xor edx, edx
mov r8d, 0x158
call fcn.14002cb40
test dil, dil
je 0x1400218e5
lea r9, [0x1400369f8]
mov r10d, 6
movsxd rax, dword [r9]
mov rdx, r12
mov r8, rax
lea r9, [r9 + 4]
shr r8, 6
and al, 0x3f
mov cl, al
shl rdx, cl
or qword [rbx + r8*8 + 0x38], rdx
or qword [rbx + r8*8 + 8], rdx
sub r10, r12
jne 0x1400218be
test sil, sil
je 0x14002191e
lea r9, [0x140036a10]
mov r10d, 3
movsxd rax, dword [r9]
mov rdx, r12
mov r8, rax
lea r9, [r9 + 4]
shr r8, 6
and al, 0x3f
mov cl, al
shl rdx, cl
or qword [rbx + r8*8 + 0x38], rdx
or qword [rbx + r8*8 + 8], rdx
sub r10, r12
jne 0x1400218f7
test bpl, bpl
je 0x140021cae
mov esi, r12d
mov rdi, r12
mov ebp, 0x99
mov ecx, esi
call fcn.140020e08
cmp eax, 0xffffffff
je 0x1400219cf
mov edx, eax
mov rcx, r13
call fcn.1400207c8
mov r8, rdi
mov r9d, eax
shr r8, 6
test eax, 0xfedbffff
je 0x14002196e
mov cl, dil
mov rdx, r12
and cl, 0x3f
shl rdx, cl
or qword [rbx + r8*8 + 8], rdx
mov rcx, rdi
and ecx, 0x3f
test r12b, r9b
je 0x140021984
mov rax, r12
shl rax, cl
or qword [rbx + r8*8 + 0x20], rax
mov rax, r12
shl rax, cl
test r9b, 4
je 0x14002199d
or qword [rbx + r8*8 + 0x50], rax
or qword [rbx + r8*8 + 0x140], rax
test r9b, 2
je 0x1400219a8
or qword [rbx + r8*8 + 0x68], rax
test r9d, 0x118
je 0x1400219bb
or qword [rbx + r8*8 + 0xc8], rax
jmp 0x1400219c2
mov r8, rdi
shr r8, 6
test r14d, r9d
je 0x1400219cf
or qword [rbx + r8*8 + 0x98], rax
add esi, r12d
add rdi, r12
cmp esi, ebp
jl 0x140021932
cmp dword [r13 + 0x11c], 0
je 0x1400219f8
movabs rax, 0x31e0700001e
or qword [rbx + 0x80], rax
movabs rax, 0x2048201480
mov edx, r12d
or qword [rbx + 8], rax
mov r8, r12
mov eax, 0x48201000
or qword [rbx + 0x20], rax
or qword [rbx + 0x50], rax
or qword [rbx + 0x140], rax
or qword [rbx + 0x68], rax
mov cl, r8b
mov r9, r12
and cl, 0x3f
shl r9, cl
mov rcx, r8
shr rcx, 6
test qword [rbx + rcx*8 + 8], r9
je 0x140021a73
cmp edx, 0x3d
ja 0x140021a53
movabs r10, 0x2000004000000780
bt r10, rdx
jb 0x140021a6b
lea eax, [rdx - 0x4c]
cmp eax, 0x3a
ja 0x140021a73
movabs r10, 0x4001c0000000011
bt r10, rax
jae 0x140021a73
or qword [rbx + rcx*8 + 0xe0], r9
add edx, r12d
add r8, r12
cmp edx, ebp
jl 0x140021a24
mov r10, r12
lea r11, [r13 + 0x184]
mov edi, 0x98
mov r9d, dword [r11]
test r12b, r9b
je 0x140021b1a
mov rdx, r10
mov cl, r10b
shr rdx, 6
and cl, 0x3f
mov r8, r12
shl r8, cl
or qword [rbx + rdx*8 + 8], r8
test r9b, 0x20
je 0x140021abb
or qword [rbx + rdx*8 + 0x20], r8
test r9b, 0x40
je 0x140021ace
or qword [rbx + rdx*8 + 0x50], r8
or qword [rbx + rdx*8 + 0x140], r8
test r9b, r9b
jns 0x140021ad8
or qword [rbx + rdx*8 + 0x68], r8
test r9b, 4
je 0x140021aee
or qword [rbx + rdx*8 + 0x80], r8
or qword [rbx + rdx*8 + 0xc8], r8
test r9b, 8
je 0x140021afc
or qword [rbx + rdx*8 + 0xe0], r8
bt r9d, 8
jae 0x140021b0b
or qword [rbx + rdx*8 + 0xb0], r8
bt r9d, 9
jae 0x140021b1a
or qword [rbx + rdx*8 + 0x128], r8
add r10, r12
add r11, 4
sub rdi, r12
jne 0x140021a8c
movabs rax, 0xfffdffffffffffff
movabs rcx, 0x7fffffffffffffff
and qword [rbx + 0x58], rax
mov r14d, r12d
btr qword [rbx + 0x60], 0x18
movabs rax, 0xffffe7ffffffffff
and qword [rbx + 0x50], rax
mov r15, r12
movabs rax, 0xfffffffdffffffff
and qword [rbx + 0x58], rax
movabs rax, 0xffffffff7fffffff
and qword [rbx + 0x88], rax
movabs rax, 0xff7fffffffffffff
and qword [rbx + 0x80], rax
mov rax, qword [rbx + 0x88]
btr rax, 0x1a
and rax, rcx
mov qword [rbx + 0x88], rax
and qword [rbx + 0x90], 0xffffffffffffffeb
mov rdi, r15
mov cl, r15b
and cl, 0x3f
shr rdi, 6
mov rbp, r12
shl rbp, cl
test qword [rbx + rdi*8 + 0xc8], rbp
jne 0x140021c12
cmp dword [r13 + 0x16c], 0
je 0x140021c1a
mov esi, r12d
movsxd rdx, esi
mov al, dl
shr rdx, 6
and al, 0x3f
movzx ecx, al
mov rax, qword [rbx + rdx*8 + 0xc8]
bt rax, rcx
jae 0x140021c05
xor r9d, r9d
mov r8d, esi
mov edx, r14d
mov rcx, rbx
call fcn.1400216b4
test al, al
jne 0x140021c12
add esi, r12d
cmp esi, 0x99
jge 0x140021c1a
jmp 0x140021bd4
or qword [rbx + rdi*8 + 0xf8], rbp
add r14d, r12d
add r15, r12
cmp r14d, 0x99
jl 0x140021baa
mov r14d, r12d
mov r15, r12
mov rdi, r15
mov cl, r15b
and cl, 0x3f
shr rdi, 6
mov rbp, r12
shl rbp, cl
test qword [rbx + rdi*8 + 0xe0], rbp
jne 0x140021c97
cmp dword [r13 + 0x16c], 0
je 0x140021c9f
mov esi, r12d
movsxd rdx, esi
mov al, dl
shr rdx, 6
and al, 0x3f
movzx ecx, al
mov rax, qword [rbx + rdx*8 + 0xe0]
bt rax, rcx
jae 0x140021c8a
xor r9d, r9d
mov r8d, esi
mov edx, r14d
mov rcx, rbx
call fcn.1400216b4
test al, al
jne 0x140021c97
add esi, r12d
cmp esi, 0x99
jge 0x140021c9f
jmp 0x140021c59
or qword [rbx + rdi*8 + 0x110], rbp
add r14d, r12d
add r15, r12
cmp r14d, 0x99
jl 0x140021c2f
mov rbx, qword [rsp + 0x70]
add rsp, 0x20
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret