Function at 0x4af8e0
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
mov ebx, edx
push edi
mov edi, ecx
mov dword [ebp - 0xc], ebx
mov ecx, ebx
mov dword [ebp - 0x14], edi
call fcn.0045f810
test al, al
je 0x4af92d
call fcn.004ae470
mov ecx, dword [0x564664]
cmp dword [ecx + 4], 0
cmove ecx, dword [0x5640a8]
call fcn.00492480
mov edx, dword [0x56424c]
mov ecx, ebx
call fcn.0045e810
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi]
push edi
mov eax, dword [eax + 0x34]
call eax
add esp, 4
mov ecx, edi
mov esi, eax
call fcn.0045f7b0
mov ecx, eax
mov eax, 0x51eb851f
imul ecx, esi
push edi
imul ecx
mov eax, 0x64
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
sub eax, ecx
movd xmm0, eax
mov eax, dword [edi]
cvtdq2pd xmm0, xmm0
mov eax, dword [eax + 0x40]
movsd qword [ebp - 0x20], xmm0
call eax
add esp, 4
test al, al
jne case.default.0x4afa13
mov ecx, edi
call fcn.0045eec0
mov ecx, ebx
mov dword [ebp - 8], eax
call fcn.0045eec0
mov ecx, dword [edi]
mov esi, eax
push edi
mov ecx, dword [ecx + 0x18]
call ecx
movsd xmm2, qword [0x5454e0]
add esp, 4
test eax, eax
jg 0x4af9b5
lea eax, [esi - 1]
movd xmm1, eax
cvtdq2pd xmm1, xmm1
jmp 0x4af9ce
movd xmm0, dword [ebp - 8]
movd xmm1, esi
cvtdq2pd xmm1, xmm1
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
subsd xmm1, xmm2
mulsd xmm1, qword [0x5454d0]
mov eax, dword [ebx]
push ebx
mov eax, dword [eax + 0x48]
addsd xmm1, xmm2
mulsd xmm1, qword [ebp - 0x20]
movsd qword [ebp - 0x20], xmm1
call eax
movsd xmm1, qword [0x545568]
add esp, 4
movsd xmm0, qword [ebp - 0x20]
test al, al
je 0x4afa09
addsd xmm0, xmm1
movsd qword [ebp - 0x20], xmm0
mov eax, dword [0x563e5c]
cmp eax, 3
ja case.default.0x4afa13
jmp dword [eax*4 + 0x4afd10]
cmp dword [ebx + 0x64], 1
jmp 0x4afa24
cmp dword [ebx + 0x64], 0
jne case.default.0x4afa13
addsd xmm0, xmm1
movsd qword [ebp - 0x20], xmm0
mov ecx, ebx
call fcn.0045f920
test al, al
jne 0x4afa3f
xorps xmm1, xmm1
jmp 0x4afa44
movsd xmm1, qword [ebp - 0x20]
imul eax, dword [0x563db0], 0x8088405
mov esi, 0x2710
mulsd xmm1, qword [0x545590]
inc eax
mov dword [0x563db0], eax
mul esi
mov dword [ebp - 0x20], eax
movd xmm0, edx
cvtdq2pd xmm0, xmm0
comisd xmm1, xmm0
ja 0x4af8fe
mov eax, dword [ebx]
push ebx
mov eax, dword [eax + 0x44]
call eax
add esp, 4
test al, al
jne 0x4afaaa
mov al, byte [edi + 0xbd]
cmp al, byte [ebx + 0xbd]
je 0x4afaaa
mov eax, dword [edi]
push edi
mov eax, dword [eax + 0x30]
call eax
fstp qword [ebp - 0x20]
movsd xmm1, qword [ebp - 0x20]
add esp, 4
jmp 0x4afaad
xorps xmm1, xmm1
imul eax, dword [0x563db0], 0x8088405
mov ecx, edi
mulsd xmm1, qword [0x545590]
inc eax
mov dword [0x563db0], eax
mul esi
mov dword [ebp - 0x20], eax
movd xmm0, edx
mov edx, ebx
cvtdq2pd xmm0, xmm0
comisd xmm1, xmm0
seta al
test al, al
je 0x4afb3f
movsd xmm0, qword [0x545558]
mov dword [0x56068c], 0x1c
mov dword [0x560690], 0x1c
mov dword [0x560694], 0x1c
movsd qword [0x560698], xmm0
movsd qword [0x5636a8], xmm0
mov dword [0x5606a0], 0xa
mov dword [0x5636b0], 0xa
mov dword [0x5636b4], 0
call fcn.0047bfc0
lea eax, [eax + eax*2]
jmp 0x4afb52
call fcn.0047bfc0
cmp byte [edi + 0xbf], 0
mov dword [ebp - 4], eax
je 0x4afb55
add eax, eax
mov dword [ebp - 4], eax
mov byte [edi + 0xbf], 0
test eax, eax
jle 0x4afbbc
lea ecx, [eax*4]
mov eax, 0x66666667
imul ecx
mov eax, 1
sar edx, 2
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
cmp ebx, eax
cmovle ebx, eax
imul esi, dword [0x563db0], 0x8088405
lea eax, [ebx + 1]
cdq
inc esi
mov ecx, eax
mov dword [0x563db0], esi
mov eax, edx
mul esi
mov edi, eax
mov eax, ecx
mul esi
mov dword [ebp - 0x20], eax
add edi, edx
mov eax, ebx
mov ebx, dword [ebp - 0xc]
cdq
sub eax, edx
sar eax, 1
sub edi, eax
mov eax, dword [ebp - 4]
add eax, edi
mov edi, dword [ebp - 0x14]
push ecx
push 0xa
push 0x64
mov edx, eax
mov ecx, ebx
call fcn.004b2bf0
add esp, 0xc
cmp byte [edi + 0xbd], 0
jne 0x4afd08
mov eax, dword [edi + 0x1a8]
cmp eax, 4
jbe 0x4afbe9
xor ecx, ecx
jmp 0x4afbf1
movzx ecx, word [edi + eax*2 + 0x2fc]
call fcn.00460f00
mov dword [ebp - 0x14], eax
test eax, eax
je 0x4afd08
cmp byte [eax + 0x9c], 2
jae 0x4afd08
cmp dword [ebx + 0x10], 0
jle 0x4afd08
mov eax, dword [eax + 0x8c]
mov dword [ebp - 4], eax
mov eax, dword [0x55f1a8]
mov eax, dword [eax + 4]
mov dword [ebp - 0x1c], eax
test eax, eax
jle 0x4afd08
mov esi, 1
nop dword [eax]
mov eax, dword [edi + 0x1a8]
mov dword [ebp - 8], esi
movzx eax, word [edi + eax*2 + 0x2fc]
test ax, ax
je 0x4afcfb
mov ecx, eax
call fcn.00460ea0
mov ecx, eax
cmp byte [ecx + 0x9c], 2
jae 0x4afcfb
test esi, esi
jle 0x4afcfb
cmp esi, dword [ecx + 0x6c]
jg 0x4afcfb
mov eax, dword [ecx + 0x70]
mov edx, esi
mov al, byte [eax + edx - 1]
test al, al
je 0x4afcfb
mov eax, dword [ecx + 0x7c]
mov dword [ebp - 0xc], eax
test eax, eax
js 0x4afcfb
jle 0x4afcfb
mov ecx, ebx
call fcn.0045f050
test eax, eax
jle 0x4afce6
cmp dword [ebp - 4], 0
je 0x4afcfb
imul eax, dword [0x563db0], 0x8088405
mov ecx, 0x64
inc eax
mov dword [0x563db0], eax
mul ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x14]
cmp edx, dword [eax + 0x7c]
jge 0x4afcfb
mov edx, esi
mov ecx, ebx
call fcn.0045f050
test eax, eax
je 0x4afcfb
mov edx, esi
mov ecx, ebx
call fcn.0045f430
call fcn.004ae470
jmp 0x4afcfb
cmp dword [ebp - 4], 0
jne 0x4afcfb
push dword [ebp - 0xc]
mov edx, esi
mov ecx, ebx
call fcn.004b2ec0
add esp, 4
mov eax, dword [ebp - 0x1c]
inc esi
cmp dword [ebp - 8], eax
jl 0x4afc40
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret