Function at 0x59ab00
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rsi, qword [rdx + 0x40]
movsxd rax, r9d
mov qword [rsp + 0x90], rcx
mov r15, rdx
mov rdi, rax
mov qword [rsp + 0x30], rax
mov rax, qword [r8 + 0x28]
mov qword [rsp + 0xa0], r8
mov dword [rsp + 0xa8], r9d
mov rax, qword [rax + rdi*8]
test rax, rax
mov qword [rsp + 0x28], rax
je 0x59ab62
mov rax, qword [rsp + 0x28]
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov r8d, dword [rdx + 0x10]
test r8d, r8d
jle 0x59ab84
mov rdx, qword [rdx + 0x28]
xor eax, eax
mov dword [rdx], 0
add eax, 1
add rdx, 4
cmp dword [r15 + 0x10], eax
jg 0x59ab71
mov ecx, dword [r15 + 8]
test ecx, ecx
jle 0x59ab4c
mov rax, qword [rsp + 0xa0]
mov r9d, dword [rsp + 0xa8]
xor r8d, r8d
xor ecx, ecx
mov r12d, 1
xor ebp, ebp
mov r11d, 1
xor edi, edi
mov r14, qword [rax]
mov rax, r8
shr rax, 5
mov eax, dword [r14 + rax*4]
bt eax, r8d
jae 0x59ac34
mov r10, qword [rsi + 0x20]
mov rax, qword [r10 + r8*8]
lea rdx, [rax + 8]
movsx eax, word [rax + 8]
cmp ax, 0xffff
jne 0x59abed
jmp 0x59ac34
add rdx, 8
movsx eax, word [rdx]
cmp ax, 0xffff
je 0x59ac34
cmp eax, r9d
jne 0x59abe0
movsxd rax, dword [rdx + 4]
mov rbx, qword [r15 + 0x28]
mov r13d, r11d
mov rcx, rax
shr rax, 5
shl r13d, cl
or dword [rbx + rax*4], r13d
mov ecx, 1
movsxd rax, dword [rdx + 4]
cmp eax, dword [rsi + 0x10]
mov rax, qword [r10 + rax*8]
cmove ebp, r11d
cmp word [rax], 0
cmove r12d, edi
add rdx, 8
movsx eax, word [rdx]
cmp ax, 0xffff
jne 0x59abed
mov eax, dword [r15 + 8]
lea edx, [r8 + 1]
add r8, 1
cmp eax, edx
jg 0x59abb4
test ecx, ecx
mov dword [rsp + 0x3c], ecx
je 0x59ab4c
xor r13d, r13d
test byte [rsi + 8], 1
je 0x59ad7b
mov r14, r15
test eax, eax
jle 0x59ad6c
xor edi, edi
xor r15d, r15d
mov rdx, qword [r14 + 0x28]
mov rcx, rdi
shr rcx, 5
mov edx, dword [rdx + rcx*4]
bt edx, edi
jae 0x59ad54
mov rdx, qword [rsi + 0x20]
mov rdx, qword [rdx + rdi*8]
movsx r9d, word [rdx + 8]
lea rbx, [rdx + 8]
cmp r9w, 0xffff
jne 0x59acb8
jmp 0x59ad54
add rbx, 8
movsx r9d, word [rbx]
cmp r9w, 0xffff
je 0x59ad50
mov edx, dword [rsi + 4]
cmp r9d, edx
jle 0x59aca5
movsxd rax, dword [rbx + 4]
mov r8, qword [r14 + 0x28]
mov r13d, 1
mov rcx, rax
shr rax, 5
mov eax, dword [r8 + rax*4]
bt eax, ecx
jb 0x59aca5
mov r8, qword [rsp + 0xb0]
mov rcx, qword [rsp + 0x90]
call fcn.0059aa10
test eax, eax
je 0x59aca5
movsxd rax, dword [rbx + 4]
mov rdx, qword [r14 + 0x28]
mov r11d, r13d
mov r15d, 1
mov rcx, rax
shr rax, 5
shl r11d, cl
or dword [rdx + rax*4], r11d
mov rdx, qword [rsi + 0x20]
movsxd rax, dword [rbx + 4]
cmp eax, dword [rsi + 0x10]
mov rax, qword [rdx + rax*8]
cmove ebp, r13d
cmp word [rax], 0
mov eax, 0
cmove r12d, eax
add rbx, 8
movsx r9d, word [rbx]
cmp r9w, 0xffff
jne 0x59acb8
nop dword [rax]
mov eax, dword [r14 + 8]
lea edx, [rdi + 1]
add rdi, 1
cmp eax, edx
jg 0x59ac71
test r15d, r15d
jne 0x59ac64
mov edx, dword [rsp + 0x3c]
mov r15, r14
test edx, edx
je 0x59ab4c
mov ebx, dword [r15 + 0x10]
mov rsi, qword [r15 + 0x28]
cmp ebx, 1
je 0x59aef1
test ebx, ebx
jle 0x59aef9
lea edx, [rbx - 1]
mov rax, rsi
xor r10d, r10d
lea rdx, [rdx*4 + 4]
add rdx, rsi
nop dword [rax + rax]
xor r10d, dword [rax]
add rax, 4
cmp rax, rdx
jne 0x59adb0
mov edi, dword [r15 + 4]
mov r14, qword [r15 + 0x18]
cmp edi, 0
jle 0x59af01
movsxd rax, ebx
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x3c], r12d
shl rax, 2
mov ebp, edi
mov r12d, r10d
mov rdi, rsi
mov rsi, rax
jmp 0x59adf9
add r14, 0x38
sub ebp, 1
je 0x59ae74
cmp r12d, dword [r14 + 8]
jne 0x59adf0
cmp ebx, 1
je 0x59ae16
mov rdx, qword [r14]
mov r8, rsi
mov rcx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x59adf0
test r13d, r13d
mov qword [rsp + 0x28], r14
jne 0x59ab4c
mov rax, qword [rsp + 0xa0]
mov rsi, qword [rsp + 0x30]
mov rdi, r14
mov rax, qword [rax + 0x28]
mov qword [rax + rsi*8], r14
mov rax, rsi
mov rsi, qword [rsp + 0xa0]
shl rax, 4
mov rbx, qword [r14 + 0x18]
mov rcx, qword [r14 + 0x10]
add rax, qword [rsi + 0x30]
mov qword [rax], rcx
mov qword [rax + 8], rbx
movzx eax, word [rsp + 0xa8]
mov qword [rdi + 0x10], rsi
mov word [r14 + 0x18], ax
jmp 0x59ab4c
mov r10d, r12d
mov ebp, dword [rsp + 0x28]
mov r12d, dword [rsp + 0x3c]
mov r9, qword [rsp + 0xb8]
mov r8, qword [rsp + 0xb0]
mov rdx, r15
mov rcx, qword [rsp + 0x90]
mov dword [rsp + 0x28], r10d
call fcn.0059a2f0
mov r14, rax
mov eax, dword [r15 + 0x10]
mov r10d, dword [rsp + 0x28]
test eax, eax
jle 0x59aed2
mov r8, qword [r14]
mov rcx, qword [r15 + 0x28]
xor eax, eax
mov edx, dword [rcx + rax*4]
mov dword [r8 + rax*4], edx
lea edx, [rax + 1]
add rax, 1
cmp dword [r15 + 0x10], edx
jg 0x59aebe
cmp ebp, 1
mov dword [r14 + 8], r10d
sbb eax, eax
not eax
and eax, 2
test r12d, r12d
je 0x59aee8
or eax, 8
mov dword [r14 + 0xc], eax
jmp 0x59ae16
mov r10d, dword [rsi]
jmp 0x59adbc
xor r10d, r10d
jmp 0x59adbc
jne 0x59ae16
jmp 0x59ae80