Function at 0x409910
Capabilities:
Generate random numbers using a mersenne twister

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x461f0d
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x480054]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x28]
push 0x14
mov dword [ebp - 0x28], 0
push str.sound_music_default_
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0xf
mov byte [ebp - 0x28], 0
call fcn.00421450
mov dword [ebp - 4], 0
add dword [edi + 0x9c0], 0xffffffff
jne 0x40997e
mov ecx, edi
call fcn.00401e10
mov eax, dword [edi + 0x9c4]
mov ecx, dword [eax]
add eax, 4
mov dword [edi + 0x9c4], eax
mov eax, ecx
shr eax, 0xb
xor ecx, eax
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
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
addsd xmm0, qword [eax*8 + 0x478570]
mulsd xmm0, qword [0x478068]
mulsd xmm0, qword [0x4780c0]
cvttsd2si eax, xmm0
test eax, eax
jne 0x409a6a
mov ecx, dword [ebp - 0x18]
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, 0xa
jb 0x409b6c
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
push 0xa
cmovae eax, dword [ebp - 0x28]
push str.bgm_01.ogg
push ecx
push eax
push ecx
push dword [ebp - 0x44]
lea ecx, [ebp - 0x40]
call fcn.00426550
cmp dword [ebp - 0x2c], 0x10
lea eax, [ebp - 0x40]
push 1
cmovae eax, dword [ebp - 0x40]
lea ecx, [esi + 0xd70]
push 1
push eax
lea eax, [esi + 0xdc4]
push eax
call fcn.004087c0
mov ecx, dword [ebp - 0x2c]
cmp ecx, 0x10
jb 0x409ad2
mov edx, dword [ebp - 0x40]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x409ac8
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409b71
jmp 0x409ac8
cmp eax, 1
jne 0x409a99
mov ecx, dword [ebp - 0x18]
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, 0xa
jb 0x409b76
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
push 0xa
cmovae eax, dword [ebp - 0x28]
push str.bgm_02.ogg
jmp 0x409a0a
cmp eax, 2
jne 0x409ad2
mov ecx, dword [ebp - 0x18]
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, 0xa
jb 0x409b7b
cmp dword [ebp - 0x14], 0x10
lea eax, [ebp - 0x28]
push 0xa
cmovae eax, dword [ebp - 0x28]
push str.bgm_03.ogg
jmp 0x409a0a
push ecx
push edx
call fcn.0042e51d
add esp, 8
mov eax, dword [esi + 0xdb0]
inc eax
cdq
idiv dword [esi + 0xdb4]
mov dword [esi + 0xdb0], edx
mov ecx, dword [esi + edx*4 + 0xd70]
test ecx, ecx
je 0x409b0a
mov eax, dword [esi + 0xdbc]
push ecx
movss xmm0, dword [eax]
movss dword [esp], xmm0
push 2
push ecx
call dword [sym.imp.BASS.dll_BASS_ChannelSetAttribute]
mov eax, dword [esi + 0xdb0]
push 1
push dword [esi + eax*4 + 0xd70]
call dword [sym.imp.BASS.dll_BASS_ChannelPlay]
mov ecx, dword [ebp - 0x14]
cmp ecx, 0x10
jb 0x409b4f
mov edx, dword [ebp - 0x28]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x409b45
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409b71
push ecx
push edx
call fcn.0042e51d
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042e28e
mov esp, ebp
pop ebp
ret 4
call fcn.00406370
call fcn.0043c5ff
call fcn.00406370
call fcn.00406370
int3