Function at 0x140031320
Capabilities:
Encode data using base64

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x168
mov rbx, rcx
cmp byte [rdx + 0x4d], 0
jne 0x140031478
mov r12, qword [rdx + 0x10]
test r12, r12
je 0x140031478
mov qword [rsp + 0x88], rdx
movabs rax, 0x555555555555555
cmp r12, rax
ja 0x1400327c6
mov rax, qword [rsp + 0x88]
mov r13, qword [rax + 8]
movzx eax, byte [0x1404d41e8]
mov rcx, qword [0x1404d4148]
test rcx, rcx
jne 0x1400313a0
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov rcx, rax
mov qword [0x1404d4148], rax
lea rax, [r12*8]
lea rdi, [rax + rax*2]
xor edx, edx
mov r8, rdi
call qword [0x1403d7588]
test rax, rax
je 0x1400327c6
mov rsi, rax
mov qword [rsp + 0x40], rbx
xor ebp, ebp
mov qword [rsp + 0x28], r12
jmp 0x14003142d
mov qword [0x1404d4148], rax
mov rcx, rax
xor edx, edx
mov r8, rbx
call qword [0x1403d7588]
mov r15, rax
test rax, rax
je 0x1400327c6
dec r12
add r13, 0x18
mov rcx, r15
mov rdx, r14
mov r8, rbx
call fcn.1403c4426
mov qword [rsi + rbp], rbx
mov qword [rsi + rbp + 8], r15
mov qword [rsi + rbp + 0x10], rbx
add rbp, 0x18
test r12, r12
je 0x14003148e
cmp rdi, rbp
je 0x14003148e
mov r14, qword [r13 + 8]
mov rbx, qword [r13 + 0x10]
test rbx, rbx
je 0x140031470
js 0x1400327c6
movzx eax, byte [0x1404d41e8]
mov rax, qword [0x1404d4148]
test rax, rax
jne 0x1400313e7
call qword [0x1403d75c0]
test rax, rax
jne 0x1400313e0
jmp 0x1400327c6
mov r15d, 1
jmp 0x140031401
movabs rax, 0x7ffffffffffffff8
add rax, 8
mov qword [rbx], rax
jmp case.0x1400198ed.101
mov rax, qword [rsp + 0x88]
mov rdi, qword [rax + 0x20]
mov rbx, qword [rax + 0x28]
test rbx, rbx
mov qword [rsp + 0x68], rbx
je 0x140031506
mov rax, rbx
shr rax, 0x3d
jne 0x1400327c6
movzx eax, byte [0x1404d41e8]
mov rcx, qword [0x1404d4148]
test rcx, rcx
jne 0x1400314e1
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov rcx, rax
mov qword [0x1404d4148], rax
mov rbx, qword [rsp + 0x68]
lea r15, [rbx*4]
xor edx, edx
mov r8, r15
call qword [0x1403d7588]
mov r14, rax
test rax, rax
jne 0x140031514
jmp 0x1400327c6
lea r15, [rbx*4]
mov r14d, 4
mov rcx, r14
mov rdx, rdi
mov r8, r15
call fcn.1403c4426
mov qword [rsp + 0x120], rbx
mov qword [rsp + 0x128], r14
mov qword [rsp + 0x130], rbx
mov rax, qword [rsp + 0x28]
mov qword [rsp + 0x108], rax
mov qword [rsp + 0x110], rsi
mov qword [rsp + 0x118], rax
mov rax, qword [rsp + 0x88]
movdqu xmm0, xmmword [rax + 0x30]
movdqu xmmword [rsp + 0x138], xmm0
movzx eax, byte [rax + 0x48]
mov byte [rsp + 0x148], al
test al, al
mov rdi, rbx
je 0x1400315bd
lea rax, [rsp + 0x108]
mov qword [rsp + 0x90], rax
cmp rdi, 0x15
jae 0x1400315e7
cmp rdi, 1
jbe 0x1400323f4
lea r9, [rsp + 0x90]
mov r8d, 1
mov rcx, r14
mov rdx, rdi
call fcn.140027760
jmp 0x1400323f4
cmp rdi, 0x15
jae 0x140031d3c
cmp rdi, 1
jbe 0x1400323f4
mov r8d, 1
mov rcx, r14
mov rdx, rdi
call fcn.1400276d0
jmp 0x1400323f4
movzx eax, byte [0x1404d41e8]
mov rcx, qword [0x1404d4148]
test rcx, rcx
jne 0x140031613
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov rcx, rax
mov qword [0x1404d4148], rax
movabs rax, 0x7ffffffffffffff8
lea r8, [rdi + rdi]
add rax, 4
and r8, rax
xor edx, edx
call qword [0x1403d7588]
mov qword [rsp + 0x28], rax
test rax, rax
je 0x1400327c6
movzx eax, byte [0x1404d41e8]
mov rcx, qword [0x1404d4148]
test rcx, rcx
jne 0x14003166a
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov rcx, rax
mov qword [0x1404d4148], rax
mov r8d, pe_nt_image_headers64
xor edx, edx
call qword [0x1403d7588]
test rax, rax
je 0x1400327c6
mov rsi, rax
lea rax, [r14 - 0x10]
mov qword [rsp + 0xe0], rax
lea rax, [r14 + 0x10]
mov qword [rsp + 0x100], rax
mov qword [rsp + 0x30], r14
lea rax, [r14 - 4]
mov qword [rsp + 0x60], rax
mov eax, 0x10
mov qword [rsp + 0x78], rax
xor r14d, r14d
xor r15d, r15d
jmp 0x1400316d4
mov r15d, 1
mov r14, qword [rsp + 0x58]
cmp r14, rdi
jae 0x1400323cf
mov rax, rdi
sub rax, r14
mov rcx, qword [rsp + 0x30]
lea rcx, [rcx + r14*4]
cmp rax, 2
jae 0x140031760
mov r8, rax
mov rbx, rsi
lea rax, [r8 + r14]
mov rsi, rax
sub rsi, r14
jb 0x1400327c6
cmp rax, rdi
ja 0x1400327c6
jae 0x140031820
cmp r8, 0xa
jae 0x140031820
lea rsi, [r14 + 0xa]
cmp rsi, rdi
cmovae rsi, rdi
mov qword [rsp + 0x58], rsi
sub rsi, r14
jb 0x1400327c6
cmp r8, 1
adc r8, 0
mov rdx, rsi
lea r9, [rsp + 0x90]
call fcn.140027760
cmp r15, qword [rsp + 0x78]
je 0x14003182c
jmp 0x1400318a8
mov r8d, dword [rcx + 4]
mov r9, qword [rsp + 0x90]
mov rdx, qword [r9 + 0x10]
cmp rdx, r8
jbe 0x1400327c6
mov r10d, dword [rcx]
cmp rdx, r10
jbe 0x1400327c6
mov r9, qword [r9 + 8]
lea r8, [r8 + r8*2]
mov r8, qword [r9 + r8*8 + 0x10]
lea r10, [r10 + r10*2]
cmp r8, qword [r9 + r10*8 + 0x10]
jbe 0x140031bf0
mov r8d, 2
cmp rax, 3
jb 0x1400317ea
nop dword [rax]
mov r10d, dword [rcx + r8*4]
cmp rdx, r10
jbe 0x1400327c6
mov r11d, dword [rcx + r8*4 - 4]
cmp rdx, r11
jbe 0x1400327c6
lea r10, [r10 + r10*2]
mov r10, qword [r9 + r10*8 + 0x10]
lea r11, [r11 + r11*2]
cmp r10, qword [r9 + r11*8 + 0x10]
jbe 0x1400317ea
inc r8
cmp rax, r8
jne 0x1400317b0
mov r8, rax
mov rax, r8
add rax, r14
jb 0x1400327c6
cmp rax, rdi
ja 0x1400327c6
cmp r8, 2
jae 0x140031c40
mov rbx, rsi
jmp 0x1400316f3
mov qword [rsp + 0x58], rax
cmp r15, qword [rsp + 0x78]
jne 0x1400318a8
movzx eax, byte [0x1404d41e8]
mov rax, qword [0x1404d4148]
test rax, rax
jne 0x140031855
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov qword [0x1404d4148], rax
mov r8, r15
shl r8, 5
mov rcx, rax
xor edx, edx
call qword [0x1403d7588]
test rax, rax
je 0x1400327c6
mov rdi, rax
lea rax, [r15 + r15]
mov qword [rsp + 0x78], rax
mov r8, r15
shl r8, 4
mov rcx, rdi
mov rdx, rbx
call fcn.1403c4426
mov rcx, qword [0x1404d4148]
xor edx, edx
mov r8, rbx
call qword [0x1403d75f8]
mov rbx, rdi
mov rdi, qword [rsp + 0x68]
mov rax, r15
shl rax, 4
mov qword [rbx + rax], rsi
mov qword [rbx + rax + 8], r14
inc r15
mov rax, r15
cmp r15, 2
mov rsi, rbx
mov qword [rsp + 0x80], rbx
jae 0x140031954
jmp 0x1400316c6
mov rdi, rsi
mov rdx, qword [rsp + 0x28]
mov rsi, qword [rsp + 0x80]
add r13, rsi
add r14, rsi
sub r8, rdx
mov rcx, rdi
call fcn.1403c4426
mov rax, qword [rsp + 0xe8]
add rax, qword [rsp + 0x50]
mov qword [r14], rax
mov rax, qword [rsp + 0x48]
mov qword [r14 + 8], rax
lea rdx, [r13 + 0x10]
mov rax, qword [rsp + 0xf0]
not rax
mov r8, qword [rsp + 0x70]
add r8, rax
shl r8, 4
mov rcx, r13
call fcn.1403c4420
mov rax, qword [rsp + 0xf8]
cmp rax, 1
mov rdi, qword [rsp + 0x68]
jbe 0x1400316c0
mov r15, rax
lea r10, [rax - 1]
mov rcx, r10
shl rcx, 4
mov rax, qword [rsi + rcx]
mov rcx, qword [rsi + rcx + 8]
add rcx, rax
cmp rcx, rdi
je 0x1400319c0
mov rdx, r15
shl rdx, 4
mov r8, qword [rdx + rsi - 0x20]
cmp r8, rax
jbe 0x1400319c0
cmp r15, 2
jbe 0x140031c59
lea r11, [r15 - 3]
mov rcx, r11
shl rcx, 4
mov rcx, qword [rsi + rcx]
lea r9, [r8 + rax]
cmp rcx, r9
jbe 0x1400319d5
cmp r15, 3
jbe 0x140031d31
add r8, rcx
cmp qword [rdx + rsi - 0x40], r8
jbe 0x1400319d5
jmp 0x1400316c6
cmp r15, 3
jb 0x1400319da
lea r11, [r15 - 3]
mov rcx, r11
shl rcx, 4
mov rcx, qword [rsi + rcx]
cmp rcx, rax
jb 0x1400319de
lea r11, [r15 - 2]
cmp r15, r11
jbe 0x1400327c6
lea r14, [r11 + 1]
mov qword [rsp + 0x70], r15
cmp r15, r14
jbe 0x1400327c6
mov r13, r11
shl r13, 4
mov rcx, qword [rsi + r13 + 8]
shl r14, 4
mov rax, qword [rsi + r14]
mov rbx, qword [rsi + r14 + 8]
add rbx, rax
mov r12, rbx
sub r12, rcx
jb 0x1400327c6
cmp rbx, rdi
ja 0x1400327c6
mov qword [rsp + 0xe8], rax
mov qword [rsp + 0xf0], r11
mov qword [rsp + 0xf8], r10
mov rdx, qword [rsi + r13]
mov rax, qword [rsp + 0x30]
mov qword [rsp + 0x48], rcx
lea rdi, [rax + rcx*4]
lea rsi, [rdi + rdx*4]
mov r15, r12
sub r15, rdx
cmp r15, rdx
mov qword [rsp + 0x50], rdx
jae 0x140031b30
lea r8, [r15*4]
mov r12, qword [rsp + 0x28]
mov rcx, r12
mov rdx, rsi
call fcn.1403c4426
lea r8, [r12 + r15*4]
cmp qword [rsp + 0x50], 0
jle 0x1400318e0
test r15, r15
jle 0x1400318e0
mov rax, qword [rsp + 0x90]
mov rcx, qword [rsp + 0x60]
lea rcx, [rcx + rbx*4]
nop
mov edx, dword [r8 - 4]
mov r10, qword [rax + 0x10]
cmp r10, rdx
jbe 0x1400327c6
mov r9d, dword [rsi - 4]
cmp r10, r9
jbe 0x1400327c6
mov r10, qword [rax + 8]
lea rdx, [rdx + rdx*2]
mov rdx, qword [r10 + rdx*8 + 0x10]
lea r9, [r9 + r9*2]
mov r9, qword [r10 + r9*8 + 0x10]
xor r10d, r10d
xor r11d, r11d
cmp rdx, r9
setbe r10b
seta r11b
shl r11, 2
sub rsi, r11
shl r10, 2
sub r8, r10
cmp rdx, r9
mov rdx, r8
cmova rdx, rsi
mov edx, dword [rdx]
mov dword [rcx], edx
cmp rsi, rdi
jbe 0x1400318e0
add rcx, 0xfffffffffffffffc
cmp r8, qword [rsp + 0x28]
ja 0x140031ab0
jmp 0x1400318e0
lea r8, [rdx*4]
mov r15, qword [rsp + 0x28]
mov rcx, r15
mov rdx, rdi
call fcn.1403c4426
mov rax, qword [rsp + 0x50]
lea r8, [r15 + rax*4]
test rax, rax
jle 0x1400318e3
cmp r12, rax
jle 0x1400318e3
mov rax, qword [rsp + 0x30]
lea rax, [rax + rbx*4]
mov rcx, qword [rsp + 0x90]
mov rdx, qword [rsp + 0x28]
nop dword [rax]
mov r9d, dword [rsi]
mov r10, qword [rcx + 0x10]
cmp r10, r9
jbe 0x1400327c6
mov r11d, dword [rdx]
cmp r10, r11
jbe 0x1400327c6
mov rbx, qword [rcx + 8]
lea r10, [r9 + r9*2]
mov r15, qword [rbx + r10*8 + 0x10]
lea r12, [r11 + r11*2]
xor ebp, ebp
xor r10d, r10d
cmp r15, qword [rbx + r12*8 + 0x10]
setbe bpl
seta bl
cmovbe r9d, r11d
mov dword [rdi], r9d
add rdi, 4
lea rdx, [rdx + rbp*4]
cmp rdx, r8
jae 0x1400318e8
mov r10b, bl
lea rsi, [rsi + r10*4]
cmp rsi, rax
jb 0x140031b80
jmp 0x1400318e8
mov r8d, 2
cmp rax, 3
jb 0x1400316ec
mov r10d, dword [rcx + r8*4]
cmp rdx, r10
jbe 0x1400327c6
mov r11d, dword [rcx + r8*4 - 4]
cmp rdx, r11
jbe 0x1400327c6
lea r10, [r10 + r10*2]
mov r10, qword [r9 + r10*8 + 0x10]
lea r11, [r11 + r11*2]
cmp r10, qword [r9 + r11*8 + 0x10]
ja 0x1400316ec
inc r8
cmp rax, r8
jne 0x140031c00
jmp 0x1400316e9
mov r12, rax
mov rax, r8
shr rax, 1
mov rbx, rsi
cmp r8, 0x10
jae 0x140031c64
xor edx, edx
jmp 0x140031ce6
mov r15d, 2
jmp 0x1400316c6
mov rdx, rax
movabs r9, 0x7ffffffffffffff8
and rdx, r9
mov r9, qword [rsp + 0xe0]
lea r9, [r9 + r12*4]
mov r10, qword [rsp + 0x100]
lea r10, [r10 + r14*4]
xor r11d, r11d
nop
movdqu xmm0, xmmword [r10 + r11*4 - 0x10]
movdqu xmm1, xmmword [r10 + r11*4]
movdqu xmm2, xmmword [r9 - 0x10]
movdqu xmm3, xmmword [r9]
pshufd xmm3, xmm3, 0x1b
pshufd xmm2, xmm2, 0x1b
movdqu xmmword [r10 + r11*4 - 0x10], xmm3
movdqu xmmword [r10 + r11*4], xmm2
pshufd xmm0, xmm0, 0x1b
movdqu xmmword [r9], xmm0
pshufd xmm0, xmm1, 0x1b
movdqu xmmword [r9 - 0x10], xmm0
add r11, 8
add r9, 0xffffffffffffffe0
cmp rdx, r11
jne 0x140031c90
cmp rax, rdx
je 0x140031d29
neg rax
mov r9, rdx
neg r9
shl rdx, 2
lea rdx, [rdx + r14*4]
add rdx, qword [rsp + 0x30]
mov r10, qword [rsp + 0x60]
lea r10, [r10 + r12*4]
nop word cs:[rax + rax]
mov r11d, dword [rdx]
mov esi, dword [r10 + r9*4]
mov dword [rdx], esi
mov dword [r10 + r9*4], r11d
dec r9
add rdx, 4
cmp rax, r9
jne 0x140031d10
mov rax, r12
jmp 0x1400316f3
mov r15d, 3
jmp 0x1400316c6
movzx eax, byte [0x1404d41e8]
mov rcx, qword [0x1404d4148]
test rcx, rcx
jne 0x140031d68
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov rcx, rax
mov qword [0x1404d4148], rax
movabs rax, 0x7ffffffffffffff8
lea r8, [rdi + rdi]
add rax, 4
and r8, rax
xor edx, edx
call qword [0x1403d7588]
test rax, rax
je 0x1400327c6
mov r13, rax
movzx eax, byte [0x1404d41e8]
mov rcx, qword [0x1404d4148]
test rcx, rcx
jne 0x140031dbd
call qword [0x1403d75c0]
test rax, rax
je 0x1400327c6
mov rcx, rax
mov qword [0x1404d4148], rax
mov r8d, pe_nt_image_headers64
xor edx, edx
call qword [0x1403d7588]
test rax, rax
je 0x1400327c6
lea rcx, [r14 - 0x10]
mov qword [rsp + 0x78], rcx
lea rcx, [r14 + 0x10]
mov qword [rsp + 0xe0], rcx
lea rcx, [r14 - 4]
mov qword [rsp + 0x80], rcx
mov ecx, 0x10
mov qword [rsp + 0x58], rcx
xor ebp, ebp
xor r15d, r15d
mov qword [rsp + 0x30], r14
jmp 0x140031e24
mov rcx, qword [0x1404d4148]