Function at 0x14012f056
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 esi, 0xffffff9a
test rcx, rcx
je 0x14012f0e9
mov rdi, rcx
mov r13, qword [rcx + 0x110]
test r13, r13
je 0x14012f0e9
cmp qword [r13], 0
je 0x14012f0e4
xor esi, esi
test r8d, r8d
je 0x14012f0e9
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
jae 0x14012f0be
cmp dword [r13 + 0x118], 0
je 0x14012f0be
add eax, ecx
mov dword [r13 + 0x20], eax
je 0x14012f0e9
lea rax, [r13 + 8]
mov qword [rsp + 0x30], rax
lea r14, [r13 + 0xa8]
xor esi, esi
mov ebp, 0x4000
mov ebx, 0xff
mov qword [rsp + 0x28], r14
jmp 0x14012f1d1
mov esi, 0xffffff9c
mov eax, esi
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov r12d, esi
mov esi, r12d
jmp 0x14012f0e9
mov r12d, esi
mov esi, ebp
cmp ebp, 1
jne 0x14012f0e9
jmp 0x14012f0ff
cmp eax, 0xc
je 0x14012f1c6
mov r14d, dword [r13 + 0x24]
mov r15, qword [r13 + 0x18]
mov rcx, qword [rsp + 0x30]
mov edx, 2
call fcn.14002e7e0
mov ebp, eax
test eax, eax
js 0x14012f143
cmp qword [r13 + 0x28], 0
mov eax, 0xfffffffd
cmovne ebp, eax
mov r12d, dword [r13 + 0x24]
mov ecx, dword [r13 + 0x90]
sub r12, r14
add qword [r13 + 0x88], r12
mov rdx, r15
mov r8d, r12d
call fcn.140048190
mov dword [r13 + 0x90], eax
sub qword [r13 + 0xa0], r12
add esi, r12d
test ebp, ebp
jne 0x14012f104
mov r14, qword [rsp + 0x28]
mov ebp, 0x4000
jmp 0x14012f1c6
xor r12d, r12d
add qword [r13 + 0x88], r12
mov rdx, qword [r13 + 0x18]
mov ecx, dword [r13 + 0x90]
mov r8d, r15d
call fcn.140048190
mov dword [r13 + 0x90], eax
sub qword [r13 + 0xa0], r12
sub dword [r13 + 0x10], r15d
sub dword [r13 + 0x20], r15d
add qword [r13 + 0x18], r12
add qword [r13 + 8], r12
add dword [r13 + 0x24], r15d
add esi, r15d
cmp dword [r13 + 0x20], 0
je 0x14012f0e9
mov r15d, dword [r13 + 0x10]
test r15d, r15d
je 0x14012f23f
mov eax, dword [r13 + 0x108]
test eax, eax
je 0x14012f1f3
cmp dword [r13 + 0x118], 0
je 0x14012f110
test r15d, r15d
jne 0x14012f206
cmp qword [r13 + 0x98], 0
je 0x14012f0fc
mov eax, dword [r13 + 0x20]
cmp eax, r15d
cmovb r15d, eax
test r15d, r15d
je 0x14012f184
mov r12d, r15d
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 r12, rax
jne 0x14012f21f
jmp 0x14012f187
xor r15d, r15d
jmp 0x14012f1da
mov r15, qword [r13 + 0x98]
test r15, r15
je 0x14012f23a
cmp r15, rbp
cmovae r15, rbp
mov rdx, qword [r13 + 0x100]
mov r8, qword [r13 + 0x110]
add r8, qword [r13 + 0x60]
mov rcx, r14
xor r9d, r9d
call fcn.14013a206
mov r12d, 0xffffffff
test eax, eax
jne 0x14012f0ff
mov r8, qword [r13]
mov rax, qword [r13 + 0xb0]
mov rdx, qword [r13 + 0x100]
mov rcx, qword [r13 + 0xe0]
mov r9d, r15d
call qword [0x1401af008]
cmp eax, r15d
jne 0x14012f0ff
cmp dword [rdi + 0x118], 0
je 0x14012f353
xor eax, eax
mov edx, dword [rdi + 0x128]
mov ecx, edx
and ecx, 0xfffd
or edx, 2
xor ecx, 3
imul ecx, edx
shr ecx, 8
mov rdx, qword [r13]
xor cl, byte [rdx + rax]
mov byte [rdx + rax], cl
mov rdx, qword [rdi + 0x130]
mov r8d, dword [rdi + 0x120]
mov r9d, dword [rdi + 0x128]
mov r10d, r8d
xor r10b, cl
movzx r10d, r10b
shr r8d, 8
xor r8d, dword [rdx + r10*4]
mov dword [rdi + 0x120], r8d
and r8d, ebx
add r8d, dword [rdi + 0x124]
imul r8d, r8d, 0x8088405
inc r8d
mov dword [rdi + 0x124], r8d
shr r8d, 0x18
mov r10d, r9d
and r10d, ebx
xor r10d, r8d
shr r9d, 8
xor r9d, dword [rdx + r10*4]
mov dword [rdi + 0x128], r9d
mov rdx, qword [r13]
mov byte [rdx + rax], cl
inc rax
cmp r15, rax
jne 0x14012f2b7
add qword [r13 + 0x60], r15
sub qword [r13 + 0x98], r15
mov rax, qword [r13]
mov qword [r13 + 8], rax
mov dword [r13 + 0x10], r15d
jmp 0x14012f1da