Function at 0x140016040
Capabilities:
Encode data using base64

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x20
mov r12, r9
mov rsi, rdx
mov rdi, rcx
mov ebx, dword [r8]
mov r13, qword [rcx + 8]
test r13, r13
je 0x140016185
mov rax, r13
shr rax, 1
movabs rcx, 0x5555555555555555
and rcx, rax
mov rax, r13
sub rax, rcx
movabs rcx, 0x3333333333333333
mov rdx, rax
and rdx, rcx
shr rax, 2
and rax, rcx
add rax, rdx
mov rcx, rax
shr rcx, 4
add rcx, rax
movabs rax, 0xf0f0f0f0f0f0f0f
and rax, rcx
movabs rcx, 0x101010101010101
imul rcx, rax
shr rcx, 0x38
cmp rcx, 1
jbe 0x140016194
mov r15, rbx
cmp r13, rbx
ja 0x1400160e0
mov eax, ebx
xor edx, edx
div r13d
mov r15d, edx
mov rax, qword [rdi]
mov rax, qword [rax + r15*8]
test rax, rax
jne 0x140016144
call fcn.140016600
mov edx, 0x20
mov rcx, rax
xor r8d, r8d
call fcn.1400166c0
test rax, rax
je 0x140016438
mov r14, rax
mov qword [rax], 0
mov qword [rax + 8], rbx
movups xmm0, xmmword [r12]
movups xmmword [rax + 0x10], xmm0
mov rax, qword [rdi + 0x18]
inc rax
jns 0x1400161a7
mov rcx, rax
shr rcx, 1
and eax, 1
or rax, rcx
xorps xmm0, xmm0
cvtsi2ss xmm0, rax
addss xmm0, xmm0
jmp 0x1400161af
mov r14, qword [rax]
test r14, r14
je 0x1400160ec
cmp ecx, 2
jb 0x140016261
mov rax, qword [r14 + 8]
cmp rax, rbx
je 0x14001644e
cmp rax, r13
jb 0x14001616f
xor edx, edx
div r13
mov rax, rdx
cmp rax, r15
jne 0x1400160ec
mov r14, qword [r14]
test r14, r14
jne 0x140016155
jmp 0x1400160ec
movabs r15, 0xaaaaaaaaaaaaaaaa
jmp 0x1400160ec
mov eax, 0xffffffff
add eax, r13d
mov r15d, ebx
and r15d, eax
jmp 0x1400160e0
xorps xmm0, xmm0
cvtsi2ss xmm0, rax
mov rcx, r13
shr rcx, 1
mov eax, r13d
and eax, 1
or rax, rcx
test r13, r13
jns 0x1400161d6
cvtsi2ss xmm1, rax
addss xmm1, xmm1
jmp 0x1400161db
mov rcx, qword [rax]
mov qword [r14], rcx
jmp 0x14001623f
cvtsi2ss xmm1, r13
movss xmm2, dword [rdi + 0x20]
je 0x1400162a5
mulss xmm1, xmm2
ucomiss xmm0, xmm1
ja 0x1400162a5
mov rcx, qword [rdi]
mov rax, qword [rcx + r15*8]
test rax, rax
jne 0x1400161ce
lea rax, [rdi + 0x10]
mov rdx, qword [rdi + 0x10]
mov qword [r14], rdx
mov qword [rdi + 0x10], r14
mov qword [rcx + r15*8], rax
mov rax, qword [r14]
test rax, rax
je 0x140016242
mov rax, qword [rax + 8]
lea rcx, [r13 - 1]
test r13, rcx
je 0x14001643a
cmp rax, r13
jb 0x140016238
xor edx, edx
div r13
mov rax, rdx
shl rax, 3
add rax, qword [rdi]
mov qword [rax], r14
inc qword [rdi + 0x18]
mov al, 1
mov qword [rsi], r14
mov byte [rsi + 8], al
mov rax, rsi
add rsp, 0x20
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
lea rax, [r13 - 1]
mov rcx, qword [r14 + 8]
cmp rcx, rbx
je 0x140016442
and rcx, rax
cmp rcx, r15
jne 0x1400160ec
mov r14, qword [r14]
test r14, r14
jne 0x140016265
jmp 0x1400160ec
mov eax, 0xffffffff
add eax, r13d
and ebx, eax
mov r15, rbx
jmp 0x1400161f3
mov r12d, 2
jmp 0x140016314
divss xmm0, xmm2
call fcn.1400f0268
cvttss2si rcx, xmm0
mov rdx, rcx
subss xmm0, dword [0x1401d6658]
sar rdx, 0x3f
cvttss2si rax, xmm0
and rax, rdx
or rax, rcx
lea rcx, [r13*2]
mov r12d, 1
cmp r13, 3
jb 0x1400162ef
lea rdx, [r13 - 1]
xor r12d, r12d
test r13, rdx
setne r12b
or r12, rcx
cmp r12, rax
cmovbe r12, rax
cmp r12, 1
je 0x14001629d
lea rax, [r12 - 1]
test r12, rax
je 0x140016314
mov rcx, r12
call fcn.14007fd50
mov r12, rax
mov r13, qword [rdi + 8]
cmp r12, r13
jbe 0x1400164be
mov r15, r12
mov rax, r15
shr rax, 0x3d
jne 0x14001645f
call fcn.140016600
lea rdx, [r15*8]
mov rcx, rax
xor r8d, r8d
call fcn.1400166c0
mov r12, qword [rdi]
mov qword [rdi], rax
test r12, r12
je 0x140016364
call fcn.140016600
mov rcx, rax
mov rdx, r12
call fcn.140023ff0
mov qword [rdi + 8], r15
xor eax, eax
mov rcx, qword [rdi]
mov qword [rcx + rax*8], 0
inc rax
cmp r15, rax
jne 0x14001636a
mov r8, qword [rdi + 0x10]
test r8, r8
je 0x1400163b7
lea r9, [rdi + 0x10]
mov rcx, qword [r8 + 8]
lea rax, [r15 - 1]
test r15, rax
je 0x140016467
cmp rcx, r15
jb 0x1400163ab
mov rax, rcx
xor edx, edx
div r15
mov rcx, rdx
mov rax, qword [rdi]
mov qword [rax + rcx*8], r9
mov r9, qword [r8]
jmp 0x14001640d
mov r13, qword [rdi + 8]
lea rax, [r13 - 1]
test r13, rax
je 0x14001628b
cmp r13, rbx
ja 0x140016295
mov rax, rbx
xor edx, edx
div r13
mov r15, rdx
jmp 0x1400161f3
mov rdx, qword [r9]
mov qword [r8], rdx
mov rdx, qword [rdi]
mov rdx, qword [rdx + rax*8]
mov rdx, qword [rdx]
mov qword [r9], rdx
mov rdx, qword [rdi]
mov rax, qword [rdx + rax*8]
mov qword [rax], r9
mov r9, r8
mov rax, rcx
mov r8, r9
mov r9, qword [r9]
mov rcx, rax
test r9, r9
je 0x1400163b7
mov rax, qword [r9 + 8]
cmp rax, r15
jb 0x140016423
xor edx, edx
div r15
mov rax, rdx
cmp rax, rcx
je 0x140016401
mov rdx, qword [rdi]
cmp qword [rdx + rax*8], 0
jne 0x1400163e1
mov qword [rdx + rax*8], r8
jmp 0x140016404
ud2
and rax, rcx
jmp 0x140016238
cmp dword [r14 + 0x10], ebx
jne 0x14001627e
jmp 0x140016458
cmp dword [r14 + 0x10], ebx
jne 0x140016178
xor eax, eax
jmp 0x140016248
int3
mov r8, rdx
jmp 0x140016471
and rcx, rax
mov rdx, qword [rdi]
mov qword [rdx + rcx*8], r9
mov rdx, qword [r8]
test rdx, rdx
je 0x1400163b7
mov r9, qword [rdx + 8]
and r9, rax
cmp r9, rcx
je 0x140016462
mov r10, qword [rdi]
cmp qword [r10 + r9*8], 0
jne 0x14001649f
mov qword [r10 + r9*8], r8
mov r8, rdx
mov rcx, r9
jmp 0x140016471
mov r10, qword [rdx]
mov qword [r8], r10
mov r10, qword [rdi]
mov r10, qword [r10 + r9*8]
mov r10, qword [r10]
mov qword [rdx], r10
mov r10, qword [rdi]
mov r9, qword [r10 + r9*8]
mov qword [r9], rdx
jmp 0x140016471
jae 0x1400163b7
mov rax, qword [rdi + 0x18]
test rax, rax
jns 0x1400164e7
mov rcx, rax
shr rcx, 1
and eax, 1
or rax, rcx
xorps xmm0, xmm0
cvtsi2ss xmm0, rax
addss xmm0, xmm0
jmp 0x1400164ef
xorps xmm0, xmm0
cvtsi2ss xmm0, rax
divss xmm0, dword [rdi + 0x20]
call fcn.1400f0268
cvttss2si rcx, xmm0
mov rdx, rcx
subss xmm0, dword [0x1401d6658]
cvttss2si rax, xmm0
sar rdx, 0x3f
and rax, rdx
or rax, rcx
cmp r13, 3
jb 0x1400165a3
mov rcx, r13
shr rcx, 1
movabs rdx, 0x5555555555555555
and rdx, rcx
mov rcx, r13
sub rcx, rdx
movabs rdx, 0x3333333333333333
mov r8, rcx
shr r8, 2
and rcx, rdx
and r8, rdx
add r8, rcx
mov rcx, r8
shr rcx, 4
add rcx, r8
movabs rdx, 0xf0f0f0f0f0f0f0f
and rdx, rcx
movabs rcx, 0x101010101010101
imul rcx, rdx
shr rcx, 0x38
cmp ecx, 1
ja 0x1400165a3
lea rcx, [rax - 1]
bsr rcx, rcx
xor ecx, 0x3f
neg cl
mov r15d, 1
shl r15, cl
cmp rax, 2
cmovb r15, rax
jmp 0x1400165ae
mov rcx, rax
call fcn.14007fd50
mov r15, rax
cmp r12, r15
cmova r15, r12
cmp r15, r13
jae 0x1400163b7
test r15, r15
jne 0x140016324
mov r15, qword [rdi]
mov qword [rdi], 0
test r15, r15
je 0x1400165e6
call fcn.140016600
mov rcx, rax
mov rdx, r15
call fcn.140023ff0
mov qword [rdi + 8], 0
jmp 0x1400163b7