Function at 0x18016f370
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x2f8
mov qword [rsp + 0x50], rcx
cmp rdx, 2
jb 0x18016fa0e
mov rdi, r8
mov r8, rdx
movabs rax, 0x3fffffffffffffff
add rax, rdx
mov rcx, rax
or rcx, rdx
shr rcx, 0x20
je 0x18016f3b8
xor edx, edx
div r8
jmp 0x18016f3bd
xor edx, edx
div r8d
mov qword [rsp + 0x70], rax
cmp r8, 0x1001
mov qword [rsp + 0x40], r9
mov qword [rsp + 0x60], r8
jae 0x18016f3ed
mov rax, r8
shr rax, 1
sub r8, rax
cmp r8, 0x40
mov eax, 0x40
cmovb rax, r8
jmp 0x18016f3fa
mov rcx, r8
call fcn.1801d4ab0
mov r9, qword [rsp + 0x40]
mov qword [rsp + 0x48], rax
mov rax, qword [rsp + 0x50]
lea rcx, [rax + 0xc]
mov qword [rsp + 0x90], rcx
add rax, 0xfffffffffffffff8
mov qword [rsp + 0x78], rax
mov r13d, 1
xor r15d, r15d
movabs r10, 0x1ffffffffffffffe
xor r14d, r14d
nop
mov rdx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x50]
lea rcx, [rax + r15*8]
mov rax, rdx
sub rax, r15
mov qword [rsp + 0x88], r15
mov qword [rsp + 0x58], rcx
jbe 0x18016f4e0
mov rsi, rax
cmp rax, qword [rsp + 0x48]
jb 0x18016f47c
mov rax, rsi
cmp rsi, 2
jae 0x18016f50b
xor r11d, r11d
cmp rax, qword [rsp + 0x48]
jae 0x18016f54a
cmp byte [rsp + 0x360], 0
je 0x18016f4f7
cmp rsi, 0x20
mov eax, 0x20
cmovae rsi, rax
mov rax, qword [rsp + 0x368]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov rdx, rsi
mov r8, rdi
mov r9, qword [rsp + 0x40]
call fcn.1801700b0
movabs r10, 0x1ffffffffffffffe
mov r9, qword [rsp + 0x40]
lea rsi, [rsi*2 + 1]
jmp 0x18016f699
xor edx, edx
mov r8d, 1
cmp r14, 2
jae 0x18016f6f0
jmp 0x18016f99e
mov rax, qword [rsp + 0x48]
cmp rax, rsi
cmovb rsi, rax
add rsi, rsi
jmp 0x18016f699
movzx edx, byte [rcx + 8]
cmp dl, byte [rcx]
jae 0x18016f586
mov r8, rax
mov eax, 2
mov r11b, 1
cmp r8, 2
je 0x18016f471
nop dword [rax + rax]
mov r8d, edx
movzx edx, byte [rcx + rax*8]
cmp dl, r8b
jae 0x18016f471
inc rax
cmp rsi, rax
jne 0x18016f530
jmp 0x18016f5bb
test r11b, r11b
je 0x18016f691
cmp rax, 2
jb 0x18016f691
mov r8, rax
shr r8, 1
lea rdx, [rcx + rax*8]
mov rcx, r8
lea r8, [r8*8]
sub rdx, r8
cmp rcx, 1
jne 0x18016f5c3
xor r8d, r8d
mov r12, r10
jmp 0x18016f63a
cmp rax, 2
jne 0x18016f596
mov eax, 2
jmp 0x18016f46e
mov eax, 2
nop dword [rax + rax]
mov r8d, edx
movzx edx, byte [rcx + rax*8]
cmp dl, r8b
jb 0x18016f46e
inc rax
cmp rsi, rax
jne 0x18016f5a0
xor r11d, r11d
mov rax, rsi
jmp 0x18016f471
mov r9, rcx
and r9, 0xfffffffffffffffe
mov r8, qword [rsp + 0x90]
mov r12, r10
lea r10, [r8 + r15*8]
lea r8, [rax + r15]
mov r11, qword [rsp + 0x78]
lea r11, [r11 + r8*8]
xor r8d, r8d
nop dword [rax]
movzx ebx, byte [r10 + r8*8 - 0xc]
mov esi, dword [r10 + r8*8 - 8]
mov r15, qword [r11]
mov qword [r10 + r8*8 - 0xc], r15
mov byte [r11], bl
mov dword [r11 + 4], esi
mov rsi, r8
xor rsi, r12
add rsi, rcx
movzx ebx, byte [r10 + r8*8 - 4]
mov ebp, dword [r10 + r8*8]
mov r15, qword [rdx + rsi*8]
mov qword [r10 + r8*8 - 4], r15
mov byte [rdx + rsi*8], bl
mov dword [rdx + rsi*8 + 4], ebp
add r8, 2
add r11, 0xfffffffffffffff0
cmp r9, r8
jne 0x18016f5f0
mov r11, rcx
test al, 2
mov r9, qword [rsp + 0x40]
mov r15, qword [rsp + 0x88]
mov r10, r12
mov rcx, qword [rsp + 0x58]
je 0x18016f691
mov r9, r8
not r9
mov rsi, r11
add rsi, r9
movzx r9d, byte [rcx + r8*8]
mov r10d, dword [rcx + r8*8 + 4]
mov r11, qword [rdx + rsi*8]
mov rcx, qword [rsp + 0x58]
mov qword [rcx + r8*8], r11
mov byte [rdx + rsi*8], r9b
mov r9, qword [rsp + 0x40]
mov dword [rdx + rsi*8 + 4], r10d
movabs r10, 0x1ffffffffffffffe
lea rsi, [rax*2 + 1]
mov rax, r13
shr rax, 1
mov r8, rsi
shr rsi, 1
lea rdx, [r15 + r15]
sub rdx, rax
lea rax, [rsi + r15*2]
mov rcx, qword [rsp + 0x70]
imul rdx, rcx
imul rax, rcx
xor rax, rdx
je 0x18016f6d5
bsr rdx, rax
xor rdx, 0x3f
cmp r14, 2
jae 0x18016f6f0
jmp 0x18016f99e
mov edx, 0x40
cmp r14, 2
jb 0x18016f99e
nop word cs:[rax + rax]
mov qword [rsp + 0x80], r8
mov rax, qword [rsp + 0x78]
lea rax, [rax + r15*8]
mov qword [rsp + 0x98], rax
mov qword [rsp + 0x68], rdx
jmp 0x18016f74f
mov rdx, rdi
mov r15, r13
sub r8, rdx
mov rcx, r15
call fcn.1801f0cd0
mov r9, qword [rsp + 0x40]
movabs r10, 0x1ffffffffffffffe
mov rdx, qword [rsp + 0x68]
lea r13, [rbp*2 + 1]
mov r15, qword [rsp + 0x88]
cmp r14, 1
jbe 0x18016f990
cmp byte [rsp + r14 + 0xa5], dl
jb 0x18016f996
dec r14
mov rsi, qword [rsp + r14*8 + 0xe8]
mov r12, rsi
shr r12, 1
mov rbx, r13
shr rbx, 1
lea rbp, [r12 + rbx]
cmp rbp, r9
ja 0x18016f7a0
mov eax, esi
or eax, r13d
and eax, 1
jne 0x18016f7a0
add rbp, rbp
mov r13, rbp
cmp r14, 1
ja 0x18016f74f
jmp 0x18016f990
mov rax, r15
sub rax, rbp
mov rcx, qword [rsp + 0x50]
lea r15, [rcx + rax*8]
test sil, 1
jne 0x18016f820
mov rax, r12
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov rcx, qword [rsp + 0x368]
mov qword [rsp + 0x30], rcx
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, r15
mov rdx, r12
mov r8, rdi
mov r9, qword [rsp + 0x40]
call fcn.1801700b0
mov rdx, qword [rsp + 0x68]
movabs r10, 0x1ffffffffffffffe
mov r9, qword [rsp + 0x40]
test r13b, 1
je 0x18016f826
cmp r13, 2
jae 0x18016f885
jmp 0x18016f735
test r13b, 1
jne 0x18016f80f
lea rcx, [r15 + r12*8]
mov rax, rbx
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov rdx, qword [rsp + 0x368]
mov qword [rsp + 0x30], rdx
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rdx, rbx
mov r8, rdi
mov r9, qword [rsp + 0x40]
call fcn.1801700b0
mov rdx, qword [rsp + 0x68]
movabs r10, 0x1ffffffffffffffe
mov r9, qword [rsp + 0x40]
cmp r13, 2
jb 0x18016f735
cmp rsi, 2
jb 0x18016f735
cmp rbx, r12
mov rsi, r12
cmovb rsi, rbx
cmp rsi, r9
ja 0x18016f735
lea r13, [r15 + r12*8]
cmp rbx, r12
mov rdx, r15
cmovb rdx, r13
lea r8, [rsi*8]
mov rcx, rdi
call fcn.1801f0cd0
lea r8, [rdi + rsi*8]
cmp rbx, r12
jae 0x18016f927
mov rax, qword [rsp + 0x98]
nop word cs:[rax + rax]
movzx ecx, byte [r8 - 8]
xor edx, edx
xor r9d, r9d
cmp cl, byte [r13 - 8]
setb dl
setae r9b
mov rcx, r8
cmovb rcx, r13
mov rcx, qword [rcx - 8]
mov qword [rax], rcx
lea r13, [r13 + r9*8 - 8]
lea r8, [r8 + rdx*8]
add r8, 0xfffffffffffffff8
cmp r13, r15
je 0x18016f710
add rax, 0xfffffffffffffff8
cmp r8, rdi
jne 0x18016f8e0
jmp 0x18016f710
mov rdx, rdi
test rsi, rsi
je 0x18016f716
mov r11, qword [rsp + 0x58]
nop dword [rax + rax]
movzx ecx, byte [r13]
xor eax, eax
xor r9d, r9d
cmp cl, byte [rdx]
setb cl
setae r9b
mov r10, rdx
cmovb r10, r13
mov r10, qword [r10]
mov qword [r15], r10
lea rdx, [rdx + r9*8]
add r15, 8
cmp rdx, r8
je 0x18016f716
mov al, cl
lea r13, [r13 + rax*8]
cmp r13, r11
jne 0x18016f940
jmp 0x18016f716
mov r14d, 1
mov r8, qword [rsp + 0x80]
mov qword [rsp + r14*8 + 0xe8], r13
mov byte [rsp + r14 + 0xa6], dl
cmp qword [rsp + 0x60], r15
jbe 0x18016f9c9
inc r14
mov r13, r8
mov rax, r8
shr rax, 1
add r15, rax
jmp 0x18016f430
test r13b, 1
jne 0x18016fa0e
mov rdx, qword [rsp + 0x60]
mov rax, rdx
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov rcx, qword [rsp + 0x368]
mov qword [rsp + 0x30], rcx
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, qword [rsp + 0x50]
mov r8, rdi
call fcn.1801700b0
nop
add rsp, 0x2f8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret