Function at 0x180037b50
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov eax, 0x1040
call fcn.180099ce0
sub rsp, rax
mov rax, qword [0x18019bca8]
xor rax, rsp
mov qword [rsp + 0x1030], rax
mov edi, dword [rsp + 0x10a0]
xor r15d, r15d
mov esi, dword [rsp + 0x10a8]
mov rbp, r9
mov dword [rsp + 0x20], r15d
mov r13, r8
movzx r14d, dl
mov ebx, 0xffffffff
mov r12d, r15d
test dl, 8
je 0x180037c11
mov r8d, r15d
mov r9d, r15d
mov ebx, r15d
mov r11d, r15d
cmp edi, 2
jb 0x180037bf2
lea eax, [rdi - 2]
shr eax, 1
lea rcx, [rbp + 1]
inc eax
mov r10d, eax
lea r11d, [rax + rax]
nop
movsx eax, byte [rcx - 1]
lea rcx, [rcx + 2]
cdq
xor eax, edx
sub eax, edx
add r8d, eax
movsx eax, byte [rcx - 2]
cdq
xor eax, edx
sub eax, edx
add r9d, eax
sub r10, 1
jne 0x180037bd0
cmp r11d, edi
jae 0x180037c05
mov eax, r11d
movsx eax, byte [rax + rbp]
cdq
mov ebx, eax
xor ebx, edx
sub ebx, edx
lea ecx, [r9 + r8]
add ebx, ecx
je 0x180037f2b
cmp edi, esi
jbe 0x180037c9a
test r14b, 0x10
je 0x1800ae470
mov r8d, r15d
mov r9d, r15d
test esi, esi
je 0x180037c4b
mov rcx, rbp
cmp r9d, edi
jae 0x180037c7e
movsx eax, byte [rcx]
inc r9d
cdq
inc rcx
xor eax, edx
sub eax, edx
add r8d, eax
cmp r9d, esi
jb 0x180037c30
cmp r9d, edi
jae 0x180037c7e
mov eax, r9d
lea r10, [rax + rbp]
cmp r8d, ebx
jae 0x180037c9a
movzx ecx, byte [r10]
mov eax, r9d
sub eax, esi
inc r9d
inc r10
sub cl, byte [rax + rbp]
movsx eax, cl
cdq
xor eax, edx
sub eax, edx
add r8d, eax
cmp r9d, edi
jb 0x180037c57
cmp r8d, ebx
jae 0x180037c9a
mov r12d, 1
mov ebx, r8d
mov dword [rsp + 0x20], r12d
test r8d, r8d
je 0x180037db2
test r13, r13
je 0x180037f3d
test r14b, 0x20
je 0x1800ae487
mov r8d, r15d
mov r9d, r15d
test edi, edi
je 0x180037ce2
mov r10, rbp
mov rcx, r13
sub r10, r13
cmp r8d, ebx
jae 0x180037cfe
movzx eax, byte [r10 + rcx]
inc r9d
sub al, byte [rcx]
inc rcx
movsx eax, al
cdq
xor eax, edx
sub eax, edx
add r8d, eax
cmp r9d, edi
jb 0x180037cc0
cmp r8d, ebx
jae 0x180037cfe
mov r12d, 2
mov ebx, r8d
mov dword [rsp + 0x20], r12d
test r8d, r8d
je 0x180037db2
test r14b, 0x40
je 0x180037da0
mov r8d, r15d
mov r9d, r15d
test esi, esi
je 0x180037d43
mov r11, r13
mov r10, rbp
sub r11, rbp
cmp r9d, edi
jae 0x180037d88
movzx eax, byte [r10]
inc r9d
movzx ecx, byte [r11 + r10]
inc r10
shr cl, 1
sub al, cl
movsx eax, al
cdq
xor eax, edx
sub eax, edx
add r8d, eax
cmp r9d, esi
jb 0x180037d1b
cmp r9d, edi
jae 0x180037d88
mov eax, r9d
mov r11, r13
sub r11, rbp
lea r10, [rax + rbp]
cmp r8d, ebx
jae 0x180037da0
mov eax, r9d
inc r9d
sub eax, esi
movzx ecx, byte [rax + rbp]
movzx eax, byte [r10 + r11]
add ecx, eax
movzx eax, byte [r10]
shr ecx, 1
inc r10
sub al, cl
movsx eax, al
cdq
xor eax, edx
sub eax, edx
add r8d, eax
cmp r9d, edi
jb 0x180037d55
cmp r8d, ebx
jae 0x180037da0
mov r12d, 3
mov ebx, r8d
mov dword [rsp + 0x20], r12d
test r8d, r8d
je 0x180037db2
cmp edi, esi
jbe 0x180037db2
test r14b, r14b
jns 0x180037db2
mov eax, edi
shl eax, 4
cmp ebx, eax
ja 0x180037de1
movzx eax, r12b
mov rcx, qword [rsp + 0x1030]
xor rcx, rsp
call fcn.18008b970
mov rbx, qword [rsp + 0x1080]
add rsp, 0x1040
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
cmp esi, 0x1000
ja 0x180037f2b
mov r8, rsi
lea rcx, [rsp + 0x30]
mov rdx, rbp
call sub.msvcrt.dll_memcpy
lea eax, [rsi - 1]
movsxd rdx, eax
test eax, eax
js 0x180037e27
lea rax, [rsp + 0x30]
mov r8, r13
sub r8, rax
lea rcx, [rsp + 0x30]
add rcx, rdx
movzx eax, byte [rcx + r8]
sub byte [rcx], al
sub rdx, 1
jns 0x180037e12
sub edi, esi
add r13, rsi
add rbp, rsi
mov qword [rsp + 0x28], r13
mov r8d, r15d
mov r9d, r15d
mov ecx, r15d
lea r14d, [rdi*4]
cmp esi, 2
jb 0x180037e80
lea eax, [rsi - 2]
shr eax, 1
lea r11, [rsp + 0x31]
inc eax
mov r10d, eax
lea ecx, [rax + rax]
movsx eax, byte [r11 - 1]
lea r11, [r11 + 2]
cdq
xor eax, edx
sub eax, edx
add r8d, eax
movsx eax, byte [r11 - 2]
cdq
xor eax, edx
sub eax, edx
add r9d, eax
sub r10, 1
jne 0x180037e5c
cmp ecx, esi
jb 0x180037f17
lea eax, [r9 + r8]
add r14d, eax
test edi, edi
je 0x180037f08
mov r13d, 0x1000
sub r13, rsi
mov eax, edi
mov r15d, edi
cmp rax, r13
ja 0x1800ae49d
mov rdx, rbp
lea r8d, [rsi + r15]
sub rdx, rsi
lea rcx, [rsp + 0x30]
call sub.msvcrt.dll_memcpy
mov rdx, qword [rsp + 0x28]
lea rax, [rsp + 0x30]
add rax, rsi
mov r9d, esi
mov rcx, rax
mov r8d, r15d
call fcn.18005fd84
xor r8d, r8d
test r15d, r15d
je 0x180037eff
cmp r14d, ebx
jae 0x180037eff
lea eax, [rsi + r8]
inc r8d
movsx eax, byte [rsp + rax + 0x30]
cdq
xor eax, edx
sub eax, edx
add r14d, eax
cmp r8d, r15d
jb 0x180037ee1
sub edi, r15d
jne 0x1800ae4ab
cmp r14d, ebx
jb 0x180037f32
mov r12d, dword [rsp + 0x20]
jmp 0x180037db2
mov eax, ecx
movsx eax, byte [rsp + rax + 0x30]
cdq
xor eax, edx
sub eax, edx
add r14d, eax
jmp 0x180037e88
xor al, al
jmp 0x180037db6
mov r12d, 4
jmp 0x180037db2
cmp edi, esi
jbe 0x180037db2
test r14b, 0x40
je 0x180037db2
mov r8d, r15d
test esi, esi
je 0x180037f78
mov rcx, rbp
cmp r8d, edi
jae 0x1800ae4c4
movsx eax, byte [rcx]
inc r8d
cdq
inc rcx
xor eax, edx
sub eax, edx
add r15d, eax
cmp r8d, esi
jb 0x180037f59
cmp r8d, edi
jae 0x1800ae4c4
mov eax, r8d
lea r9, [rax + rbp]
nop dword [rax + rax]
cmp r15d, ebx
jae 0x180037db2
mov eax, r8d
inc r8d
sub eax, esi
movzx ecx, byte [rax + rbp]
movzx eax, byte [r9]
inc r9
shr cl, 1
sub al, cl
movsx eax, al
cdq
xor eax, edx
sub eax, edx
add r15d, eax
cmp r8d, edi
jb 0x180037f90
jmp 0x1800ae4c4
test r14b, r14b
jns 0x180037c9a
test r13, r13
jne 0x180037ca3
jmp 0x180037c23
cmp edi, esi
ja 0x180037cfe
test r14b, r14b
jns 0x180037cfe
jmp 0x180037cad
mov r15d, 0x1000
sub r15d, esi
jmp 0x180037eaa
cmp r14d, ebx
jae 0x180037f0d
mov eax, r15d
add rbp, rax
add qword [rsp + 0x28], rax
jmp 0x180037e9c
mov ecx, r12d
cmp r15d, ebx
mov r12d, 3
cmovb ecx, r12d
mov r12d, ecx
jmp 0x180037db2