Function at 0x140059850
Capabilities:
Encode data using base64

Disassembly:
push rsi
push rdi
push rbx
sub rsp, 0x20
mov rsi, rcx
cmp rdx, 1
je 0x140059892
mov rdi, rdx
lea rax, [rdx - 1]
test rdx, rax
je 0x140059877
mov rcx, rdi
call fcn.140014080
mov rdi, rax
mov rbx, qword [rsi + 8]
cmp rdi, rbx
jbe 0x140059899
mov rcx, rsi
mov rdx, rdi
add rsp, 0x20
pop rbx
pop rdi
pop rsi
jmp 0x1400599a0
mov edi, 2
jmp 0x140059877
jae 0x140059995
mov rax, qword [rsi + 0x18]
test rax, rax
js 0x1400598af
cvtsi2ss xmm0, rax
jmp 0x1400598c4
mov rcx, rax
shr rcx, 1
and eax, 1
or rax, rcx
cvtsi2ss xmm0, rax
addss xmm0, xmm0
divss xmm0, dword [rsi + 0x20]
call fcn.1401990a0
cvttss2si rax, xmm0
movss xmm1, dword [0x1401b7680]
movaps xmm2, xmm0
subss xmm2, xmm1
cvttss2si r8, xmm2
btc r8, 0x3f
ucomiss xmm0, xmm1
cmovb r8, rax
cmp rbx, 3
jb 0x14005997d
mov rax, rbx
shr rax, 1
movabs rcx, 0x5555555555555555
and rcx, rax
mov rdx, rbx
sub rdx, rcx
movabs rcx, 0x3333333333333333
mov rax, rdx
shr rax, 2
and rdx, rcx
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 ecx, 1
ja 0x14005997d
lea rax, [r8 - 1]
bsr rcx, rax
xor ecx, 0x3f
neg cl
mov eax, 1
shl rax, cl
cmp r8, 2
cmovb rax, r8
jmp 0x140059985
mov rcx, r8
call fcn.140014080
cmp rdi, rax
cmovb rdi, rax
cmp rdi, rbx
jb 0x140059880
add rsp, 0x20
pop rbx
pop rdi
pop rsi
ret
push r14
push rsi
push rdi
push rbx
sub rsp, 0x28
mov rsi, rcx
test rdx, rdx
je 0x140059b5e
mov r14, rdx
mov rax, rdx
shr rax, 0x3d
jne 0x140059b84
lea rcx, [r14*8]
call fcn.140180340
mov rcx, qword [rsi]
mov qword [rsi], rax
test rcx, rcx
je 0x1400599e2
call fcn.140180390
cmp r14, 1
mov edx, 1
cmova rdx, r14
mov qword [rsi + 8], r14
lea rcx, [rdx - 1]
mov eax, edx
and eax, 3
cmp rcx, 3
jae 0x140059a06
xor ecx, ecx
jmp 0x140059a36
and rdx, 0xfffffffffffffffc
xor edi, edi
xor ecx, ecx
mov rbx, qword [rsi]
mov qword [rbx + rcx*8], rdi
mov rbx, qword [rsi]
mov qword [rbx + rcx*8 + 8], rdi
mov rbx, qword [rsi]
mov qword [rbx + rcx*8 + 0x10], rdi
mov rbx, qword [rsi]
mov qword [rbx + rcx*8 + 0x18], rdi
add rcx, 4
cmp rdx, rcx
jne 0x140059a0e
test rax, rax
je 0x140059a4e
mov rdx, qword [rsi]
mov qword [rdx + rcx*8], 0
inc rcx
dec rax
jne 0x140059a3b
mov rdi, qword [rsi + 0x10]
test rdi, rdi
je 0x140059b7a
lea rcx, [rsi + 0x10]
mov r8, qword [rdi + 8]
mov rax, r14
shr rax, 1
movabs rdx, 0x5555555555555555
and rdx, rax
mov rax, r14
sub rax, rdx
movabs rdx, 0x3333333333333333
mov rbx, rax
and rbx, rdx
shr rax, 2
and rax, rdx
add rax, rbx
mov rdx, rax
shr rdx, 4
add rdx, rax
movabs rax, 0xf0f0f0f0f0f0f0f
and rax, rdx
movabs r9, 0x101010101010101
imul r9, rax
shr r9, 0x38
cmp r9, 1
jbe 0x140059b89
cmp r8, r14
jb 0x140059ad9
mov rax, r8
xor edx, edx
div r14
mov r8, rdx
mov rax, qword [rsi]
mov qword [rax + r8*8], rcx
mov rcx, qword [rdi]
test rcx, rcx
je 0x140059b7a
mov rax, qword [rcx + 8]
cmp r9d, 1
jbe 0x140059b55
cmp rax, r14
jb 0x140059b03
xor edx, edx
div r14
mov rax, rdx
cmp rax, r8
je 0x140059b50
mov rbx, qword [rsi]
cmp qword [rbx + rax*8], 0
mov rdx, rcx
jne 0x140059b21
mov qword [rbx + rax*8], rdi
mov rdi, rcx
mov r8, rax
jmp 0x140059ae0
mov r10, rdx
mov rdx, qword [rdx]
test rdx, rdx
je 0x140059b34
mov ebx, dword [rcx + 0x10]
cmp ebx, dword [rdx + 0x10]
je 0x140059b21
mov qword [rdi], rdx
mov rdx, qword [rsi]
mov rdx, qword [rdx + rax*8]
mov rdx, qword [rdx]
mov qword [r10], rdx
mov rdx, qword [rsi]
mov rax, qword [rdx + rax*8]
mov qword [rax], rcx
jmp 0x140059ae0
mov rdi, rcx
jmp 0x140059ae0
lea rdx, [r14 - 1]
and rax, rdx
jmp 0x140059b03
mov rcx, qword [rsi]
mov qword [rsi], 0
test rcx, rcx
je 0x140059b72
call fcn.140180390
mov qword [rsi + 8], 0
add rsp, 0x28
pop rbx
pop rdi
pop rsi
pop r14
ret
call fcn.140194834
lea rax, [r14 - 1]
and r8, rax
jmp 0x140059ad9