Function at 0x14009ae90
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
mov r12d, 0xffffff9a
test rcx, rcx
je 0x14009b1f2
mov r14, rcx
mov rbp, qword [rcx + 0x110]
test rbp, rbp
je 0x14009b1f2
cmp qword [rbp], 0
je 0x14009b1df
xor r12d, r12d
test r8d, r8d
je 0x14009b1f2
mov qword [rbp + 0x18], rdx
mov dword [rbp + 0x20], r8d
mov ecx, r8d
mov rax, qword [rbp + 0x98]
mov r15d, dword [rbp + 0x10]
mov rdx, r15
add rdx, rax
cmp rdx, rcx
jae 0x14009af0f
cmp dword [rbp + 0x118], 0
je 0x14009af0f
add eax, r15d
mov dword [rbp + 0x20], eax
je 0x14009b1f2
lea rax, [rbp + 8]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xa8]
mov qword [rsp + 0x30], rax
xor r13d, r13d
mov r12d, 0xfffd
test r15d, r15d
jne 0x14009b05a
mov r15, qword [rbp + 0x98]
test r15, r15
je 0x14009b057
mov eax, 0x4000
cmp r15, rax
cmovae r15, rax
mov rdx, qword [rbp + 0x100]
mov r8, qword [rbp + 0x110]
add r8, qword [rbp + 0x60]
mov rcx, qword [rsp + 0x30]
xor r9d, r9d
call fcn.1400c6c80
mov ebx, 0xffffffff
test eax, eax
jne 0x14009b1ef
mov rdx, qword [rbp + 0x100]
mov r8, qword [rbp]
mov rcx, qword [rbp + 0xe0]
mov r9d, r15d
call qword [rbp + 0xb0]
cmp eax, r15d
jne 0x14009b1ef
cmp dword [r14 + 0x118], 0
je 0x14009b03e
xor eax, eax
mov ecx, dword [r14 + 0x128]
and ecx, r12d
lea edx, [rcx + 2]
xor ecx, 3
imul ecx, edx
shr ecx, 8
mov rdx, qword [rbp]
xor cl, byte [rdx + rax]
mov byte [rdx + rax], cl
movzx ecx, cl
mov rdx, qword [r14 + 0x130]
mov ebx, dword [r14 + 0x120]
mov edi, dword [r14 + 0x128]
movzx esi, bl
xor esi, ecx
shr ebx, 8
xor ebx, dword [rdx + rsi*4]
mov dword [r14 + 0x120], ebx
movzx ebx, bl
add ebx, dword [r14 + 0x124]
imul ebx, ebx, 0x8088405
inc ebx
mov dword [r14 + 0x124], ebx
shr ebx, 0x18
movzx esi, dil
xor esi, ebx
shr edi, 8
xor edi, dword [rdx + rsi*4]
mov dword [r14 + 0x128], edi
mov rdx, qword [rbp]
mov byte [rdx + rax], cl
inc rax
cmp r15, rax
jne 0x14009afb2
add qword [rbp + 0x60], r15
sub qword [rbp + 0x98], r15
mov rax, qword [rbp]
mov qword [rbp + 8], rax
mov dword [rbp + 0x10], r15d
jmp 0x14009b05a
xor r15d, r15d
mov eax, dword [rbp + 0x108]
test eax, eax
je 0x14009b071
cmp dword [rbp + 0x118], 0
je 0x14009b170
test r15d, r15d
jne 0x14009b084
cmp qword [rbp + 0x98], 0
je 0x14009b1ec
mov eax, dword [rbp + 0x20]
cmp eax, r15d
cmovb r15d, eax
test r15d, r15d
je 0x14009b0ab
mov r12d, r15d
lea rcx, [r12 - 1]
mov eax, r12d
and eax, 3
cmp rcx, 3
jae 0x14009b0b0
xor ecx, ecx
jmp 0x14009b0ff
xor r12d, r12d
jmp 0x14009b11a
mov edx, r12d
and edx, 0xfffffffc
xor ecx, ecx
mov rdi, qword [rbp + 8]
mov rsi, qword [rbp + 0x18]
mov bl, byte [rdi + rcx]
mov byte [rsi + rcx], bl
mov rbx, qword [rbp + 8]
mov rdi, qword [rbp + 0x18]
mov bl, byte [rbx + rcx + 1]
mov byte [rdi + rcx + 1], bl
mov rbx, qword [rbp + 8]
mov rdi, qword [rbp + 0x18]
mov bl, byte [rbx + rcx + 2]
mov byte [rdi + rcx + 2], bl
mov rbx, qword [rbp + 8]
mov rdi, qword [rbp + 0x18]
mov bl, byte [rbx + rcx + 3]
mov byte [rdi + rcx + 3], bl
add rcx, 4
cmp rdx, rcx
jne 0x14009b0b8
test rax, rax
je 0x14009b11a
mov rdx, qword [rbp + 8]
mov rbx, qword [rbp + 0x18]
mov dl, byte [rdx + rcx]
mov byte [rbx + rcx], dl
inc rcx
dec rax
jne 0x14009b104
add qword [rbp + 0x88], r12
mov rdx, qword [rbp + 0x18]
mov ecx, dword [rbp + 0x90]
mov r8d, r15d
call fcn.140040440
mov dword [rbp + 0x90], eax
sub qword [rbp + 0xa0], r12
sub dword [rbp + 0x10], r15d
sub dword [rbp + 0x20], r15d
add qword [rbp + 0x18], r12
add qword [rbp + 8], r12
add dword [rbp + 0x24], r15d
add r13d, r15d
mov r12d, 0xfffd
cmp dword [rbp + 0x20], 0
je 0x14009b1e7
mov r15d, dword [rbp + 0x10]
jmp 0x14009af2d
cmp eax, 0xc
je 0x14009b15d
mov r15d, dword [rbp + 0x24]
mov rdi, qword [rbp + 0x18]
mov rcx, qword [rsp + 0x28]
mov edx, 2
call fcn.140008f60
mov r12d, eax
test eax, eax
js 0x14009b1a1
cmp qword [rbp + 0x28], 0
mov eax, 0xfffffffd
cmovne r12d, eax
mov ebx, dword [rbp + 0x24]
mov ecx, dword [rbp + 0x90]
sub rbx, r15
add qword [rbp + 0x88], rbx
mov rdx, rdi
mov r8d, ebx
call fcn.140040440
mov dword [rbp + 0x90], eax
sub qword [rbp + 0xa0], rbx
add r13d, ebx
test r12d, r12d
je 0x14009b157
mov ebx, r13d
cmp r12d, 1
je 0x14009b1ef
jmp 0x14009b1f2
mov r12d, 0xffffff9c
jmp 0x14009b1f2
mov r12d, r13d
jmp 0x14009b1f2
mov ebx, r13d
mov r12d, ebx
mov eax, r12d
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret