Function at 0x586250
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rax, qword [rcx + 0x168]
mov rdi, qword [rcx + 0x178]
mov rbp, qword [rcx + 0x180]
mov r14, rcx
mov qword [rsp + 0x98], rdx
mov r10, r8
mov rdx, r9
mov qword [rsp + 0xa8], r9
mov r8, qword [rcx + 0x160]
xor ecx, ecx
movabs r9, 0xfffffffe0
add rdx, qword [r14 + 0x38]
mov qword [rsp + 0x28], rax
setb cl
cmp rdx, r9
ja 0x5868b9
test rcx, rcx
jne 0x5868b9
mov eax, dword [r14 + 0x174]
mov qword [r14 + 0x38], rdx
test eax, eax
je 0x5867c0
cmp qword [rsp + 0xa8], 0
je 0x58689c
movdqu xmm1, xmmword [r14 + 0x40]
mov eax, dword [r14 + 0xc]
pxor xmm0, xmm0
mov dword [r14 + 0x174], 0
mov dword [rsp + 0x24], 0x10
mov edx, eax
movups xmmword [r14 + 0x188], xmm1
bswap edx
movups xmmword [r14 + 0x40], xmm0
mov dword [rsp + 0x20], edx
mov edx, 1
cmp qword [rsp + 0xa8], 0xf
jbe 0x58635e
test dl, dl
je 0x58635e
mov qword [rsp + 0xa0], r10
mov r9d, dword [rsp + 0x24]
lea rdx, [r14 + 0x60]
lea rcx, [r14 + 0x40]
mov rax, qword [rsp + 0x28]
lea r8, [r14 + 0x188]
call rax
mov dword [rsp + 0x24], 0
mov r10, qword [rsp + 0xa0]
cmp qword [rsp + 0xa8], 0xbff
jbe 0x58643c
lea rax, [r14 + 0x60]
lea r12, [r14 + 0x10]
mov qword [rsp + 0x30], rax
lea rax, [r14 + 0x40]
lea rsi, [r10 + 0xc00]
mov qword [rsp + 0x38], rax
mov rdx, qword [rsp + 0x30]
mov rcx, qword [rsp + 0x38]
mov r9d, 0xc00
lea rbx, [rsi - 0xc00]
mov r8, qword [rsp + 0x98]
mov rax, qword [rsp + 0x28]
call rax
mov r15d, dword [rsp + 0x20]
mov r13, qword [rsp + 0x98]
add r15d, 1
mov rdx, r12
mov r8, rbp
mov rcx, r14
call rdi
mov eax, r15d
add rbx, 0x10
add r13, 0x10
bswap eax
mov dword [r14 + 0xc], eax
mov rax, qword [r13 - 0x10]
mov rdx, rsi
xor rax, qword [r14 + 0x10]
mov qword [rbx - 0x10], rax
mov rax, qword [r13 - 8]
xor rax, qword [r14 + 0x18]
mov qword [rbx - 8], rax
cmp rbx, rsi
jne 0x5863c0
add dword [rsp + 0x20], 0xc0
add rsi, 0xc00
add qword [rsp + 0x98], 0xc00
sub qword [rsp + 0xa8], 0xc00
cmp qword [rsp + 0xa8], 0xbff
ja 0x58638d
mov r10, rdx
mov r9, qword [rsp + 0xa8]
and r9, 0xfffffffffffffff0
je 0x586526
mov qword [rsp + 0xa0], r10
mov r8, qword [rsp + 0x98]
lea rdx, [r14 + 0x60]
lea rcx, [r14 + 0x40]
mov rax, qword [rsp + 0x28]
call rax
lea rdx, [r14 + 0x10]
mov ebx, dword [rsp + 0x20]
mov r8, rbp
mov r10, qword [rsp + 0xa0]
mov rax, qword [rsp + 0xa8]
mov r15, rdx
mov r12, qword [rsp + 0x98]
mov rsi, r10
lea r13, [r10 + rax]
mov rbp, r10
add ebx, 1
mov qword [rsp + 0x28], r8
mov rdx, r15
mov rcx, r14
call rdi
mov eax, ebx
add rsi, 0x10
add r12, 0x10
bswap eax
mov dword [r14 + 0xc], eax
mov rax, qword [r12 - 0x10]
xor rax, qword [r14 + 0x10]
mov r8, qword [rsp + 0x28]
mov qword [rsi - 0x10], rax
mov rax, qword [r12 - 8]
xor rax, qword [r14 + 0x18]
mov qword [rsi - 8], rax
mov rax, r13
sub rax, rsi
cmp rax, 0xf
ja 0x58649d
mov rax, qword [rsp + 0xa8]
mov r10, rbp
mov rbp, r8
and qword [rsp + 0xa8], 0xf
lea rdx, [rax - 0x10]
mov eax, dword [rsp + 0x20]
shr rdx, 4
lea eax, [rax + rdx + 1]
add rdx, 1
shl rdx, 4
add qword [rsp + 0x98], rdx
mov dword [rsp + 0x20], eax
add r10, rdx
cmp qword [rsp + 0xa8], 0
mov qword [rsp + 0xa0], r10
je 0x5867a2
lea rdx, [r14 + 0x10]
mov r8, rbp
mov rcx, r14
call rdi
mov edx, dword [rsp + 0x20]
mov r8d, dword [rsp + 0x24]
mov rdi, qword [rsp + 0x98]
mov r10, qword [rsp + 0xa0]
add edx, 1
mov rax, r8
lea ecx, [r8 + 1]
bswap edx
mov dword [r14 + 0xc], edx
movzx edx, byte [rdi]
mov byte [r14 + r8 + 0x188], dl
mov r8, qword [rsp + 0xa8]
xor dl, byte [r14 + 0x10]
mov byte [r10], dl
sub r8, 1
je 0x58679a
movzx edx, byte [rdi + 1]
mov r11d, ecx
lea r9d, [rax + 2]
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x11]
cmp qword [rsp + 0xa8], 2
mov byte [r10 + 1], dl
je 0x58679a
movzx edx, byte [rdi + 2]
lea r11d, [rax + 3]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x12]
cmp qword [rsp + 0xa8], 3
mov byte [r10 + 2], dl
je 0x58679a
movzx edx, byte [rdi + 3]
lea r9d, [rax + 4]
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x13]
cmp qword [rsp + 0xa8], 4
mov byte [r10 + 3], dl
je 0x58679a
movzx edx, byte [rdi + 4]
lea r11d, [rax + 5]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x14]
cmp qword [rsp + 0xa8], 5
mov byte [r10 + 4], dl
je 0x58679a
movzx edx, byte [rdi + 5]
lea r9d, [rax + 6]
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x15]
cmp qword [rsp + 0xa8], 6
mov byte [r10 + 5], dl
je 0x58679a
movzx edx, byte [rdi + 6]
lea r11d, [rax + 7]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x16]
cmp qword [rsp + 0xa8], 7
mov byte [r10 + 6], dl
je 0x58679a
movzx edx, byte [rdi + 7]
lea r9d, [rax + 8]
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x17]
cmp qword [rsp + 0xa8], 8
mov byte [r10 + 7], dl
je 0x58679a
movzx edx, byte [rdi + 8]
lea r11d, [rax + 9]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x18]
cmp qword [rsp + 0xa8], 9
mov byte [r10 + 8], dl
je 0x58679a
movzx edx, byte [rdi + 9]
lea r9d, [rax + 0xa]
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x19]
cmp qword [rsp + 0xa8], 0xa
mov byte [r10 + 9], dl
je 0x58679a
movzx edx, byte [rdi + 0xa]
lea r11d, [rax + 0xb]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x1a]
cmp qword [rsp + 0xa8], 0xb
mov byte [r10 + 0xa], dl
je 0x58679a
movzx edx, byte [rdi + 0xb]
lea r9d, [rax + 0xc]
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x1b]
cmp qword [rsp + 0xa8], 0xc
mov byte [r10 + 0xb], dl
je 0x58679a
movzx edx, byte [rdi + 0xc]
lea r11d, [rax + 0xd]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x1c]
cmp qword [rsp + 0xa8], 0xd
mov byte [r10 + 0xc], dl
je 0x58679a
movzx edx, byte [rdi + 0xd]
add eax, 0xe
mov r9d, eax
mov byte [r14 + r11 + 0x188], dl
xor dl, byte [r14 + 0x1d]
cmp qword [rsp + 0xa8], 0xe
mov byte [r10 + 0xd], dl
je 0x58679a
movzx edx, byte [rdi + 0xe]
mov byte [r14 + r9 + 0x188], dl
xor dl, byte [r14 + 0x1e]
mov byte [r10 + 0xe], dl
lea eax, [rcx + r8]
mov dword [rsp + 0x24], eax
mov eax, dword [rsp + 0x24]
mov dword [r14 + 0x170], eax
xor eax, eax
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov eax, dword [r14 + 0xc]
mov r9d, dword [r14 + 0x170]
mov edx, eax
mov eax, r9d
bswap edx
mov dword [rsp + 0x20], edx
and eax, 0xf
je 0x5868c3
cmp qword [rsp + 0xa8], 0
je 0x58688e
mov r8, qword [rsp + 0x98]
mov r11, qword [rsp + 0xa8]
jmp 0x586805
test r11, r11
je 0x586876
movzx edx, byte [r8]
mov ecx, r9d
add r10, 1
add r8, 1
add r9d, 1
sub r11, 1
mov byte [r14 + rcx + 0x188], dl
mov ecx, eax
add eax, 1
xor dl, byte [r14 + rcx + 0x10]
mov byte [r10 - 1], dl
and eax, 0xf
jne 0x586800
mov dword [rsp + 0x24], eax
mov qword [rsp + 0x98], r8
mov qword [rsp + 0xa8], r11
mov qword [rsp + 0xa0], r10
mov rax, qword [rsp + 0x28]
lea rdx, [r14 + 0x60]
lea rcx, [r14 + 0x40]
lea r8, [r14 + 0x188]
call rax
mov r10, qword [rsp + 0xa0]
jmp 0x58635e
mov dword [rsp + 0x24], eax
mov qword [rsp + 0x98], r8
mov qword [rsp + 0xa8], r11
test eax, eax
je 0x58684b
mov dword [r14 + 0x170], r9d
xor eax, eax
jmp 0x5867af
lea rdx, [r14 + 0x60]
lea rcx, [r14 + 0x40]
call r8
xor eax, eax
mov dword [r14 + 0x174], 0
jmp 0x5867af
mov eax, 0xffffffff
jmp 0x5867af
test r9d, r9d
mov dword [rsp + 0x24], r9d
setne dl
jmp 0x58631c