Function at 0x1400591e8
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
mov ebx, dword [rsp + 0xb0]
mov rdi, rcx
mov ecx, dword [rcx + 0xe8]
mov r10d, ecx
movsxd rsi, r8d
xor r11d, r11d
sub r10d, dword [rsp + 0xa0]
xor r8d, r8d
mov rbp, rdx
mov edx, dword [rsp + 0xa8]
sub r10d, ebx
test r9d, r9d
jns 0x140059246
mov r8d, r9d
add edx, r9d
neg r8d
xor r9d, r9d
test r10d, r10d
jns 0x140059257
mov r11d, r10d
add ebx, r10d
neg r11d
xor r10d, r10d
mov r12d, dword [rdi + 0xe4]
lea eax, [r9 + rdx]
cmp eax, r12d
jle 0x14005926d
mov edx, r12d
sub edx, r9d
lea eax, [r10 + rbx]
cmp eax, ecx
jle 0x14005927a
mov ebx, ecx
sub ebx, r10d
test edx, edx
jle 0x1400595ac
test ebx, ebx
jle 0x1400595ac
test rbp, rbp
je 0x1400595ac
mov eax, dword [rdi + 0x13c]
test al, al
jns 0x1400592d2
mov eax, dword [rsp + 0xb8]
mov rcx, rdi
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x40], ebx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x30], r11d
mov dword [rsp + 0x28], r8d
mov rdx, rbp
mov r8d, esi
mov dword [rsp + 0x20], r10d
call fcn.140059014
jmp 0x1400595ac
test al, 2
je 0x140059347
movsxd r13, dword [rdi + 0x138]
lea eax, [r8 + r8*2]
movsxd r14, eax
mov eax, r13d
imul eax, r9d
imul r11d, esi
movsxd r15, eax
mov eax, r10d
movsxd r8, r11d
add r8, r14
imul eax, dword [rdi + 0x130]
add r8, rbp
movsxd rcx, eax
add rcx, r15
add rcx, qword [rdi + 0x128]
test edx, edx
jle 0x140059338
mov r9d, edx
mov al, byte [r8 + 2]
xor byte [rcx + 2], al
mov al, byte [r8 + 1]
xor byte [rcx + 1], al
mov al, byte [r8]
add r8, 3
xor byte [rcx], al
add rcx, r13
dec r9
jne 0x140059319
add r11d, esi
inc r10d
dec ebx
jne 0x1400592f2
jmp 0x1400595ac
cmp dword [rdi + 0x138], 4
jne 0x14005950f
bt eax, 8
jae 0x1400593d0
mov r12d, dword [rsp + 0xb8]
lea eax, [r8 + r8*2]
movsxd r13, eax
mov eax, r9d
shl eax, 2
movsxd r14, eax
imul r11d, esi
mov eax, r10d
movsxd r8, r11d
add r8, r13
imul eax, dword [rdi + 0x130]
add r8, rbp
movsxd rcx, eax
add rcx, r14
add rcx, qword [rdi + 0x128]
test edx, edx
jle 0x1400593c1
mov r9d, edx
mov al, byte [r8 + 2]
mov byte [rcx + 2], al
mov al, byte [r8 + 1]
mov byte [rcx + 1], al
mov al, byte [r8]
mov byte [rcx + 3], r12b
mov byte [rcx], al
add rcx, 4
add r8, 3
dec r9
jne 0x14005939d
add r11d, esi
inc r10d
dec ebx
jne 0x140059376
jmp 0x1400595ac
test al, 8
je 0x14005941f
mov eax, r9d
mov r9d, dword [rsp + 0xb8]
shl eax, 2
movsxd r11, eax
mov eax, dword [rdi + 0x130]
imul eax, r10d
movsxd rcx, eax
mov rax, qword [rdi + 0x128]
add rcx, r11
lea r8, [rcx + rax + 3]
test edx, edx
jle 0x140059413
mov eax, edx
mov byte [r8], r9b
add r8, 4
dec rax
jne 0x140059407
inc r10d
dec ebx
jne 0x1400593e5
jmp 0x1400595ac
test al, 0x10
je 0x14005942f
mov eax, dword [rsp + 0xb8]
jmp 0x1400594e1
test al, 0x20
mov eax, dword [rsp + 0xb8]
je 0x140059468
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x40], ebx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x30], r11d
mov dword [rsp + 0x28], r8d
mov rdx, rbp
mov r8d, esi
mov rcx, rdi
mov dword [rsp + 0x20], r10d
call fcn.140058de4
jmp 0x1400595ac
cmp eax, 0xff
jne 0x1400594d9
lea eax, [r8 + r8*2]
movsxd r12, eax
mov eax, r9d
shl eax, 2
movsxd r13, eax
imul r11d, esi
mov eax, dword [rdi + 0x130]
movsxd rcx, r11d
add rcx, r12
add rcx, rbp
imul eax, r10d
movsxd r8, eax
add r8, r13
add r8, qword [rdi + 0x128]
test edx, edx
jle 0x1400594ca
mov r9d, edx
mov al, byte [rcx + 2]
mov byte [r8 + 2], al
mov al, byte [rcx + 1]
mov byte [r8 + 1], al
mov al, byte [rcx]
add rcx, 3
mov byte [r8], al
add r8, 4
dec r9
jne 0x1400594aa
add r11d, esi
inc r10d
dec ebx
jne 0x140059483
jmp 0x1400595ac
test eax, eax
je 0x1400595ac
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x40], ebx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x30], r11d
mov dword [rsp + 0x28], r8d
mov rdx, rbp
mov r8d, esi
mov rcx, rdi
mov dword [rsp + 0x20], r10d
call fcn.140058c08
jmp 0x1400595ac
test al, 8
jne 0x1400595ac
mov eax, dword [rsp + 0xb8]
cmp eax, 0xff
jne 0x14005957f
imul r11d, esi
lea eax, [r8 + r8*2]
movsxd r12, eax
movsxd rcx, r11d
lea rax, [rcx + rbp]
add r12, rax
mov eax, dword [rdi + 0x130]
imul eax, r10d
movsxd rbp, eax
lea eax, [r9 + r9*2]
movsxd rcx, eax
lea eax, [rdx + rdx*2]
add rbp, rcx
movsxd r13, eax
add rbp, qword [rdi + 0x128]
mov r8, r13
mov rdx, r12
mov rcx, rbp
call sub.msvcrt.dll_memcpy
movsxd rax, dword [rdi + 0x130]
add r12, rsi
add rbp, rax
dec ebx
jne 0x14005955e
jmp 0x1400595ac
test eax, eax
je 0x1400595ac
mov dword [rsp + 0x48], eax
mov dword [rsp + 0x40], ebx
mov dword [rsp + 0x38], edx
mov dword [rsp + 0x30], r11d
mov dword [rsp + 0x28], r8d
mov rdx, rbp
mov r8d, esi
mov rcx, rdi
mov dword [rsp + 0x20], r10d
call fcn.140058998
lea r11, [rsp + 0x50]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret