Function at 0x140039ac0
Capabilities:
Encode data using xor

Disassembly:
sub rsp, 0xa8
test edx, edx
je 0x140039ab7
mov eax, dword [rcx + 0x71c0]
cmp eax, 2
jne 0x140039a8e
add rsp, 0xa8
jmp 0x140039ac0
cmp eax, 3
jne 0x140039ab7
mov r8d, edx
mov rdx, rcx
lea rcx, [rsp + 0x20]
call fcn.140039260
lea rcx, [rsp + 0x20]
call fcn.1400393c0
lea rcx, [rsp + 0x20]
call fcn.140038e3c
add rsp, 0xa8
ret
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x11b0]
mov eax, 0x12b0
call fcn.14005cbe0
sub rsp, rax
mov rax, qword [0x14008b948]
xor rax, rsp
mov qword [rbp + 0x11a0], rax
mov ebx, edx
mov rdi, rcx
mov ecx, 0x91
call fcn.1400011dc
mov rax, qword [rdi + 0x1bf0]
mov qword [rsp + 0x40], rax
mov byte [rdi + 0x71cb], 1
mov rax, qword [rdi]
mov edx, dword [rdi + 0x26c0]
add rdx, qword [rdi + 0x71d0]
xor r8d, r8d
mov rcx, rdi
mov rax, qword [rax + 0x20]
call qword [case.0x1400440b7.0]
xor r13d, r13d
mov byte [rsp + 0x20], r13b
xor r9d, r9d
xor r8d, r8d
lea edx, [r13 + 1]
mov rcx, rdi
call fcn.14000c190
mov rax, qword [rdi]
lea r14d, [r13 + 2]
mov r8d, r14d
xor edx, edx
mov rcx, rdi
mov rax, qword [rax + 0x20]
call qword [case.0x1400440b7.0]
mov rax, qword [rdi]
mov rcx, rdi
mov rax, qword [rax + 0x28]
call qword [case.0x1400440b7.0]
mov rsi, rax
mov qword [rsp + 0x38], rax
mov rdx, rax
mov ecx, ebx
call fcn.14003a0a0
mov r12d, eax
mov dword [rsp + 0x34], eax
mov r15d, r13d
lea rcx, [rdi + 0x4ad0]
lea edx, [r13 + 0x14]
call fcn.1400290e8
mov byte [rdi + 0x4ae0], 1
lea rcx, [rdi + 0x5b48]
mov edx, r14d
call fcn.140028e04
mov dword [rsp + 0x28], r13d
lea rax, [0x14007791c]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140008354
mov rax, qword [rdi]
xor r8d, r8d
xor edx, edx
mov rcx, rdi
mov rax, qword [rax + 0x20]
call qword [case.0x1400440b7.0]
mov r14d, r13d
mov ebx, r13d
mov qword [rsp + 0x50], r13
mov qword [rsp + 0x58], r13
mov qword [rsp + 0x60], r13
mov qword [rsp + 0x68], r13
mov eax, r12d
shl eax, 9
cdqe
mov qword [rsp + 0x48], rax
mov rdx, rax
lea rcx, [rsp + 0x50]
call fcn.140007fe4
nop
mov r8, qword [rsp + 0x58]
xor edx, edx
mov r13, qword [rsp + 0x50]
mov rcx, r13
call fcn.14005f2d0
mov dword [rsp + 0x30], 0xfffffff
jmp 0x140039d90
call fcn.14004e35c
mov ecx, 0x200
cmp rsi, rcx
jae 0x140039c73
movsxd r12, esi
mov r8d, ecx
sub r8, r12
lea rcx, [rbp - 0x60]
add rcx, r12
xor edx, edx
call fcn.14005f2d0
xor esi, esi
jmp 0x140039c79
mov r12d, ecx
sub rsi, rcx
mov rax, qword [rdi]
movsxd r8, r12d
lea rdx, [rbp - 0x60]
mov rcx, rdi
mov rax, qword [rax + 0x18]
call qword [case.0x1400440b7.0]
mov ecx, r14d
shl ecx, 9
add rcx, r13
lea rdx, [rbp - 0x60]
sub rdx, rcx
mov r8d, 0x200
mov al, byte [rcx + rdx]
xor byte [rcx], al
inc rcx
sub r8, 1
jne 0x140039ca6
mov r8d, 0x200
lea rdx, [rbp - 0x60]
or ecx, 0xffffffff
call fcn.140019d84
mov byte [rbp + rbx + 0x1a0], al
inc ebx
shr eax, 8
mov byte [rbp + rbx + 0x1a0], al
inc ebx
mov r12d, 0x1000
cmp ebx, r12d
jne 0x140039d50
mov rax, qword [rdi]
mov rcx, rdi
mov rax, qword [rax + 0x28]
call qword [case.0x1400440b7.0]
mov rbx, rax
mov rcx, qword [rdi]
mov rax, qword [rcx + 0x20]
xor edx, edx
lea r8d, [rdx + 2]
mov rcx, rdi
call qword [case.0x1400440b7.0]
mov r8d, r12d
lea rdx, [rbp + 0x1a0]
mov rcx, rdi
call fcn.140025054
mov rcx, qword [rdi]
mov rax, qword [rcx + 0x20]
xor r8d, r8d
mov rdx, rbx
mov rcx, rdi
call qword [case.0x1400440b7.0]
mov r8d, r12d
lea rdx, [rbp + 0x1a0]
mov ecx, dword [rsp + 0x30]
call fcn.140019d84
mov dword [rsp + 0x30], eax
xor ebx, ebx
test r15b, r15b
jne 0x140039d7b
mov rax, qword [rsp + 0x40]
cmp byte [rax + 0x7054], r15b
jne 0x140039d7b
mov rdx, r15
shl rdx, 9
mov r8, qword [rsp + 0x38]
lea rcx, [0x140077924]
call fcn.14005021c
inc r15
lea eax, [r14 + 1]
mov r12d, dword [rsp + 0x34]
cmp eax, r12d
sbb r14d, r14d
and r14d, eax
test rsi, rsi
jg 0x140039c49
mov rax, qword [rdi]
mov r14d, 2
mov r8d, r14d
xor edx, edx
mov rcx, rdi
mov rax, qword [rax + 0x20]
call qword [case.0x1400440b7.0]
mov r8, rbx
lea rdx, [rbp + 0x1a0]
mov rcx, rdi
call fcn.140025054
mov r8, rbx
lea rdx, [rbp + 0x1a0]
mov ecx, dword [rsp + 0x30]
call fcn.140019d84
mov ebx, eax
mov rsi, qword [rsp + 0x48]
mov r8, rsi
mov rdx, r13
mov rcx, rdi
call fcn.140025054
mov r8, rsi
mov rdx, r13
mov ecx, ebx
call fcn.140019d84
mov dword [rdi + 0x5b48], r14d
not eax
mov dword [rdi + 0x5b4c], eax
mov rax, qword [rdi]
xor r8d, r8d
mov rdx, qword [rsp + 0x38]
mov rcx, rdi
mov rax, qword [rax + 0x20]
call qword [case.0x1400440b7.0]
lea rcx, [rsp + 0x70]
call fcn.14003bffc
nop
lea r8d, [r14 + 6]
lea rdx, [0x140077928]
lea rcx, [rsp + 0x70]
call fcn.14003c210
movsxd rdx, r12d
lea rcx, [rsp + 0x70]
call fcn.14003c15c
mov rdx, r15
lea rcx, [rsp + 0x70]
call fcn.14003c1e0
lea rdx, [rdi + 0x5af8]
lea rcx, [rsp + 0x70]
call fcn.14003c02c
lea r8, [rsi + r15*2]
and dword [rsp + 0x28], 0
lea rax, [0x140077934]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor edx, edx
mov rcx, rdi
call fcn.140008354
mov rax, qword [rdi]
mov r8d, r14d
xor edx, edx
mov rcx, rdi
mov rax, qword [rax + 0x20]
call qword [case.0x1400440b7.0]
mov rax, qword [rsp + 0x40]
cmp byte [rax + 0x7054], 0
jne 0x140039ebe
lea rcx, [0x140077940]
call fcn.140019c3c
mov ecx, 0x92
call fcn.1400011dc
nop
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140039ed9
call fcn.14006235c
nop
test r13, r13
je 0x140039ee6
mov rcx, r13
call fcn.14006235c
mov rcx, qword [rbp + 0x11a0]
xor rcx, rsp
call fcn.14005cc40
mov rbx, qword [rsp + 0x1300]
add rsp, 0x12b0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret