Function at 0x180040e24
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x78
mov rbx, qword [rsp + 0xf0]
mov r13, rdx
movzx r10d, word [0x180222038]
mov ecx, 1
mov r11, qword [rsp + 0xe0]
sub r8d, ecx
movsxd r12, r8d
mov eax, 0x1006
movzx r8d, byte [0x180221fe9]
cdq
mov rdi, r9
mov qword [rsp + 0x58], r12
idiv dword [rbx + r8*4]
movsxd r15, eax
movsxd rax, dword [r9]
mov qword [rsp + 0x48], r15
movzx esi, word [r13 + rax*2]
movzx eax, word [r13 + 0x2df6]
or rsi, 0x1d66
or rax, r12
mov qword [rsp + 0xd8], rax
mov eax, dword [0x180222040]
sub eax, ecx
mov dword [0x180222040], eax
lea eax, [rax + rax*2]
movsxd rcx, eax
mov rax, qword [0x180222018]
mov edx, dword [rax + rcx*4]
imul edx, dword [r9 + 0x67ec]
movsxd rax, dword [0x18022203c]
movsxd rcx, dword [0x180221fc0]
mov r9d, dword [r9 + r11*4 - 4]
and r9d, 6
movsxd r14, edx
xor edx, edx
div qword [0x180222048]
mov qword [rsp + 0x30], r14
mov rbp, rax
mov qword [rsp + 0x38], rax
mov eax, 0x151e
cdq
idiv dword [rbx + rcx*4]
dec dword [rdi - 4]
mov r8, qword [rsi]
movsxd rbx, edx
movsxd rdx, dword [rdi - 4]
lea eax, [rdx + rdx*2]
movsxd rcx, eax
mov rax, qword [0x180222020]
mov rax, qword [rax + rcx*8]
movsxd rcx, dword [rdi + 0x6a94]
mov qword [rsp + 0xe0], rax
movsxd rax, dword [rdi + rdx*4 - 4]
xor edx, edx
mov qword [rsp + 0x50], rax
mov al, byte [r13 + 0x3cfc]
mov r13, qword [rsp + 0xe8]
add al, 0x2e
mov byte [rsp + 0xd0], al
mov rax, r12
or rax, rbx
add rax, rcx
div qword [0x180221fd0]
sub dx, word [r12 + r8*4]
mov word [r12 + r8*4], dx
mov r8d, dword [0x180221fc0]
movsxd rcx, dword [0x180222040]
lea eax, [r8 - 0x19f8]
xor eax, 0x1b85
cdq
idiv r10d
mov edx, 1
sub r8d, edx
add r9w, dx
mov dword [0x180221fc0], r8d
and word [r12 + rcx*2], r9w
add dword [0x180222040], edx
mov rdx, qword [rsi]
movzx ecx, ax
mov eax, dword [r13 + rdx*8]
and eax, ecx
mov rcx, qword [rsp + 0xc0]
imul eax, eax, 0xffe
mov qword [rsp + 0x20], 0x2dd
mov dword [r13 + rdx*4], eax
mov eax, 0xffff
add word [r14], ax
movzx eax, word [r14]
mov r8, qword [rsi]
movzx eax, byte [rcx + rax*2]
movsxd r10, dword [r13 + r8*4]
cdq
idiv dword [r11*4 + 0x13e8]
lea rax, [r8 + r8*2]
movsxd rcx, edx
mov rdx, qword [rsp + 0xe0]
imul r10, qword [rdx + rax*8]
mov rax, qword [0x180221fd8]
xor edx, edx
movzx r9d, word [rax + r8*2]
mov eax, 0x142
div rbx
or r9, 0x13de
mov rdx, r10
mov r8, rax
call fcn.1800412fc
movsxd rcx, eax
mov eax, dword [rdi]
add rdi, 4
add eax, eax
cdqe
mov qword [rsi + rax*8], rcx
movzx r10d, byte [0x180221fe9]
movsxd rax, ebp
cmp rax, qword [r10*8 + 0x5e1]
ja 0x1800412ce
mov r11, qword [rsp + 0xc0]
lea r13, [r13 + rax*4]
mov r9d, 0x13e8
mov qword [rsp + 0x40], r13
sub r9, qword [rsp + 0xe8]
lea r14, [rax + r15]
sub r11, r12
mov qword [rsp + 0x60], r9
mov qword [rsp + 0xc0], r11
lea r15, [r12 + rax*2]
mov rcx, qword [rsi]
mov rax, qword [0x180222050]
movzx r8d, byte [rcx + rax]
movsxd rax, dword [rdi]
lea rdi, [rdi + 4]
mov eax, dword [rax*4 + 0x1024]
cdq
idiv r8d
mov rdx, qword [rsp + 0xc8]
sub ax, word [r12 + r10*2]
mov word [r12 + r10*2], ax
mov eax, dword [0x180221fc0]
inc eax
mov dword [0x180221fc0], eax
add eax, 5
movzx r11d, byte [r11 + r15]
imul r11, qword [0x180222048]
movsxd rcx, eax
movsxd rax, dword [rdi]
movzx ecx, word [r12 + rcx*2]
movzx ebx, word [rdx + rax*2]
mov eax, dword [r9 + r13]
mov r9, qword [0x180221fd0]
cdq
idiv ebp
mov rax, qword [rsi]
movsxd r8, edx
lea r10, [rax + rax*2]
movzx eax, word [r12 + r10*2]
cdq
idiv ebp
mov edx, ebx
movsxd r10, eax
mov qword [rsp + 0x28], r10
mov qword [rsp + 0x20], r11
call fcn.180048074
movzx ecx, byte [0x180221fe9]
mov rdx, qword [rsp + 0xe8]
mov r8, qword [rsp + 0x48]
mov dword [rdi + rcx*4], eax
movsxd rax, dword [rdi]
mov ecx, dword [rdi + rax*4]
movsxd rax, dword [0x180221fc0]
or ecx, ebp
or ecx, dword [0x180221fd0]
sub ecx, dword [rdx + rax*4]
mov dword [r13], ecx
mov eax, dword [rdi]
mov rcx, qword [rsp + 0xc8]
add eax, 0x15
movsxd rdx, eax
mov rax, qword [rsi]
mov cl, byte [rcx + rax*2]
sub cl, byte [rdx + r8]
mov byte [rdx + r8], cl
movzx ecx, byte [0x180221fe9]
mov rdx, qword [rsp + 0x50]
mov eax, ecx
add eax, eax
movzx ebx, byte [rax + rdx]
mov rax, qword [rsp + 0xd8]
cmp ebx, dword [rax + 0x3e54]
jne 0x180041290
mov r12, qword [rsp + 0x30]
lea r13, [r8 + rbx]
mov rbp, qword [rsp + 0xe8]
movsxd r9, dword [rdi]
xor edx, edx
mov r8, qword [0x180221ff8]
movzx eax, word [r15]
movzx ecx, word [r8 + r9*2]
div ecx
mov word [r8 + r9*2], dx
mov rcx, qword [rsi]
sub rsi, 8
mov rax, qword [0x180222030]
mov r9, qword [rsp + 0xe0]
movsxd r8, dword [rbp + rcx*4]
mov eax, dword [rax + rcx*4]
movzx r10d, word [r12 + rcx*2]
cdq
idiv dword [0x18022203c]
movzx ecx, byte [r13]
movsxd rdx, eax
movzx eax, byte [0x180221fe9]
add r8, qword [r9 + rax*8]
movzx eax, word [0x180222038]
movzx r9d, word [r12 + 0x18b6]
mov qword [rsp + 0x28], rax
xor r9, 0x192b
mov qword [rsp + 0x20], r10
call fcn.180048074
movzx ecx, word [r12]
xor edx, edx
sub r12, 2
movsxd rax, dword [rdi + rcx*8]
lea rcx, [rcx + rcx*2]
add rax, qword [rsi + rcx*8]
movzx ecx, byte [r14]
div rcx
mov rax, qword [rsp + 0xd8]
mov byte [r14], dl
mov edx, 1
add ebx, edx
add r13, rdx
cmp ebx, dword [rax + 0x3e54]
je 0x1800411b6
mov cl, byte [0x180221fe9]
mov rbp, qword [rsp + 0x38]
mov r13, qword [rsp + 0x40]
mov qword [rsp + 0x30], r12
mov r12, qword [rsp + 0x58]
jmp 0x180041295
mov edx, 1
mov r9, qword [rsp + 0x60]
add ebp, edx
mov r11, qword [rsp + 0xc0]
add r13, 4
movzx r10d, cl
add r15, 2
add r14, rdx
movsxd rcx, ebp
mov qword [rsp + 0x38], rbp
mov qword [rsp + 0x40], r13
cmp rcx, qword [r10*8 + 0x5e1]
jbe 0x180041098
mov rdx, qword [rsp + 0xf0]
mov rax, qword [rsi]
movzx ecx, byte [rsp + 0xd0]
mov eax, dword [rdx + rax*4 + 4]
cdq
idiv ecx
add rsp, 0x78
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret