Function at 0x140109380
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x18], r8
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x80
mov rdi, r9
mov r9, rcx
mov r13d, edx
mov r12d, 1
cmp edx, 3
jne 0x1401093b3
mov eax, r12d
jmp 0x1401093c6
mov rcx, r8
xor edx, edx
mov r8, r12
mov eax, 0x400000
shl r8, cl
div r8
lea r15, [rax + rax*4]
mov qword [rbp - 0x38], rax
shl r15, 4
add r15, 0x17f
and r15, 0xffffffffffffff00
mov qword [rbp - 0x28], r15
mov qword [rbp - 0x20], r15
test r9, r9
jne 0x1401093f5
mov r14d, 0x400000
jmp 0x140109406
lea r14, [r9 + 0x3ffff]
add r14, r15
and r14, 0xfffffffffffc0000
mov ecx, 0xb
call fcn.14010dab0
mov rcx, qword [rdi + 0x20]
cdqe
mov qword [rbp - 0x30], rax
mov qword [rbp + 0x58], rcx
cmp rcx, rax
jb 0x140109431
mov ecx, 3
call fcn.14010dc90
test al, al
jne 0x14010943b
cmp r13d, 1
jg 0x14010943b
xor al, al
jmp 0x14010943d
mov al, 1
xor esi, esi
mov qword [rsp + 0x78], rbx
mov byte [rbp + 0x40], al
mov byte [rbp + 0x48], 0
test r14, 0xffffffffffbfffff
jne 0x140109501
mov rbx, qword [rdi + 0x50]
test rbx, rbx
je 0x140109501
dec qword [rdi + 0x40]
mov rdx, r12
mov rax, qword [rbx + 0x10]
mov qword [rdi + 0x50], rax
mov qword [rbx + 0x10], rsi
mov rcx, qword [rdi + 0x58]
add rcx, 0x1e0
call fcn.14010dea0
cmp byte [rbx + 9], sil
jne 0x1401094ac
cmp r13d, 1
jle 0x1401094ac
mov r9, qword [rdi + 0x58]
lea r8, [rbp + 0x48]
mov rdx, qword [rbx + 0x40]
mov rcx, rbx
call fcn.14010b670
mov byte [rbx + 9], 1
cmp byte [rbx + 8], sil
jne 0x140109595
mov ecx, 9
call fcn.14010dc90
test al, al
jne 0x1401094d6
mov ecx, 8
call fcn.14010dc90
test al, al
je 0x140109595
mov r9, qword [rdi + 0x58]
lea r8, [rbp + 0x58]
mov rdx, qword [rbx + 0x40]
mov rcx, rbx
mov byte [rbp + 0x58], sil
call fcn.14010b820
cmp byte [rbp + 0x58], sil
je 0x140109595
mov byte [rbp + 0x48], 1
jmp 0x140109595
mov rax, qword [rbp + 0x58]
lea r9, [rbp - 0x3f]
cmp rax, qword [rbp - 0x30]
lea r8, [rbp + 0x40]
mov rax, qword [rbp + 0x60]
mov edx, 0x400000
mov qword [rsp + 0x30], rax
mov rcx, r14
lea rax, [rbp - 0x30]
setae byte [rbp - 0x3f]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x48]
mov qword [rsp + 0x20], rax
call fcn.14010b310
mov rbx, rax
test rax, rax
je 0x14010964a
cmp byte [rbp + 0x40], sil
jne 0x140109575
mov r9, qword [rdi + 0x58]
lea r8, [rbp - 0x40]
mov rdx, r15
mov byte [rbp - 0x40], sil
mov rcx, rbx
call fcn.14010b670
movzx eax, byte [rbp + 0x48]
cmp byte [rbp - 0x40], sil
cmovne eax, r12d
mov byte [rbp + 0x48], al
mov rax, qword [rbp - 0x30]
mov rdx, rdi
mov qword [rbx], rax
mov ecx, r14d
movzx eax, byte [rbp - 0x3f]
mov byte [rbx + 8], al
movzx eax, byte [rbp + 0x40]
mov byte [rbx + 9], al
call fcn.140109b50
lea r8, [r15 - 0x10]
xor edx, edx
lea rcx, [rbx + 0x10]
call sub.VCRUNTIME140.dll_memset
mov rax, qword [rbp - 0x38]
mov rcx, rbx
mov qword [rbx + 0x38], rax
mov rax, qword [rbp + 0x50]
mov qword [rbx + 0x58], rax
mov dword [rbx + 0x68], r13d
mov qword [rbx + 0x40], r14
mov qword [rbx + 0x48], r15
mov rax, qword gs:[0x30]
mov qword [rbx + 0x60], rax
call fcn.14010acf0
xor r8b, r8b
mov qword [rbx + 0x50], rax
cmp qword [rbx + 0x38], rsi
jbe 0x140109633
nop dword [rax]
nop word [rax + rax]
lea rdx, [rsi + rsi*4]
shl rdx, 4
add rdx, rbx
and byte [rdx + 0x71], 0xfd
mov byte [rdx + 0x70], r8b
inc r8b
movzx ecx, byte [rbp + 0x40]
shl cl, 2
xor cl, byte [rdx + 0x71]
and cl, 4
movzx esi, r8b
xor cl, byte [rdx + 0x71]
mov byte [rdx + 0x71], cl
movzx eax, byte [rbp + 0x48]
shl al, 3
xor al, cl
and al, 8
xor al, cl
mov byte [rdx + 0x71], al
cmp rsi, qword [rbx + 0x38]
jb 0x1401095f0
mov rcx, qword [rdi + 0x58]
mov rdx, qword [rbx + 0x48]
add rcx, 0xa0
call fcn.14010deb0
mov rax, rbx
mov rbx, qword [rsp + 0x78]
add rsp, 0x80
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret