Function at 0x1400988a0
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, 0x28
mov ebp, 0xffffff9a
test rcx, rcx
je 0x1400989ca
mov rsi, rcx
mov r13, qword [rcx + 0x110]
test r13, r13
je 0x1400989ca
cmp qword [r13], 0
je 0x140098b27
xor ebp, ebp
test r8d, r8d
je 0x1400989ca
mov qword [r13 + 0x18], rdx
mov dword [r13 + 0x20], r8d
mov edx, r8d
mov rax, qword [r13 + 0x98]
mov ecx, dword [r13 + 0x10]
lea r8, [rax + rcx]
cmp r8, rdx
jb 0x140098a71
lea rdi, [r13 + 8]
lea rax, [r13 + 0xa8]
mov qword [rsp + 0x20], rax
xor ebx, ebx
mov r14d, dword [r13 + 0x10]
test r14d, r14d
je 0x1400989dd
mov eax, dword [r13 + 0x108]
test eax, eax
je 0x140098aa9
cmp dword [r13 + 0x118], 0
jne 0x140098aa9
cmp eax, 0xc
je 0x1400989bd
mov ebp, dword [r13 + 0x24]
mov r15, qword [r13 + 0x18]
mov rcx, rdi
mov edx, 2
call fcn.140076050
mov r14d, eax
test eax, eax
js 0x140098975
cmp qword [r13 + 0x28], 0
mov eax, 0xfffffffd
cmovne r14d, eax
mov eax, dword [r13 + 0x24]
mov ecx, dword [r13 + 0x90]
mov r12, rax
bts r12, 0x20
cmp eax, ebp
cmovae r12, rax
sub r12, rbp
add qword [r13 + 0x88], r12
mov rdx, r15
mov r8d, r12d
call fcn.1400866f0
mov dword [r13 + 0x90], eax
sub qword [r13 + 0xa0], r12
add ebx, r12d
test r14d, r14d
jne 0x140098a84
cmp dword [r13 + 0x20], 0
mov ebp, ebx
jne 0x14009891c
mov eax, ebp
add rsp, 0x28
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov r14, qword [r13 + 0x98]
test r14, r14
je 0x140098a95
mov eax, 0x4000
cmp r14, rax
cmovae r14, rax
mov rdx, qword [r13 + 0x100]
mov r8, qword [r13 + 0x110]
add r8, qword [r13 + 0x60]
mov rcx, qword [rsp + 0x20]
xor r9d, r9d
call fcn.14005a680
mov ebp, 0xffffffff
test eax, eax
jne 0x1400989ca
mov r8, qword [r13]
mov rax, qword [r13 + 0xb0]
mov rdx, qword [r13 + 0x100]
mov rcx, qword [r13 + 0xe0]
mov r9d, r14d
call qword [0x14016adc0]
cmp eax, r14d
jne 0x1400989ca
cmp dword [rsi + 0x118], 0
jne 0x140098b31
add qword [r13 + 0x60], r14
sub qword [r13 + 0x98], r14
mov rax, qword [r13]
mov qword [r13 + 8], rax
mov dword [r13 + 0x10], r14d
jmp 0x140098929
cmp dword [r13 + 0x118], 0
je 0x14009890a
jmp 0x140098be8
mov ebp, ebx
cmp r14d, 1
je 0x1400989ca
jmp 0x140098be0
xor r14d, r14d
jmp 0x140098929
mov ebp, ebx
jmp 0x1400989ca
xor r15d, r15d
jmp 0x140098ae3
test r14d, r14d
jne 0x140098ab8
cmp qword [r13 + 0x98], 0
je 0x140098a9d
mov eax, dword [r13 + 0x20]
cmp eax, r14d
cmovb r14d, eax
test r14d, r14d
je 0x140098aa4
mov r15d, r14d
xor eax, eax
mov rcx, qword [r13 + 8]
mov rdx, qword [r13 + 0x18]
mov cl, byte [rcx + rax]
mov byte [rdx + rax], cl
inc rax
cmp r15, rax
jne 0x140098acd
add qword [r13 + 0x88], r15
mov rdx, qword [r13 + 0x18]
mov ecx, dword [r13 + 0x90]
mov r8d, r14d
call fcn.1400866f0
mov dword [r13 + 0x90], eax
sub qword [r13 + 0xa0], r15
sub dword [r13 + 0x10], r14d
sub dword [r13 + 0x20], r14d
add qword [r13 + 0x18], r15
add qword [r13 + 8], r15
add dword [r13 + 0x24], r14d
add ebx, r14d
jmp 0x1400989bd
mov ebp, 0xffffff9c
jmp 0x1400989ca
xor eax, eax
mov ecx, 0xff
mov r8d, dword [rsi + 0x128]
mov edx, r8d
and edx, 0xfffd
or r8d, 2
xor edx, 3
imul edx, r8d
shr edx, 8
mov r8, qword [r13]
xor dl, byte [r8 + rax]
mov byte [r8 + rax], dl
mov r8, qword [rsi + 0x130]
mov r9d, dword [rsi + 0x120]
mov r10d, dword [rsi + 0x128]
mov r11d, r9d
xor r11b, dl
movzx r11d, r11b
shr r9d, 8
xor r9d, dword [r8 + r11*4]
mov dword [rsi + 0x120], r9d
and r9d, ecx
add r9d, dword [rsi + 0x124]
imul r9d, r9d, 0x8088405
inc r9d
mov dword [rsi + 0x124], r9d
shr r9d, 0x18
mov r11d, r10d
and r11d, ecx
xor r11d, r9d
shr r10d, 8
xor r10d, dword [r8 + r11*4]
mov dword [rsi + 0x128], r10d
mov r8, qword [r13]
mov byte [r8 + rax], dl
inc rax
cmp r14, rax
jne 0x140098b38
jmp 0x140098a55
mov ebp, r14d
jmp 0x1400989ca
add eax, ecx
mov dword [r13 + 0x20], eax
je 0x1400989ca
jmp 0x14009890a