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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
push ebx
xor ebx, ebx
push esi
mov esi, eax
mov eax, dword [0xd5dd7c]
push edi
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], eax
mov dword [0xd5dd7c], ebx
mov dword [esp + 0x1c], 1
mov dword [esp + 0x30], 0xffffffff
mov byte [esp + 0x12], 0xa
mov byte [0xd5dd84], bl
mov byte [0xd5dd7b], bl
mov byte [0xd5dd7a], bl
mov dword [0xd5dd80], ebx
mov byte [esp + 0x17], bl
mov byte [esp + 0x14], bl
mov byte [esp + 0x15], bl
mov byte [esp + 0x18], bl
mov byte [esp + 0x13], bl
mov byte [esp + 0x16], bl
cmp byte [esi], bl
je 0x1004ca63
movsx ecx, byte [esi]
push ecx
call fcn.10094d5b
add eax, 0xffffffbd
add esp, 4
cmp eax, 0x19
ja 0x1004ca59
movzx edx, byte [eax + 0xcec718]
jmp dword [edx*4 + 0xcec6f0]
inc esi
cmp byte [esi], 0
jne 0x1004c8e0
mov edx, dword [ebp + 0xc]
mov cl, byte [edx]
test cl, cl
je 0x1004d239
mov edx, dword [0xd5ef10]
mov al, byte [edx + 0x17]
mov dword [esp + 0x20], edx
test al, al
jne 0x1004ca87
mov eax, dword [edx + 0xc]
mov al, byte [eax + 0x17]
cmp al, 2
ja 0x1004d239
mov ebx, dword [ebp + 0xc]
mov esi, 1
mov dword [esp + 0x1c], esi
mov eax, ebx
lea ecx, [ecx]
cmp cl, byte [esp + 0x12]
jne 0x1004caaa
add dword [esp + 0x1c], esi
mov cl, byte [eax + esi]
add eax, esi
test cl, cl
jne 0x1004caa0
mov edi, eax
sub edi, ebx
mov dword [esp + 0x2c], edi
cmp byte [esp + 0x17], cl
jne 0x1004cad4
cmp eax, ebx
jbe 0x1004cad4
mov cl, byte [eax - 1]
cmp cl, byte [esp + 0x12]
jne 0x1004cad4
sub dword [esp + 0x1c], esi
jmp 0x1004caf9
cmp byte [esp + 0x12], 0xa
jne 0x1004cafe
push 0xa
push ebx
call fcn.10091b1e
add esp, 8
test eax, eax
je 0x1004cafe
cmp eax, ebx
jbe 0x1004cafe
cmp byte [eax - 1], 0xd
jne 0x1004cafe
mov byte [esp + 0x15], 1
mov byte [esp + 0x14], 1
cmp dword [esp + 0x1c], esi
jne 0x1004cb1b
mov ecx, dword [esp + 0x20]
push esi
push 0
push edi
push ebx
call fcn.100811b0
mov dword [esp + 0x1c], eax
jmp 0x1004d239
cmp dword [0xd5dd7c], 0
jne 0x1004cb2b
cmp byte [esp + 0x15], 0
je 0x1004cb7b
lea edx, [edi + 3]
push edx
call fcn.1009192d
mov esi, eax
add esp, 4
mov dword [esp + 0x38], esi
test esi, esi
jne 0x1004cb48
push eax
mov eax, dword [ebp + 8]
push eax
jmp 0x1004cbad
lea ecx, [edi + 1]
push ecx
push ebx
push esi
call fcn.1009aea0
add esp, 0xc
cmp byte [esp + 0x15], 0
mov dword [ebp + 0xc], esi
je 0x1004cb7b
mov dx, word [0xd53d90]
mov word [edi + esi], dx
mov al, byte [0xd53d92]
mov byte [edi + esi + 2], al
add edi, 2
mov dword [esp + 0x2c], edi
mov ecx, dword [esp + 0x1c]
xor eax, eax
cmp byte [esp + 0x13], al
setne al
inc ecx
inc eax
add eax, eax
add eax, eax
imul ecx, eax
push ecx
mov dword [esp + 0x28], eax
call fcn.1009192d
mov ebx, eax
add esp, 4
mov dword [esp + 0x34], ebx
test ebx, ebx
jne 0x1004cbc5
mov edx, dword [ebp + 8]
push eax
push edx
mov edx, 0xd4bc99
mov ecx, 0xd4f75c
call fcn.1003ef70
mov dword [esp + 0x1c], eax
jmp 0x1004d239
mov esi, dword [ebp + 0xc]
mov dword [ebx], esi
cmp byte [esi], 0
mov edi, ebx
mov dword [esp + 0x1c], 0
mov edx, 1
je 0x1004cc54
mov al, byte [esi]
cmp al, byte [esp + 0x12]
jne 0x1004cc4d
add dword [esp + 0x1c], edx
cmp byte [esp + 0x13], 0
mov byte [esi], 0
je 0x1004cc44
sub dword [0xd5b404], edx
jne 0x1004cc06
call fcn.1001d270
mov edx, 1
mov ecx, dword [0xd5debc]
mov eax, dword [ecx]
add ecx, 4
mov dword [0xd5debc], ecx
mov ecx, eax
shr ecx, 0xb
xor eax, ecx
mov ecx, eax
and ecx, 0xff3a58ad
shl ecx, 7
xor eax, ecx
mov ecx, eax
and ecx, 0xffffdf8c
shl ecx, 0xf
xor eax, ecx
mov ecx, eax
shr ecx, 0x12
xor ecx, eax
shr ecx, 1
mov dword [edi + 4], ecx
add edi, dword [esp + 0x24]
lea eax, [esi + 1]
mov dword [edi], eax
add esi, edx
cmp byte [esi], 0
jne 0x1004cbde
cmp byte [esp + 0x14], 0
jne 0x1004ccb1
add dword [esp + 0x1c], edx
cmp byte [esp + 0x13], 0
je 0x1004ccb1
sub dword [0xd5b404], edx
jne 0x1004cc73
call fcn.1001d270
mov ecx, dword [0xd5debc]
mov eax, dword [ecx]
add ecx, 4
mov dword [0xd5debc], ecx
mov ecx, eax
shr ecx, 0xb
xor eax, ecx
mov edx, eax
and edx, 0xff3a58ad
shl edx, 7
xor eax, edx
mov ecx, eax
and ecx, 0xffffdf8c
shl ecx, 0xf
xor eax, ecx
mov edx, eax
shr edx, 0x12
xor edx, eax
shr edx, 1
mov dword [edi + 4], edx
cmp dword [0xd5dd7c], 0
je 0x1004cccb
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x1c]
push 0xcebb10
push eax
push ecx
jmp 0x1004ccff
cmp byte [esp + 0x13], 0
je 0x1004cce3
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
push 0xcebb00
push edx
push eax
jmp 0x1004ccff
cmp byte [esp + 0x18], 0
mov eax, 0xceba90
jne 0x1004ccf4
mov eax, 0xceb960
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x1c]
push eax
push ecx
push edx
push ebx
call fcn.10093d20
mov ecx, dword [esp + 0x3c]
mov esi, dword [esp + 0x30]
mov al, byte [esi + 0x17]
add esp, 0x10
mov ebx, ecx
mov dword [esp + 0x2c], ebx
test al, al
jne 0x1004cd2e
push 1
push 0
push ecx
mov ecx, dword [esi + 0xc]
push 0
call fcn.100811b0
jmp 0x1004cd9e
mov byte [esp + 0x13], 1
mov dl, 1
cmp ecx, 0xffffffff
jne 0x1004cd4a
mov dword [esp + 0x2c], 0
mov ebx, dword [esp + 0x2c]
xor dl, dl
jmp 0x1004cd4f
mov byte [esp + 0x13], 0
lea edi, [ebx + 1]
cmp al, 2
jne 0x1004cd7d
cmp byte [esp + 0x13], 0
je 0x1004cd6b
push 0xd4bc99
mov eax, ebx
call fcn.10004220
jmp 0x1004cd9e
mov esi, 0xd61678
call fcn.100042a0
neg eax
sbb eax, eax
neg eax
jmp 0x1004cd9e
cmp edi, dword [0xd5b440]
jbe 0x1004cdb0
cmp edi, dword [esi + 0x10]
jbe 0x1004cdb0
push 0xd4bc99
push 0xd549a4
mov ecx, 0xd61028
call fcn.1003f250
cmp eax, 1
je 0x1004cdcd
mov dword [esp + 0x1c], 0
jmp 0x1004d239
cmp edi, 2
jae 0x1004ce5c
xor eax, eax
test dl, dl
setne al
mov ecx, esi
add eax, 3
push eax
xor al, al
call fcn.100816c0
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x34]
xor esi, esi
push esi
push 1
mov dword [esp + 0x34], esi
call fcn.10001e30
mov edi, eax
mov dword [esp + 0x18], edi
mov dword [esp + 0x28], esi
cmp dword [esp + 0x1c], esi
jbe 0x1004d0d2
jmp 0x1004ce00
cmp byte [esp + 0x16], 0
je 0x1004d138
test esi, esi
je 0x1004d138
cmp byte [0xd5dd7b], 0
je 0x1004d0fd
cmp dword [0xd5dd80], 0
jne 0x1004d0fd
mov edi, dword [ebx]
mov eax, edi
call fcn.1000b6a0
test al, al
je 0x1004d04f
push 0x10
push 0
push edi
call fcn.1009379e
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], edx
fild qword [esp + 0x4c]
add esp, 0xc
jmp 0x1004d058
mov al, byte [esi + 0x15]
test al, 2
je 0x1004ce72
and al, 0x3d
mov byte [esi + 0x15], al
mov eax, dword [esi]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov edx, dword [esi + 0x10]
and byte [esi + 0x15], 0x82
cmp edi, edx
jbe 0x1004cea8
mov cl, byte [esi + 0x14]
cmp cl, 1
jbe 0x1004cedb
cmp cl, 2
je 0x1004cf13
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x20]
and byte [ecx + 0x15], 0x7f
mov dword [ecx + 0x10], esi
mov esi, dword [esp + 0x20]
mov dword [ecx + 8], eax
cmp byte [esp + 0x13], 0
mov eax, dword [esi + 8]
je 0x1004d044
cmp eax, 0xd4bc99
je 0x1004cecc
push ebx
push 0xd4bc99
push eax
call fcn.10091210
add esp, 0xc
mov edx, dword [esi + 8]
mov byte [ebx + edx], 0
mov dword [esi + 0xc], ebx
jmp 0x1004cdcd
cmp edi, 0x40
ja 0x1004cf13
cmp edi, 4
ja 0x1004ceec
mov esi, 4
jmp 0x1004cefa
mov eax, 8
cmp eax, edi
sbb esi, esi
and esi, 0x38
add esi, eax
mov eax, esi
call fcn.1007b790
test eax, eax
je 0x1004cda3
mov ecx, dword [esp + 0x20]
mov byte [ecx + 0x14], 1
jmp 0x1004ce9a
cmp edi, 0x10
jae 0x1004cf22
mov esi, 0x10
jmp 0x1004cfd2
cmp edi, 0x104
jae 0x1004cf34
mov esi, 0x104
jmp 0x1004cfd2
cmp edi, 0x28000
jae 0x1004cf78
mov dword [esp + 0x28], edi
fild dword [esp + 0x28]
test edi, edi
jns 0x1004cf4e
fadd qword [0xd55640]
fmul qword [0xd55650]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x28], eax
fldcw word [esp + 0x28]
fistp qword [esp + 0x50]
mov esi, dword [esp + 0x50]
fldcw word [esp + 0x18]
jmp 0x1004cfd2
cmp edi, 0x190000
jae 0x1004cf88
lea esi, [edi + 0x4000]
jmp 0x1004cfd2
cmp edi, 0x640000
jae 0x1004cfcc
mov dword [esp + 0x28], edi
fild dword [esp + 0x28]
test edi, edi
jns 0x1004cfa2
fadd qword [0xd55640]
fmul qword [0xd55648]
fnstcw word [esp + 0x18]
movzx eax, word [esp + 0x18]
or eax, 0xc00
mov dword [esp + 0x28], eax
fldcw word [esp + 0x28]
fistp qword [esp + 0x50]
mov esi, dword [esp + 0x50]
fldcw word [esp + 0x18]
jmp 0x1004cfd2
lea esi, [edi + 0x10000]
mov eax, dword [0xd5b440]
cmp esi, eax
jbe 0x1004cfdd
mov esi, eax
cmp cl, 2
jne 0x1004d01a
test edx, edx
je 0x1004d01a
mov edi, dword [esp + 0x20]
mov ecx, dword [edi + 8]
push ecx
mov bl, 1
call fcn.100918f3
add esp, 4
test esi, esi
js 0x1004d022
push esi
call fcn.1009192d
add esp, 4
test eax, eax
je 0x1004d022
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
mov byte [edi + 0x14], 2
jmp 0x1004ce9a
mov edi, dword [esp + 0x20]
xor bl, bl
jmp 0x1004cff8
test bl, bl
je 0x1004d035
xor eax, eax
mov dword [edi + 0x10], eax
mov dword [edi + 8], 0xd6086b
mov dword [edi + 0xc], eax
push 0xd4bc99
push 0xd4f75c
jmp 0x1004cd94
mov byte [eax], 0
mov dword [esi + 0xc], ebx
jmp 0x1004cdcd
push edi
call fcn.100918d5
add esp, 4
mov eax, esi
fstp qword [esp + 0x50]
call fcn.1000b6a0
test al, al
je 0x1004d082
push 0x10
push 0
push esi
call fcn.1009379e
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], edx
fild qword [esp + 0x54]
add esp, 0xc
jmp 0x1004d08b
push esi
call fcn.100918d5
add esp, 4
fld qword [esp + 0x50]
fucompp
fnstsw ax
test ah, 0x44
jp 0x1004d138
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
inc dword [esp + 0x2c]
dec eax
cmp dword [esp + 0x28], eax
jne 0x1004d0bb
cmp byte [esp + 0x14], 0
jne 0x1004d0bb
dec edi
mov dword [esp + 0x18], edi
mov eax, dword [esp + 0x28]
add ebx, dword [esp + 0x24]
inc eax
mov dword [esp + 0x28], eax
cmp eax, dword [esp + 0x1c]
jb 0x1004ce00
mov eax, dword [esp + 0x34]
push eax
call fcn.100918f3
add esp, 4
cmp byte [esp + 0x15], 0
je 0x1004d19e
mov byte [edi - 2], 0
mov edi, dword [esp + 0x20]
cmp byte [edi + 0x17], 0
jne 0x1004d176
mov esi, dword [edi + 0xc]
jmp 0x1004d178
mov al, byte [0xd5dd84]
push esi
test al, al
jne 0x1004d111
mov eax, dword [ebx]
push eax
call fcn.10090dd3
jmp 0x1004d128
cmp al, 2
jne 0x1004d120
mov ecx, dword [ebx]
push ecx
call dword [0xd49138]
jmp 0x1004d12b
mov eax, dword [ebx]
push eax
call fcn.10090ee9
add esp, 8
test eax, eax
setne al
test al, al
je 0x1004d0a0
mov ecx, dword [ebx]
mov al, byte [ecx]
mov edi, dword [esp + 0x18]
test al, al
je 0x1004d152
inc ecx
mov byte [edi], al
mov al, byte [ecx]
inc edi
test al, al
jne 0x1004d144
mov dword [esp + 0x18], edi
mov eax, dword [esp + 0x1c]
dec eax
cmp dword [esp + 0x28], eax
jb 0x1004d164
cmp byte [esp + 0x14], 0
je 0x1004d16f
mov dl, byte [esp + 0x12]
mov byte [edi], dl
inc edi
mov dword [esp + 0x18], edi
mov esi, dword [ebx]
jmp 0x1004d0bb
mov esi, edi
cmp byte [esi + 0x17], 1
jne 0x1004d194
test byte [esi + 0x15], 8
je 0x1004d18b
mov eax, esi
call fcn.10001d50
add dword [esi + 0xc], 0xfffffffe
lea eax, [esi + 0xc]
jmp 0x1004d1a5
mov eax, 0xd5d980
add dword [eax], 0xfffffffe
jmp 0x1004d1a5
mov byte [edi], 0
mov edi, dword [esp + 0x20]
cmp byte [esp + 0x16], 0
je 0x1004d1ff
cmp dword [esp + 0x2c], 0
je 0x1004d1ff
push 0
push 1
mov ecx, edi
call fcn.10001e30
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004d1c1
sub eax, edx
mov ebx, eax
cmp byte [edi + 0x17], cl
jne 0x1004d1d6
mov esi, dword [edi + 0xc]
jmp 0x1004d1d8
mov esi, edi
cmp byte [esi + 0x17], 1
jne 0x1004d1f0
test byte [esi + 0x15], 8
je 0x1004d1eb
mov eax, esi
call fcn.10001d50
lea eax, [esi + 0xc]
jmp 0x1004d1f5
mov eax, 0xd5d980
mov ecx, dword [esp + 0x2c]
mov dword [eax], ebx
mov dword [esp + 0x30], ecx
cmp byte [edi + 0x17], 0
jne 0x1004d20a
mov eax, dword [edi + 0xc]
jmp 0x1004d20c
mov eax, edi
cmp byte [eax + 0x17], 2
jne 0x1004d22d
cmp dword [0xd61684], 0
je 0x1004d22d
push 1
mov ecx, 0xd61678
call fcn.10004310
mov dword [esp + 0x1c], eax
jmp 0x1004d239
and byte [eax + 0x15], 0x86
mov dword [esp + 0x1c], 1
mov edi, dword [esp + 0x30]
cmp edi, 0xffffffff
je 0x1004d2ae
mov esi, dword [0xd5f780]
cmp byte [esi + 0x17], 0
jne 0x1004d251
mov esi, dword [esi + 0xc]
mov al, byte [esi + 0x15]
test al, 2
je 0x1004d267
and al, 0x3d
mov byte [esi + 0x15], al
mov eax, dword [esi]
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov al, byte [esi + 0x15]
and al, 0x9b
or al, 0x18
mov dword [esi], edi
mov dword [esi + 4], 0
mov byte [esi + 0x15], al
jns 0x1004d289
mov eax, esi
call fcn.10001d50
and byte [esi + 0x15], 0x8f
jmp 0x1004d2ae
cmp dword [0xd5f0dc], 0
je 0x1004d296
test al, 0x10
jne 0x1004d2a3
cmp dword [0xd5f0e0], 0
je 0x1004d2ae
test al, 0x20
je 0x1004d2ae
test al, 8
je 0x1004d2ae
mov eax, esi
call fcn.10001d50
mov eax, dword [esp + 0x38]
test eax, eax
je 0x1004d2d6
push eax
call fcn.100918f3
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x20]
add esp, 4
mov dword [0xd5dd7c], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x1c]
pop edi
pop esi
mov dword [0xd5dd7c], edx
pop ebx
mov esp, ebp
pop ebp
ret 8