Function at 0x1401225a0
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 r15d, 0xffffff9a
test rcx, rcx
je 0x14012288a
mov r13, rcx
mov rbp, qword [rcx + 0x110]
test rbp, rbp
je 0x14012288a
cmp qword [rbp], 0
je 0x140122884
xor r15d, r15d
test r8d, r8d
je 0x14012288a
mov qword [rbp + 0x18], rdx
mov dword [rbp + 0x20], r8d
mov edx, r8d
mov rax, qword [rbp + 0x98]
mov ecx, dword [rbp + 0x10]
lea rbx, [rax + rcx]
cmp rbx, rdx
jae 0x14012261b
cmp dword [rbp + 0x118], 0
je 0x14012261b
add eax, ecx
mov dword [rbp + 0x20], eax
je 0x14012288a
lea rax, [rbp + 8]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xa8]
mov qword [rsp + 0x30], rax
xor r15d, r15d
mov r14d, 0xff
mov r12d, dword [rbp + 0x10]
test r12d, r12d
je 0x14012269f
mov eax, dword [rbp + 0x108]
test eax, eax
je 0x140122659
cmp dword [rbp + 0x118], 0
je 0x14012281a
test r12d, r12d
jne 0x14012266c
cmp qword [rbp + 0x98], 0
je 0x14012289e
mov eax, dword [rbp + 0x20]
cmp eax, r12d
cmovb r12d, eax
test r12d, r12d
je 0x1401227cf
mov esi, r12d
xor eax, eax
mov rcx, qword [rbp + 8]
mov rdx, qword [rbp + 0x18]
mov cl, byte [rcx + rax]
mov byte [rdx + rax], cl
inc rax
cmp rsi, rax
jne 0x140122684
jmp 0x1401227d1
mov r12, qword [rbp + 0x98]
test r12, r12
je 0x14012287c
mov eax, 0x4000
cmp r12, rax
cmovae r12, 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.140132d20
mov esi, 0xffffffff
test eax, eax
jne 0x1401228a1
mov r8, qword [rbp]
mov rax, qword [rbp + 0xb0]
mov rdx, qword [rbp + 0x100]
mov rcx, qword [rbp + 0xe0]
mov r9d, r12d
call qword [0x14019d008]
cmp eax, r12d
jne 0x1401228a1
cmp dword [r13 + 0x118], 0
je 0x1401227b3
xor eax, eax
mov edx, dword [r13 + 0x128]
mov ecx, edx
and ecx, 0xfffd
or edx, 2
xor ecx, 3
imul ecx, edx
shr ecx, 8
mov rdx, qword [rbp]
xor cl, byte [rdx + rax]
mov byte [rdx + rax], cl
mov rdi, qword [r13 + 0x130]
mov esi, dword [r13 + 0x120]
mov ebx, dword [r13 + 0x128]
mov edx, esi
xor dl, cl
movzx edx, dl
shr esi, 8
xor esi, dword [rdi + rdx*4]
mov dword [r13 + 0x120], esi
and esi, r14d
add esi, dword [r13 + 0x124]
imul edx, esi, 0x8088405
inc edx
mov dword [r13 + 0x124], edx
shr edx, 0x18
mov esi, ebx
and esi, r14d
xor esi, edx
shr ebx, 8
xor ebx, dword [rdi + rsi*4]
mov dword [r13 + 0x128], ebx
mov rdx, qword [rbp]
mov byte [rdx + rax], cl
inc rax
cmp r12, rax
jne 0x140122722
add qword [rbp + 0x60], r12
sub qword [rbp + 0x98], r12
mov rax, qword [rbp]
mov qword [rbp + 8], rax
mov dword [rbp + 0x10], r12d
jmp 0x140122642
xor esi, esi
add qword [rbp + 0x88], rsi
mov rdx, qword [rbp + 0x18]
mov ecx, dword [rbp + 0x90]
mov r8d, r12d
call fcn.140036c80
mov dword [rbp + 0x90], eax
sub qword [rbp + 0xa0], rsi
sub dword [rbp + 0x10], r12d
sub dword [rbp + 0x20], r12d
add qword [rbp + 0x18], rsi
add qword [rbp + 8], rsi
add dword [rbp + 0x24], r12d
add r15d, r12d
cmp dword [rbp + 0x20], 0
jne 0x140122639
jmp 0x14012288a
cmp eax, 0xc
je 0x14012280e
mov esi, dword [rbp + 0x24]
mov r12, qword [rbp + 0x18]
mov rcx, qword [rsp + 0x28]
mov edx, 2
call fcn.14006c1a0
mov edi, eax
test eax, eax
js 0x140122848
cmp qword [rbp + 0x28], 0
mov eax, 0xfffffffd
cmovne edi, eax
mov ebx, dword [rbp + 0x24]
mov ecx, dword [rbp + 0x90]
sub rbx, rsi
add qword [rbp + 0x88], rbx
mov rdx, r12
mov r8d, ebx
call fcn.140036c80
mov dword [rbp + 0x90], eax
sub qword [rbp + 0xa0], rbx
add r15d, ebx
test edi, edi
je 0x14012280e
jmp 0x1401228a6
xor r12d, r12d
jmp 0x140122642
mov r15d, 0xffffff9c
mov eax, r15d
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov esi, r15d
mov r15d, esi
jmp 0x14012288a
mov esi, r15d
mov r15d, edi
cmp edi, 1
jne 0x14012288a
jmp 0x1401228a1