Function at 0x1800ca570
Capabilities:
Encode data using xor
Generate random numbers using a mersenne twister

Disassembly:
push rbx
push rsi
push rdi
sub rsp, 0x30
mov rbx, qword [rcx + 8]
mov rsi, rcx
sub rbx, qword [rcx]
sar rbx, 2
lea eax, [rbx - 1]
movsxd rdi, eax
test eax, eax
jle 0x1800ca7c5
mov ecx, dword [0x18019863c]
mov rax, qword gs:[0x58]
mov qword [rsp + 0x50], rbp
lea rbp, [0x1801971c0]
mov qword [rsp + 0x58], r12
lea r12, [0x1801971c8]
mov qword [rsp + 0x60], r14
mov r14, qword [rax + rcx*8]
mov qword [rsp + 0x68], r15
movaps xmmword [rsp + 0x20], xmm6
movsd xmm6, qword [0x180174e10]
mov r15d, 0x54
nop dword [rax]
mov eax, dword [r14 + r15]
cmp dword [0x180198548], eax
jg 0x1800ca7cd
mov edx, dword [0x1801971c0]
cmp edx, 0x270
jne 0x1800ca654
mov r8, r12
mov r9d, edx
nop dword [rax]
nop dword [rax + rax]
mov edx, dword [r8 - 4]
xor edx, dword [r8]
lea r8, [r8 + 4]
btr edx, 0x1f
xor edx, dword [r8 - 8]
mov eax, edx
and al, 1
neg al
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [r8 + 0x62c]
xor ecx, edx
mov dword [r8 + 0x9b8], ecx
sub r9, 1
jne 0x1800ca610
mov edx, dword [0x1801971c0]
jmp 0x1800ca732
cmp edx, 0x4e0
jb 0x1800ca732
xor r8d, r8d
mov eax, dword [r8 + rbp + 0x9c4]
mov edx, eax
xor edx, dword [r8 + rbp + 0x9c8]
btr edx, 0x1f
xor edx, eax
mov eax, edx
and al, 1
neg al
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [r8 + rbp + 0xff8]
xor ecx, edx
mov dword [r8 + rbp + 4], ecx
add r8, 4
cmp r8, 0x38c
jb 0x1800ca663
mov r8d, 0x38c
nop dword [rax]
mov eax, dword [r8 + rbp + 0x9c4]
mov edx, eax
xor edx, dword [r8 + rbp + 0x9c8]
btr edx, 0x1f
xor edx, eax
mov eax, edx
and al, 1
neg al
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [r8 + rbp - 0x388]
xor ecx, edx
mov dword [r8 + rbp + 4], ecx
add r8, 4
cmp r8, 0x9bc
jb 0x1800ca6b0
mov edx, dword [0x180198540]
mov eax, dword [0x1801971c4]
and edx, 0x80000000
btr eax, 0x1f
or edx, eax
mov eax, edx
and al, 1
neg al
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, edx
xor ecx, dword [0x1801977f4]
xor edx, edx
mov dword [0x180197b80], ecx
mov dword [0x1801971c0], edx
mov eax, edx
xorps xmm1, xmm1
inc edx
movd xmm0, ebx
cvtdq2pd xmm0, xmm0
dec ebx
mov ecx, dword [rbp + rax*4 + 4]
mov eax, ecx
shr eax, 0xb
and eax, dword [0x180198544]
xor ecx, eax
mov dword [0x1801971c0], edx
mov r8, qword [rsi]
mov eax, ecx
and eax, 0xff3a58ad
shl eax, 7
xor ecx, eax
mov eax, ecx
and eax, 0xffffdf8c
shl eax, 0xf
xor ecx, eax
mov eax, ecx
shr eax, 0x12
xor eax, ecx
mov ecx, dword [r8 + rdi*4]
cvtsi2sd xmm1, rax
mulsd xmm1, xmm6
mulsd xmm1, xmm0
cvttsd2si eax, xmm1
movsxd rdx, eax
mov eax, dword [r8 + rdx*4]
mov dword [r8 + rdi*4], eax
dec rdi
mov dword [r8 + rdx*4], ecx
test rdi, rdi
jg 0x1800ca5e0
movaps xmm6, xmmword [rsp + 0x20]
mov r15, qword [rsp + 0x68]
mov r14, qword [rsp + 0x60]
mov r12, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x50]
add rsp, 0x30
pop rdi
pop rsi
pop rbx
ret
lea rcx, [0x180198548]
call fcn.180168cec
cmp dword [0x180198548], 0xffffffff
jne 0x1800ca5f0
mov edx, 0x2a
mov dword [0x180198544], 0xffffffff
mov dword [0x1801971c4], 0x2a
lea ecx, [rdx - 0x29]
nop dword [rax]
nop word [rax + rax]
mov eax, edx
shr eax, 0x1e
xor eax, edx
imul edx, eax, 0x6c078965
add edx, ecx
mov dword [rbp + rcx*4 + 4], edx
inc rcx
cmp rcx, 0x270
jb 0x1800ca810
lea rcx, [0x180198548]
mov dword [0x1801971c0], 0x270
call fcn.180168c7c
jmp 0x1800ca5f0