Function at 0x66f560
Capabilities:
Encode data using base64

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
xor ebp, ebp
mov qword [rsp + 0x98], rdx
mov edx, dword [rcx]
mov qword [rsp + 0xa0], r8
lea r8, [rcx + 8]
mov qword [rsp + 0x90], rcx
test edx, edx
jle 0x66f5a3
movsxd rax, edx
cmp byte [r8 + rax - 1], 0x3d
je 0x66f8f8
mov r11d, dword [rsp + 0xb0]
xor r12d, r12d
test r11d, r11d
je 0x66f868
mov rdi, qword [rsp + 0x90]
lea rax, [0x0097e320]
mov r10d, dword [rsp + 0xb0]
lea rcx, [0x0097e2a0]
mov r15, rax
test byte [rdi + 0x5c], 2
cmovne r15, rcx
test r10d, r10d
jle 0x66f9a0
mov edi, dword [rsp + 0xb0]
mov qword [rsp + 0x30], rcx
mov dword [rsp + 0xb0], 0
lea r10d, [rdi - 1]
mov qword [rsp + 0x38], rax
lea rdi, [r9 + r10 + 1]
mov qword [rsp + 0x28], rdi
jmp 0x66f644
test ebp, ebp
je 0x66f67d
or eax, 0x13
cmp al, 0xf3
jne 0x66f862
cmp r10d, 0xf2
je 0x66f920
cmp edx, 0x40
je 0x66f6a9
cmp r9, qword [rsp + 0x28]
je 0x66f8d0
movzx ecx, byte [r9]
add r9, 1
test cl, cl
js 0x66f862
movzx eax, cl
movzx r10d, byte [r15 + rax]
mov eax, r10d
cmp r10d, 0xff
je 0x66f862
cmp cl, 0x3d
jne 0x66f618
add ebp, 1
cmp ebp, 3
je 0x66f862
cmp r10d, 0xf2
je 0x66f920
or eax, 0x13
cmp al, 0xf3
je 0x66f634
cmp edx, 0x3f
jg 0x66f862
movsxd rax, edx
add edx, 1
mov byte [r8 + rax], cl
cmp edx, 0x40
jne 0x66f639
mov rax, qword [rsp + 0x90]
mov rsi, qword [rsp + 0x38]
mov rcx, r8
test byte [rax + 0x5c], 2
movzx eax, byte [rax + 8]
cmovne rsi, qword [rsp + 0x30]
test al, al
js 0x66f6f2
nop dword [rax + rax]
cmp byte [rsi + rax], 0xe0
jne 0x66f6ed
test edx, edx
je 0x66f8a0
movzx eax, byte [rcx + 1]
add rcx, 1
sub edx, 1
test al, al
jns 0x66f6d0
cmp edx, 3
jle 0x66f723
movsxd rax, edx
lea r10, [rcx + rax - 1]
jmp 0x66f71b
movzx eax, byte [rsi + rax]
or eax, 0x13
cmp al, 0xf3
jne 0x66f723
sub edx, 1
sub r10, 1
cmp edx, 3
je 0x66f860
movzx eax, byte [r10]
test al, al
jns 0x66f700
test dl, 3
jne 0x66f860
test edx, edx
jle 0x66f8a0
mov rdi, qword [rsp + 0x98]
xor r13d, r13d
xor r12d, r12d
jmp 0x66f7f0
movzx eax, byte [rsi + rax]
movzx r10d, byte [rcx + 1]
mov r14d, eax
test r10b, r10b
js 0x66f818
movzx ebx, byte [rsi + r10]
movzx r10d, byte [rcx + 2]
test r10b, r10b
js 0x66f830
add rcx, 4
movzx r11d, byte [rsi + r10]
movzx r10d, byte [rcx - 1]
test r10b, r10b
js 0x66f850
movzx r10d, byte [rsi + r10]
test r14b, r14b
js 0x66f860
test bl, bl
js 0x66f860
test r11b, r11b
js 0x66f860
test r10b, r10b
js 0x66f860
shl eax, 0x12
shl ebx, 0xc
add rdi, 3
add r13d, 4
shl r11d, 6
or eax, ebx
add r12d, 3
or eax, r11d
mov byte [rdi - 2], ah
mov r11d, eax
or r10d, eax
shr r11d, 0x10
mov byte [rdi - 3], r11b
mov byte [rdi - 1], r10b
cmp r13d, edx
jge 0x66f8a7
movzx eax, byte [rcx]
test al, al
jns 0x66f750
movzx r10d, byte [rcx + 1]
mov r14d, 0xffffffff
mov eax, 0xff
test r10b, r10b
jns 0x66f765
nop dword [rax]
movzx r10d, byte [rcx + 2]
mov ebx, 0xff
test r10b, r10b
jns 0x66f778
nop dword [rax + rax]
movzx r10d, byte [rcx + 3]
add rcx, 4
mov r11d, 0xff
test r10b, r10b
jns 0x66f78f
nop dword [rax + rax]
mov r10d, 0xff
test r14b, r14b
jns 0x66f79d
nop
xor edx, edx
mov r12d, 0xffffffff
mov rax, qword [rsp + 0xa0]
mov edi, dword [rsp + 0xb0]
mov dword [rax], edi
mov rax, qword [rsp + 0x90]
mov dword [rax], edx
mov eax, r12d
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
test ebp, ebp
jne 0x66f860
xor r12d, r12d
sub r12d, ebp
xor edx, edx
add dword [rsp + 0xb0], r12d
movsxd r12, r12d
add qword [rsp + 0x98], r12
cmp r9, qword [rsp + 0x28]
jne 0x66f644
nop word [rax + rax]
test edx, edx
jle 0x66f8dd
test dl, 3
je 0x66f968
test edx, edx
setne r12b
test ebp, ebp
sete al
or r12d, eax
movzx r12d, r12b
jmp 0x66f868
mov ebp, 1
cmp edx, 1
je 0x66f5a3
xor ebp, ebp
cmp byte [r8 + rax - 2], 0x3d
sete bpl
add ebp, 1
jmp 0x66f5a3
xor r12d, r12d
test edx, edx
jle 0x66f868
mov r12d, edx
and r12d, 3
jne 0x66f862
mov r9d, edx
mov rcx, qword [rsp + 0x90]
mov rdx, qword [rsp + 0x98]
call fcn.0066f060
cmp ebp, eax
jg 0x66f860
sub eax, ebp
xor edx, edx
add dword [rsp + 0xb0], eax
jmp 0x66f868
mov r9d, edx
mov rcx, qword [rsp + 0x90]
mov rdx, qword [rsp + 0x98]
call fcn.0066f060
cmp ebp, eax
jg 0x66f860
sub eax, ebp
xor edx, edx
add dword [rsp + 0xb0], eax
jmp 0x66f8dd
mov dword [rsp + 0xb0], 0
jmp 0x66f8d0