Function at 0x653db830
Capabilities:
Encode data using xor

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x30
mov r13, qword [rcx + 0x38]
mov rbp, rdx
mov rdx, qword [rcx + 0x20]
mov rsi, rcx
mov rdi, r8
mov r12d, r9d
mov rax, qword [r13 + 0x78]
add rax, 7
and rax, 0xfffffffffffffff8
add rax, r8
cmp rax, rdx
jle 0x653db894
lea rbx, [rdx + r8 + 0x1000]
lea rcx, [r13 + 0x58]
and rbx, 0xfffffffffffff001
cmp qword [r13 + 0x58], 0
je 0x653db965
mov r8, rbx
call fcn.653fa570
mov r13, qword [rsi + 0x38]
mov qword [rsi + 0x20], rbx
mov r8, qword [r13 + 0x60]
test r8, r8
je 0x653dbac0
test rdi, rdi
jle 0x653dbaf0
lea r9, [rdi + rbp]
mov rdx, rbp
xor eax, eax
mov ecx, eax
add rdx, 1
and ecx, 1
shl rax, cl
movzx ecx, byte [rdx - 1]
xor rax, rcx
cmp r9, rdx
jne 0x653db8b3
mov rbx, qword [r13 + 0x68]
lea rdx, [rbx - 1]
and rax, rdx
mov rbx, qword [r8 + rax*8]
lea r14, [rax*8]
test rbx, rbx
jne 0x653db8f8
jmp 0x653db930
mov rbx, qword [rbx]
test rbx, rbx
je 0x653db930
cmp qword [rbx + 0x18], rdi
jne 0x653db8f0
mov rcx, qword [rbx + 0x10]
add rcx, qword [r13 + 0x58]
mov r8, rdi
mov rdx, rbp
call fcn.653fd890
test eax, eax
jne 0x653db8f0
mov rax, rbx
add rsp, 0x30
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
xor edx, edx
mov rcx, rsi
call fcn.653d98b0
test r12d, r12d
mov rbx, rax
mov rax, qword [rsi + 0x38]
cmove r12d, edi
cmp r12d, 4
mov rcx, qword [rax + 0x78]
ja case.default.0x653db963
lea r8, [0x6540c0b0]
mov r12d, r12d
movsxd rdx, dword [r8 + r12*4]
add rdx, r8
jmp rdx
mov rdx, rbx
call fcn.653fa540
jmp 0x653db88c
add rcx, 7
and rcx, 0xfffffffffffffff8
mov qword [rax + 0x78], rcx
mov qword [rbx + 0x10], rcx
add rcx, qword [rax + 0x58]
mov r8, rdi
mov qword [rbx + 0x18], rdi
mov rdx, rbp
call fcn.653fa4a0
mov rax, qword [rsi + 0x38]
add r14, qword [rax + 0x60]
add qword [rax + 0x78], rdi
mov rdi, qword [rax + 0x70]
mov rdx, qword [r14]
lea rcx, [rdi + 1]
mov qword [rbx], rdx
mov rdx, qword [rax + 0x68]
mov qword [r14], rbx
mov qword [rax + 0x70], rcx
mov r8, rdx
mov rax, rdx
sar rax, 1
sar r8, 2
add rax, r8
cmp rcx, rax
jle 0x653db915
lea rax, [rdx + rdx]
cmp rdx, rax
jge 0x653db915
lea rcx, [rsp + 0x28]
shl rdx, 4
call fcn.653fa540
mov r12, qword [rsi + 0x38]
mov rax, qword [r12 + 0x68]
test rax, rax
jle 0x653dba79
mov rbp, qword [r12 + 0x60]
mov r11, qword [rsp + 0x28]
lea rdi, [rax + rax - 1]
lea r13, [rbp + rax*8]
mov r8, qword [rbp]
test r8, r8
je 0x653dba70
mov r10, qword [r12 + 0x58]
nop
mov r14, qword [r8 + 0x18]
mov r9, qword [r8]
mov rax, qword [r8 + 0x10]
test r14, r14
jle 0x653dbb00
add r14, rax
lea rdx, [r10 + rax]
xor eax, eax
add r14, r10
mov ecx, eax
add rdx, 1
and ecx, 1
shl rax, cl
movzx ecx, byte [rdx - 1]
xor rax, rcx
cmp r14, rdx
jne 0x653dba40
and rax, rdi
lea rax, [r11 + rax*8]
mov rdx, qword [rax]
test r9, r9
mov qword [r8], rdx
mov qword [rax], r8
mov r8, r9
jne 0x653dba20
add rbp, 8
cmp r13, rbp
jne 0x653dba10
lea rcx, [r12 + 0x60]
call fcn.653fa5c0
mov rax, qword [rsi + 0x38]
mov rdx, qword [rsp + 0x28]
shl qword [rax + 0x68], 1
mov qword [rax + 0x60], rdx
jmp 0x653db915
add rcx, 1
and rcx, 0xfffffffffffffffe
mov qword [rax + 0x78], rcx
jmp case.0x653db963.0
add rcx, 3
and rcx, 0xfffffffffffffffc
mov qword [rax + 0x78], rcx
jmp case.0x653db963.0
lea rcx, [r13 + 0x60]
mov qword [r13 + 0x68], 0x10
mov edx, pe_nt_image_headers64
call fcn.653fa540
mov r13, qword [rsi + 0x38]
test rdi, rdi
mov r8, qword [r13 + 0x60]
jg 0x653db8aa
nop word [rax + rax]
xor eax, eax
jmp 0x653db8cb
mov rax, r11
jmp 0x653dba5f