Function at 0x140055210
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, 0x48
mov rax, qword [0x140178028]
xor rax, rsp
mov qword [rsp + 0x40], rax
movabs rax, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x38], 0xaaaaaaaa
mov r15d, 0xffffff9a
test rcx, rcx
je 0x1400552c9
mov rbx, rcx
cmp qword [rcx + 0x90], 0
je 0x1400552c9
mov ebp, r9d
mov rsi, r8
mov rdi, rdx
mov r14, qword [rbx + 0x110]
test r14, r14
je 0x1400552a5
mov rcx, qword [r14]
call fcn.140084fc0
mov qword [r14], 0
cmp dword [r14 + 0x68], 8
jne 0x140055292
lea rcx, [r14 + 8]
call fcn.140023910
mov rcx, r14
call fcn.140084fc0
mov qword [rbx + 0x110], 0
mov rdx, qword [rbx + 0x60]
mov r8, qword [rbx + 0x78]
add r8, qword [rbx + 0x108]
mov rcx, rbx
xor r9d, r9d
call fcn.14005a680
mov r15d, 0xffffff99
test eax, eax
je 0x1400552fa
mov dword [rsp + 0x28], ebp
mov r14, qword [rbx + 0x60]
lea r8, [rsp + 0x2c]
mov dword [r8], 0xaaaaaaaa
mov rax, qword [rbx + 8]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
mov r9d, 4
call qword [0x14016adc0]
cmp eax, 4
jne 0x140055aeb
xor r15d, r15d
mov r12d, dword [rsp + 0x2c]
xor ebp, ebp
cmp r12d, 0x4034b50
mov r13d, 0xffffff99
cmove r13d, ebp
mov r14, qword [rbx + 0x60]
lea r8, [rsp + 0x2c]
mov word [r8], 0xaaaa
mov rax, qword [rbx + 8]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
mov r9d, 2
call qword [0x14016adc0]
cmp eax, 2
je 0x14005538b
mov rax, qword [rbx + 0x30]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
call qword [0x14016adc0]
xor ebp, ebp
neg eax
sbb ebp, ebp
mov r14, qword [rbx + 0x60]
lea r8, [rsp + 0x2c]
mov word [r8], 0xaaaa
mov rax, qword [rbx + 8]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
mov r9d, 2
call qword [0x14016adc0]
cmp eax, 2
je 0x1400553da
mov rax, qword [rbx + 0x30]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
call qword [0x14016adc0]
mov dword [rsp + 0x24], 0
neg eax
mov eax, 0
sbb eax, eax
jmp 0x1400553e5
movzx eax, word [rsp + 0x2c]
mov dword [rsp + 0x24], eax
xor eax, eax
or eax, ebp
or eax, r15d
sete bpl
mov r15d, 0xffffffff
cmovne r13d, r15d
mov r14, qword [rbx + 0x60]
lea r8, [rsp + 0x2c]
mov word [r8], 0xaaaa
mov rax, qword [rbx + 8]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
mov r9d, 2
call qword [0x14016adc0]
cmp eax, 2
jne 0x14005548f
movzx eax, word [rsp + 0x2c]
cmp r12d, 0x4034b50
sete cl
and bpl, cl
mov r15d, r13d
cmp bpl, 1
jne 0x1400554a4
mov r15d, 0xffffff99
cmp eax, dword [rbx + 0xbc]
jne 0x1400554a4
cmp eax, 0xc
ja 0x14005545e
xor r15d, r15d
mov ecx, 0x1101
bt ecx, eax
jb 0x1400554a4
mov r15d, 0xffffff99
jmp 0x1400554a4
xor eax, eax
jmp 0x140055428
mov rax, qword [rbx + 0x30]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
call qword [0x14016adc0]
test eax, eax
je 0x140055466
mov r14, qword [rbx + 0x60]
lea r8, [rsp + 0x2c]
mov dword [r8], 0xaaaaaaaa
mov rax, qword [rbx + 8]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
mov r9d, 4
call qword [0x14016adc0]
xor r12d, r12d
cmp eax, 4
jne 0x140055acd
mov r14, qword [rbx + 0x60]
lea r8, [rsp + 0x2c]
mov dword [r8], 0xaaaaaaaa
mov rax, qword [rbx + 8]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
mov r9d, 4
call qword [0x14016adc0]
cmp eax, 4
jne 0x140055a5d
mov eax, dword [rsp + 0x2c]
mov rax, qword [rbx + 0x30]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
call qword [0x14016adc0]
mov ebp, 0xffffffff
test eax, eax
jne 0x14005551b
xor eax, eax
jmp fcn.14005550b
mov rax, qword [rbx + 0x30]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
call qword [0x14016adc0]
xor r12d, r12d
neg eax
sbb r12d, r12d
jmp 0x1400554d7
mov rax, qword [rbx + 0x30]
mov rcx, qword [rbx + 0x38]
mov rdx, r14
call qword [0x14016adc0]
xor r12d, r12d
neg eax
mov r15d, 0
sbb r15d, r15d
jmp 0x140055336