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

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r12
push r14
push r15
sub rsp, 0x20
xor ebp, ebp
mov r14, rcx
test rcx, rcx
jne 0x180007809
mov eax, 0xffffff9a
jmp 0x180007a8f
mov rdi, qword [rcx + 0xc0]
test rdi, rdi
je 0x1800077ff
cmp qword [rdi], rbp
jne 0x180007824
mov eax, 0xffffff9c
jmp 0x180007a8f
test r8d, r8d
jne 0x180007830
xor eax, eax
jmp 0x180007a8f
mov ecx, dword [rdi + 0x80]
mov qword [rdi + 0x18], rdx
mov dword [rdi + 0x20], r8d
cmp r8d, ecx
jbe 0x180007852
cmp dword [rdi + 0xd8], ebp
mov eax, r8d
cmove eax, ecx
mov dword [rdi + 0x20], eax
mov edx, dword [rdi + 0x10]
add edx, dword [rdi + 0x7c]
cmp r8d, edx
jbe 0x18000786c
mov eax, dword [rdi + 0x20]
cmp dword [rdi + 0xd8], ebp
cmovne eax, edx
mov dword [rdi + 0x20], eax
cmp dword [rdi + 0x20], ebp
jbe 0x180007a8d
cmp dword [rdi + 0x10], 0
jne 0x1800079b8
mov eax, dword [rdi + 0x7c]
test eax, eax
je 0x1800079b8
mov r8d, dword [rdi + 0xd4]
mov ebx, 0x4000
mov rdx, qword [rdi + 0xc8]
cmp eax, ebx
mov rcx, qword [rdi + 0xc0]
cmovb ebx, eax
add r8d, dword [rdi + 0x60]
xor r9d, r9d
call qword [rdi + 0xa8]
test eax, eax
jne 0x180007a88
mov r8, qword [rdi]
mov r9d, ebx
mov rdx, qword [rdi + 0xc8]
mov rcx, qword [rdi + 0xc0]
call qword [rdi + 0x90]
cmp eax, ebx
jne 0x180007a88
cmp dword [r14 + 0xc8], 0
je 0x1800079a8
test ebx, ebx
je 0x1800079a8
xor r10d, r10d
mov r11d, ebx
mov rdx, qword [rdi]
mov ecx, dword [r14 + 0xd4]
and ecx, 0xfffd
or ecx, 2
mov eax, ecx
xor eax, 1
imul eax, ecx
shr eax, 8
movzx ecx, al
movsx eax, byte [rdx + r10]
xor ecx, eax
mov byte [rdx + r10], cl
mov r8, qword [r14 + 0xd8]
movsx r9d, cl
mov ecx, dword [r14 + 0xcc]
mov eax, r9d
xor rcx, rax
movzx eax, cl
mov ecx, dword [r14 + 0xcc]
shr ecx, 8
mov edx, dword [r8 + rax*4]
xor edx, ecx
mov dword [r14 + 0xcc], edx
movzx eax, dl
add eax, dword [r14 + 0xd0]
mov edx, dword [r14 + 0xd4]
imul ecx, eax, 0x8088405
inc ecx
mov dword [r14 + 0xd0], ecx
shr rcx, 0x18
xor rcx, rdx
shr edx, 8
movzx eax, cl
mov eax, dword [r8 + rax*4]
xor eax, edx
mov dword [r14 + 0xd4], eax
mov rax, qword [rdi]
mov byte [r10 + rax], r9b
inc r10
sub r11, 1
jne 0x1800078fc
add dword [rdi + 0x60], ebx
mov rax, qword [rdi]
sub dword [rdi + 0x7c], ebx
mov qword [rdi + 8], rax
mov dword [rdi + 0x10], ebx
cmp dword [rdi + 0xd0], 0
je 0x180007a1f
cmp dword [rdi + 0xd8], 0
jne 0x180007a1f
mov r15d, dword [rdi + 0x24]
lea rcx, [rdi + 8]
mov r12, qword [rdi + 0x18]
mov edx, 2
call fcn.180003ac0
mov esi, eax
test eax, eax
js 0x1800079f3
cmp qword [rdi + 0x28], 0
mov eax, 0xfffffffd
cmovne esi, eax
mov ebx, dword [rdi + 0x24]
mov rdx, r12
mov ecx, dword [rdi + 0x74]
sub ebx, r15d
mov r8d, ebx
call fcn.1800012e0
sub dword [rdi + 0x80], ebx
add ebp, ebx
mov dword [rdi + 0x74], eax
cmp esi, 1
je 0x180007a8d
test esi, esi
je 0x180007a7f
mov eax, esi
jmp 0x180007a8f
mov ebx, dword [rdi + 0x10]
test ebx, ebx
jne 0x180007a2b
cmp dword [rdi + 0x7c], ebx
je 0x180007a8d
cmp dword [rdi + 0x20], ebx
cmovb ebx, dword [rdi + 0x20]
test ebx, ebx
je 0x180007a52
xor edx, edx
mov r8d, ebx
mov rax, qword [rdi + 8]
mov rcx, qword [rdi + 0x18]
mov al, byte [rdx + rax]
mov byte [rdx + rcx], al
inc rdx
sub r8, 1
jne 0x180007a3b
mov rdx, qword [rdi + 0x18]
mov r8d, ebx
mov ecx, dword [rdi + 0x74]
call fcn.1800012e0
sub dword [rdi + 0x80], ebx
sub dword [rdi + 0x10], ebx
sub dword [rdi + 0x20], ebx
add dword [rdi + 0x24], ebx
mov dword [rdi + 0x74], eax
mov eax, ebx
add qword [rdi + 0x18], rax
add qword [rdi + 8], rax
add ebp, ebx
cmp dword [rdi + 0x20], 0
jmp 0x18000786f
or eax, 0xffffffff
jmp 0x180007a8f
mov eax, ebp
mov rbx, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r14
pop r12
ret