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

Disassembly:
xchg rbx, r12
mov qword [rsp + 8], r12
xchg rbx, r12
xchg r15, rbp
mov qword [rsp + 0x10], r15
xchg rbp, r15
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r12
push r14
nop
sub rsp, 8
mov qword [rsp], r15
mov r15d, edx
lea r14d, [rdx - 1]
xchg r11, rdi
mov r11, rcx
xchg r11, rdi
xor r12d, r12d
nop word [rax + rax]
mov esi, r12d
mov ebp, r12d
test r14d, r14d
je 0x140165c48
nop
movzx ecx, byte [rdi + 8]
sub cl, 1
shl esi, cl
add esi, esi
nop dword [rax + rax]
xchg r10, rcx
mov rcx, qword [rdi]
xchg rcx, r10
mov ecx, dword [r10]
cmp ecx, 0x270
jne 0x140165a8b
lea rax, [r10 + 8]
mov r9d, ecx
nop word [rax + rax]
mov r8d, dword [rax - 4]
xor r8d, dword [rax]
lea rax, [rax + 4]
btr r8d, 0x1f
xor r8d, dword [rax - 8]
mov ecx, r8d
and cl, 1
neg cl
sbb edx, edx
shr r8d, 1
and edx, 0x9908b0df
xor edx, dword [rax + 0x62c]
xor edx, r8d
mov dword [rax + 0x9b8], edx
sub r9, 1
jne 0x140165a43
mov ecx, dword [r10]
jmp 0x140165bca
cmp ecx, 0x4e0
jb 0x140165bca
lea r11, [r10 + 0x9c4]
mov ebx, 0x2954523b
xor ebx, 0xf80bcd2
xor ebx, 0x4d0652eb
sub ebx, 0x16190a1b
xor ebx, 0x775f26d7
sub ebx, 0x18c5b9f6
sub ebx, 0x7b68c96
add ebx, 0x56495a24
sub ebx, 0x58b3a9e5
mov eax, dword [r11]
nop
mov edx, dword [r11 + 4]
lea r8, [r11 + 4]
xor edx, eax
btr edx, 0x1f
xor edx, eax
mov eax, edx
and al, 1
neg al
mov eax, dword [r8]
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [r11 + 0x634]
xor ecx, edx
mov dword [r11 - 0x9c0], ecx
lea r11, [r8]
sub rbx, 1
jne 0x140165ad7
lea r11, [r10 + 0xd50]
mov ebx, 0x5ced1ebd
sub ebx, 0x4ebe9d4f
xor ebx, 0x7b670707
xor ebx, 0x2ad176ed
xor ebx, 0x53cc64cc
xor ebx, 0x63b1d77d
xor ebx, 0x6fe542b9
mov eax, dword [r11]
nop dword [rax + rax]
mov edx, eax
lea r8, [r11 + 4]
xor edx, dword [r8]
btr edx, 0x1f
xor edx, eax
mov eax, edx
and al, 1
neg al
mov eax, dword [r8]
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [r11 - 0xd4c]
xor ecx, edx
mov dword [r11 - 0x9c0], ecx
lea r11, [r8]
sub rbx, 1
jne 0x140165b4f
mov edx, dword [r10 + 0x1380]
xor edx, dword [r10 + 4]
btr edx, 0x1f
xor edx, dword [r10 + 0x1380]
mov eax, edx
and al, 1
neg al
sbb ecx, ecx
shr edx, 1
and ecx, 0x9908b0df
xor ecx, dword [r10 + 0x634]
xor ecx, edx
mov dword [r10 + 0x9c0], ecx
mov ecx, r12d
mov dword [r10], r12d
mov eax, ecx
mov edx, dword [r10 + rax*4 + 4]
lea eax, [rcx + 1]
mov dword [r10], eax
mov ecx, edx
mov eax, dword [r10 + 0x1384]
shr ecx, 3
shr ecx, 5
shr ecx, 1
shr ecx, 1
shr ecx, 1
and eax, ecx
xor edx, eax
mov eax, edx
and eax, 0xff3a58ad
shl eax, 3
shl eax, 1
shl eax, 1
shl eax, 2
xor edx, eax
mov eax, edx
and eax, 0xffffdf8c
shl eax, 0xb
shl eax, 2
shl eax, 1
shl eax, 1
xor edx, eax
mov eax, edx
shr eax, 3
shr eax, 0xb
shr eax, 3
shr eax, 1
xor eax, edx
mov edx, dword [rdi + 0x10]
cmp eax, edx
ja 0x140165a19
movzx ecx, byte [rdi + 8]
or esi, eax
add cl, 0xff
shl ebp, cl
add ebp, ebp
or ebp, edx
cmp ebp, r14d
jb 0x140165a09
xor edx, edx
mov eax, ebp
div r15d
mov ecx, eax
mov r8d, edx
xor edx, edx
mov eax, esi
div r15d
cmp eax, ecx
jb 0x140165c6c
cmp r8d, r14d
jne 0x1401659f9
xchg r15, rbx
mov r15, qword [rsp + 0x20]
xchg r15, rbx
mov eax, edx
xchg rbp, r9
mov r9, qword [rsp + 0x28]
xchg r9, rbp
mov rsi, qword [rsp + 0x30]
mov rdi, qword [rsp + 0x38]
nop
xchg qword [rsp], r15
add rsp, 8
nop
add rsp, 8
xchg qword [rsp - 8], r14
nop
add rsp, 8
xchg qword [rsp - 8], r12
ret