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

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x20
mov edi, 4
mov rax, qword gs:[0x58]
mov rbx, qword [rax]
lea r15, [0x140119290]
mov eax, dword [rdi + rbx]
cmp dword [0x14011a684], eax
jle 0x140040917
lea rcx, [0x14011a684]
call fcn.1400bc818
cmp dword [0x14011a684], 0xffffffff
jne 0x140040917
call qword [sym.imp.MSVCP140.dll_unsigned_int___cdecl_std::_Random_device_void_]
mov dword [0x14011a614], 0xffffffff
mov dword [0x140119294], eax
mov r8d, 1
nop dword [rax]
nop word [rax + rax]
mov edx, eax
shr edx, 0x1e
xor edx, eax
imul eax, edx, 0x6c078965
add eax, r8d
mov dword [r15 + r8*4 + 4], eax
inc r8
cmp r8, 0x270
jb 0x1400408e0
mov dword [0x140119290], 0x270
lea rcx, [0x14011a684]
call fcn.1400bc7ac
xor esi, esi
mov eax, dword [rdi + rbx]
cmp dword [0x14011a68c], eax
jle 0x140040955
lea rcx, [0x14011a68c]
call fcn.1400bc818
cmp dword [0x14011a68c], 0xffffffff
jne 0x140040955
mov dword [0x14011a628], esi
mov dword [0x14011a62c], 1
lea rcx, [0x14011a68c]
call fcn.1400bc7ac
mov eax, dword [rdi + rbx]
cmp dword [0x14011a680], eax
jle 0x140040991
lea rcx, [0x14011a680]
call fcn.1400bc818
cmp dword [0x14011a680], 0xffffffff
jne 0x140040991
mov dword [0x14011a620], esi
mov dword [0x14011a624], 0x7bc
lea rcx, [0x14011a680]
call fcn.1400bc7ac
mov eax, dword [rdi + rbx]
cmp dword [0x14011a61c], eax
jle 0x1400409cd
lea rcx, [0x14011a61c]
call fcn.1400bc818
cmp dword [0x14011a61c], 0xffffffff
jne 0x1400409cd
mov dword [0x14011a630], esi
mov dword [0x14011a634], 0x438
lea rcx, [0x14011a61c]
call fcn.1400bc7ac
mov dword [rsp + 0x60], 3
mov r14d, 0x3e8
mov r12d, 0xffffffff
nop dword [rax]
nop word [rax + rax]
mov esi, dword [0x14011a630]
btc esi, 0x1f
mov eax, dword [0x14011a634]
btc eax, 0x1f
sub eax, esi
mov rcx, r15
cmp eax, 0xffffffff
jne 0x140040a17
call fcn.14005a570
mov ecx, eax
jmp 0x140040a56
lea ebx, [rax + 1]
call fcn.14005a570
mov edi, ebx
mov ecx, eax
imul rcx, rdi
cmp ecx, ebx
jae 0x140040a52
mov eax, ebx
neg eax
xor edx, edx
div ebx
mov ebx, edx
cmp ecx, edx
jae 0x140040a52
nop dword [rax]
mov rcx, r15
call fcn.14005a570
mov ecx, eax
imul rcx, rdi
cmp ecx, ebx
jb 0x140040a40
shr rcx, 0x20
lea eax, [rcx + rsi]
xor eax, 0x80000000
movd xmm1, eax
cvtdq2ps xmm1, xmm1
mov esi, dword [0x14011a620]
btc esi, 0x1f
mov eax, dword [0x14011a624]
btc eax, 0x1f
sub eax, esi
mov rcx, r15
cmp eax, 0xffffffff
jne 0x140040a8c
call fcn.14005a570
mov ecx, eax
jmp 0x140040ac6
lea ebx, [rax + 1]
call fcn.14005a570
mov edi, ebx
mov ecx, eax
imul rcx, rdi
cmp ecx, ebx
jae 0x140040ac2
mov eax, ebx
neg eax
xor edx, edx
div ebx
mov ebx, edx
cmp ecx, edx
jae 0x140040ac2
nop
mov rcx, r15
call fcn.14005a570
mov ecx, eax
imul rcx, rdi
cmp ecx, ebx
jb 0x140040ab0
shr rcx, 0x20
lea eax, [rcx + rsi]
xor eax, 0x80000000
movd xmm0, eax
cvtdq2ps xmm0, xmm0
movss dword [rsp + 0x68], xmm0
movss dword [rsp + 0x6c], xmm1
mov rdx, qword [0x140116df0]
cmp rdx, qword [0x140116df8]
je 0x140040b08
unpcklps xmm0, xmm1
movsd qword [rsp + 0x68], xmm0
movsd qword [rdx], xmm0
add qword [0x140116df0], 8
jmp 0x140040b19
lea r8, [rsp + 0x68]
lea rcx, [0x140116de8]
call fcn.1400594e0
mov ebx, dword [0x14011a628]
btc ebx, 0x1f
mov edi, dword [0x14011a62c]
btc edi, 0x1f
sub edi, ebx
mov rcx, r15
cmp edi, 0xffffffff
jne 0x140040b64
call fcn.14005a570
lea ecx, [rbx + rax]
mov eax, 1
cmp ecx, 0x80000000
cmove eax, r12d
movd xmm1, eax
cvtdq2ps xmm1, xmm1
mov rcx, r15
call fcn.14005a570
mov ecx, eax
jmp 0x140040bf6
lea esi, [rdi + 1]
call fcn.14005a570
mov ebp, esi
mov ecx, eax
imul rcx, rbp
cmp ecx, esi
jae 0x140040b98
mov eax, esi
neg eax
xor edx, edx
div esi
mov esi, edx
cmp ecx, edx
jae 0x140040b98
mov rcx, r15
call fcn.14005a570
mov ecx, eax
imul rcx, rbp
cmp ecx, esi
jb 0x140040b86
shr rcx, 0x20
inc edi
lea eax, [rbx + rcx]
mov ecx, 1
cmp eax, 0x80000000
cmove ecx, r12d
movd xmm0, ecx
cvtdq2ps xmm0, xmm0
mov rcx, r15
call fcn.14005a570
mov esi, edi
mov ecx, eax
imul rcx, rsi
movaps xmm1, xmm0
cmp ecx, edi
jae 0x140040bf2
mov eax, edi
neg eax
xor edx, edx
div edi
mov edi, edx
cmp ecx, edx
jae 0x140040bf2
nop dword [rax + rax]
mov rcx, r15
call fcn.14005a570
mov ecx, eax
imul rcx, rsi
cmp ecx, edi
jb 0x140040be0
shr rcx, 0x20
lea eax, [rcx + rbx]
mov ecx, 1
cmp eax, 0x80000000
cmove ecx, r12d
movd xmm0, ecx
cvtdq2ps xmm0, xmm0
movss dword [rsp + 0x70], xmm0
movss dword [rsp + 0x74], xmm1
mov rdx, qword [0x140116e08]
cmp rdx, qword [0x140116e10]
je 0x140040c41
unpcklps xmm0, xmm1
movsd qword [rsp + 0x70], xmm0
movsd qword [rdx], xmm0
add qword [0x140116e08], 8
jmp 0x140040c52
lea r8, [rsp + 0x70]
lea rcx, [0x140116e00]
call fcn.1400594e0
mov rdx, qword [0x140116ea0]
cmp rdx, qword [0x140116ea8]
je 0x140040c72
mov dword [rdx], 3
add qword [0x140116ea0], 4
jmp 0x140040c7c
lea r8, [rsp + 0x60]
call fcn.140059680
sub r14, 1
jne 0x1400409f0
add rsp, 0x20
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret