Function at 0x1800396e0
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov r13d, r9d
movaps xmmword [rsp + 0x50], xmm6
imul eax, r13d, 0x42e
mov r9, r8
mov r14, rdx
mov rbp, rcx
mov esi, r13d
mov dword [rsp + 0x40], eax
cmp r13d, eax
ja 0x1800397fe
movzx r8d, byte [rsp + 0xb8]
mov ecx, 0x7fff
mov r10d, dword [0x18007b110]
xor edx, edx
mov r12d, dword [rsp + 0xb8]
mov r15d, dword [rsp + 0xb8]
mov edi, dword [rsp + 0xb8]
mov ebx, dword [rsp + 0xb8]
mov dword [rsp + 0x30], r8d
nop dword [rax + rax]
cmp esi, 0xc1b4
ja 0x180039a23
je 0x180039a0e
mov eax, esi
sub eax, 0x9a
je 0x1800398d2
sub eax, 0x54
je 0x180039848
sub eax, 0x400a
je 0x180039822
sub eax, 0x2370
je 0x1800397bd
cmp eax, 0x1cee
jne 0x1800397ee
mov rax, qword [r14]
movzx edx, byte [rsp + 0xb8]
movsxd rcx, r15d
mov byte [rcx + rax - 1], dl
mov rax, qword [r14]
mov byte [rcx + rax - 2], r8b
jmp 0x1800397e7
mov rdx, qword [rsp + 0x38]
mov r8d, 0xa9
mov rcx, rbp
call fcn.180023b90
mov r12d, eax
mov r9, qword [rsp + 0xb0]
mov r10d, dword [0x18007b110]
mov r8d, dword [rsp + 0x30]
mov ecx, 0x7fff
xor edx, edx
imul eax, r13d, 0x6b
add esi, eax
cmp esi, dword [rsp + 0x40]
jbe 0x180039760
mov eax, dword [rsp + 0xb8]
mov rbx, qword [rsp + 0xa0]
movaps xmm6, xmmword [rsp + 0x50]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
cmp edi, ecx
cmovg edi, ecx
cmp ebx, ecx
mov eax, edi
mov byte [rsp + 0xb8], dil
cdq
cmovg ebx, ecx
movzx edx, dl
add eax, edx
sar eax, 8
mov r8d, eax
mov dword [rsp + 0x30], eax
jmp 0x1800397ec
cmp dword [rbp + 0x12f4], 0
mov r12d, edx
je 0x180039aa6
mov eax, dword [r9]
lea r8, [rsp + 0x38]
mov rdx, r14
mov dword [rsp + 0x38], eax
mov ecx, 0xa2
call fcn.180011080
movsxd rdx, dword [rbp + 0x12f4]
mov qword [rsp + 0x38], rax
cmp rdx, 0x480
jge 0x1800397d3
mov ecx, 0x480
lea rax, [rbp + 0xf4]
sub rcx, rdx
lea rax, [rax + rdx*2]
xor edx, edx
nop
mov word [rax + 0x900], dx
mov word [rax], dx
lea rax, [rax + 2]
sub rcx, 1
jne 0x1800398a0
mov r8d, dword [rsp + 0x30]
mov ecx, 0x7fff
mov r9, qword [rsp + 0xb0]
mov r10d, dword [0x18007b110]
jmp 0x1800397ee
mov eax, dword [r14 + 0xc]
lea rcx, [rbp + 0x9f4]
cdq
mov ebx, 0xffffffff
and edx, 7
mov edi, ebx
lea r15d, [rdx + rax]
sar r15d, 3
cmp r10d, 2
jl 0x1800399cf
movdqa xmm3, xmmword [0x18005e970]
add rcx, 8
movdqa xmm5, xmm3
movdqa xmm6, xmm3
movdqa xmm4, xmm3
mov eax, 0x90
nop word [rax + rax]
movq xmm0, qword [rcx - 0x908]
lea rcx, [rcx + 0x10]
pmovsxwd xmm1, xmm0
movq xmm0, qword [rcx - 0x18]
pabsd xmm2, xmm1
pmaxsd xmm4, xmm2
pmovsxwd xmm1, xmm0
movq xmm0, qword [rcx - 0x910]
pabsd xmm2, xmm1
pmaxsd xmm3, xmm2
pmovsxwd xmm1, xmm0
movq xmm0, qword [rcx - 0x10]
pabsd xmm2, xmm1
pmaxsd xmm6, xmm2
pmovsxwd xmm1, xmm0
pabsd xmm2, xmm1
pmaxsd xmm5, xmm2
sub rax, 1
jne 0x180039920
pmaxsd xmm4, xmm6
pmaxsd xmm3, xmm5
movdqa xmm0, xmm4
psrldq xmm0, 8
pmaxsd xmm4, xmm0
movdqa xmm0, xmm4
psrldq xmm0, 4
pmaxsd xmm4, xmm0
movdqa xmm0, xmm3
psrldq xmm0, 8
pmaxsd xmm3, xmm0
movd edi, xmm4
movdqa xmm0, xmm3
psrldq xmm0, 4
pmaxsd xmm3, xmm0
movd ebx, xmm3
jmp 0x1800397e7
mov r8d, 0x480
nop word [rax + rax]
movsx eax, word [rcx - 0x900]
lea rcx, [rcx + 2]
cdq
xor eax, edx
sub eax, edx
cmp eax, edi
cmovg edi, eax
movsx eax, word [rcx - 2]
cdq
xor eax, edx
sub eax, edx
cmp eax, ebx
cmovg ebx, eax
sub r8, 1
jne 0x1800399e0
jmp 0x1800397e2
mov rax, qword [r14]
movsxd rcx, r15d
mov byte [rcx + rax - 3], 0
mov ecx, 0x7fff
jmp 0x1800397ee
cmp esi, 0xc7e2
je 0x180039a9b
cmp esi, 0x10212
je 0x180039a6e
cmp esi, 0x12b5c
je 0x180039a4f
cmp esi, 0x18ed6
jne 0x1800397ee
mov eax, r12d
jmp 0x180039805
mov qword [rsp + 0x20], rdx
xor r9d, r9d
lea rdx, [rsp + 0x38]
mov r8d, 0x111
xor ecx, ecx
call fcn.18001f5f0
jmp 0x1800397d3
cmp dword [rbp + 0x18], 3
je 0x1800397ee
mov rax, qword [r14]
movsxd r8, r15d
mov byte [r8 + rax - 4], bl
mov eax, ebx
cdq
movzx ecx, dl
add ecx, eax
mov rax, qword [r14]
sar ecx, 8
mov byte [r8 + rax - 5], cl
jmp 0x1800397e2
mov dword [rbp + 0x12f4], edx
jmp 0x1800397ee
mov eax, edx
jmp 0x180039805