Function at 0x180017bc0
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, 0x20
xor esi, esi
cmp dword [0x1800534d8], 3
lea r8d, [rsi + 2]
mov r12d, esi
mov ebp, r8d
jg 0x180017bfb
call fcn.180017978
jmp 0x180017e95
mov edi, dword [0x1800534dc]
mov ebx, dword [0x1800a4b78]
lea r13, [0x180070200]
mov r15d, 1
test edi, edi
je 0x180017e75
lea r9, [0x180084a40]
mov r14d, dword [0x1800a4b70]
lea eax, [rbx + 2]
mov dword [0x1800a4b68], ebp
movzx edx, byte [rax + r13]
mov eax, dword [0x1800534e4]
mov r13d, ebp
shl eax, 5
mov ebp, r8d
xor edx, eax
mov eax, ebx
and edx, 0x7fff
and eax, 0x7fff
mov ecx, edx
mov dword [0x1800534e4], edx
movzx edx, word [r9 + rdx*2 + 0x10000]
mov word [r9 + rax*2], dx
mov word [r9 + rcx*2 + 0x10000], bx
test edx, edx
je 0x180017cb4
cmp r13d, dword [0x1800534e0]
jae 0x180017cb4
mov eax, ebx
sub eax, edx
cmp eax, 0x7efa
ja 0x180017cb4
mov ecx, edx
call fcn.1800176e4
cmp eax, edi
mov ebp, eax
cmova ebp, edi
cmp ebp, 3
jne 0x180017cb4
mov ecx, ebx
lea eax, [rbp - 1]
sub ecx, dword [0x1800a4b70]
cmp ecx, 0x1000
cmova ebp, eax
cmp r13d, 3
jb 0x180017da7
cmp ebp, r13d
ja 0x180017da7
sub ebx, r14d
lea edx, [r13 - 3]
sub ebx, r15d
mov ecx, ebx
call fcn.180018a48
mov r8d, dword [0x1800a4b68]
mov edi, dword [0x1800534dc]
mov ebx, dword [0x1800a4b78]
mov ecx, r15d
mov r11d, eax
sub ecx, r8d
lea r13, [0x180070200]
lea r10, [0x180084a40]
add edi, ecx
lea r9d, [rbx + 2]
mov ebp, 0x7fff
mov dword [0x1800534dc], edi
add r8d, 0xfffffffe
mov eax, dword [0x1800534e4]
add ebx, r15d
add r9d, r15d
movzx edx, byte [r9 + r13]
shl eax, 5
mov ecx, ebx
xor edx, eax
and rcx, rbp
and edx, ebp
dec r8d
movzx eax, word [r10 + rdx*2 + 0x10000]
mov dword [0x1800534e4], edx
mov word [r10 + rcx*2], ax
mov word [r10 + rdx*2 + 0x10000], bx
jne 0x180017d17
add ebx, r15d
mov dword [0x1800a4b68], r8d
mov r12d, esi
lea ebp, [r8 + 2]
mov dword [0x1800a4b78], ebx
test r11d, r11d
je 0x180017e1d
mov edx, dword [0x1800a4b74]
mov rcx, rsi
lea rax, [r13 + rdx]
sub ebx, edx
test edx, edx
cmovns rcx, rax
mov edx, ebx
call fcn.180019008
mov ebx, dword [0x1800a4b78]
mov edi, dword [0x1800534dc]
mov dword [0x1800a4b74], ebx
jmp 0x180017e1d
lea r13, [0x180070200]
test r12d, r12d
je 0x180017e09
lea eax, [rbx - 1]
xor ecx, ecx
movzx edx, byte [rax + r13]
call fcn.180018a48
test eax, eax
je 0x180017dfb
mov r8d, dword [0x1800a4b74]
mov edx, dword [0x1800a4b78]
mov rcx, rsi
lea rax, [r13 + r8]
sub edx, r8d
test r8d, r8d
cmovns rcx, rax
xor r8d, r8d
call fcn.180019008
mov ebx, dword [0x1800a4b78]
mov dword [0x1800a4b74], ebx
jmp 0x180017e01
mov ebx, dword [0x1800a4b78]
mov edi, dword [0x1800534dc]
jmp 0x180017e0c
mov r12d, r15d
add ebx, r15d
dec edi
mov dword [0x1800534dc], edi
mov dword [0x1800a4b78], ebx
mov r14d, 0x106
cmp edi, r14d
jae 0x180017e46
cmp dword [0x1800534d4], esi
jne 0x180017e40
call fcn.180017858
mov edi, dword [0x1800534dc]
cmp edi, r14d
jb 0x180017e28
mov ebx, dword [0x1800a4b78]
mov r8d, 2
lea r9, [0x180084a40]
test edi, edi
jne 0x180017c23
test r12d, r12d
je 0x180017e75
lea eax, [rbx - 1]
xor ecx, ecx
movzx edx, byte [rax + r13]
call fcn.180018a48
mov ebx, dword [0x1800a4b78]
mov edx, dword [0x1800a4b74]
mov r8d, r15d
lea rax, [r13 + rdx]
sub ebx, edx
test edx, edx
cmovns rsi, rax
mov edx, ebx
mov rcx, rsi
call fcn.180019008
mov rbx, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x60]
add rsp, 0x20
pop r15
pop r14
pop r13
pop r12
pop rdi
ret