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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov ebx, edx
mov dword [0x563e24], 1
mov edi, ecx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x14], edi
call fcn.004ae470
mov ecx, ebx
call fcn.0045f810
test al, al
je 0x4afd7c
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.0x4afe5a
mov ecx, edi
call fcn.0045eec0
mov ecx, ebx
mov esi, eax
call fcn.0045eec0
movsd xmm2, qword [0x5454e0]
test esi, esi
jg 0x4afdf4
dec eax
movd xmm1, eax
cvtdq2pd xmm1, xmm1
jmp 0x4afe0c
movd xmm1, eax
movd xmm0, 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 0x4afe47
addsd xmm0, xmm1
movsd qword [ebp - 0x20], xmm0
cmp byte [ebx + 0xbd], 0
jne case.default.0x4afe5a
mov eax, dword [0x563e5c]
cmp eax, 3
ja case.default.0x4afe5a
jmp dword [eax*4 + 0x4b0108]
cmp dword [ebx + 0x64], 1
jmp 0x4afe6b
cmp dword [ebx + 0x64], 0
jne case.default.0x4afe5a
addsd xmm0, xmm1
movsd qword [ebp - 0x20], xmm0
mov ecx, ebx
call fcn.0045f920
test al, al
jne 0x4afe86
xorps xmm1, xmm1
jmp 0x4afe8b
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 0x4afd4d
mov eax, dword [ebx]
push ebx
mov eax, dword [eax + 0x44]
call eax
add esp, 4
test al, al
jne 0x4afef1
mov al, byte [edi + 0xbd]
cmp al, byte [ebx + 0xbd]
je 0x4afef1
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 0x4afef4
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 0x4aff86
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.0045fd30
lea eax, [eax + eax*2]
jmp 0x4aff99
call fcn.0045fd30
cmp byte [edi + 0xbf], 0
mov dword [ebp - 4], eax
je 0x4aff9c
add eax, eax
mov dword [ebp - 4], eax
mov byte [edi + 0xbf], 0
test eax, eax
jle 0x4b0003
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 0x4b00ff
mov eax, dword [edi + 0x1a8]
cmp eax, 4
jbe 0x4b0030
xor ecx, ecx
jmp 0x4b0038
movzx ecx, word [edi + eax*2 + 0x2fc]
call fcn.00460f00
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x4b00ff
cmp byte [eax + 0x9c], 2
jae 0x4b00ff
cmp dword [ebx + 0x10], 0
jle 0x4b00ff
mov ecx, dword [eax + 0x8c]
mov eax, dword [0x55f1a8]
mov dword [ebp - 0x14], ecx
mov eax, dword [eax + 4]
mov dword [ebp - 4], eax
test eax, eax
jle 0x4b00ff
mov esi, 1
mov eax, dword [edi]
push esi
push edi
mov eax, dword [eax + 0x28]
call eax
add esp, 8
mov dword [ebp - 0xc], eax
test eax, eax
jle 0x4b00f8
mov edx, esi
mov ecx, ebx
call fcn.0045f050
cmp dword [ebp - 0x14], 0
jne 0x4b00b7
test eax, eax
jne 0x4b00f8
push dword [ebp - 0xc]
mov edx, esi
mov ecx, ebx
call fcn.004b2ec0
add esp, 4
jmp 0x4b00f8
test eax, eax
je 0x4b00f8
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 - 0x1c]
cmp edx, dword [eax + 0x7c]
jge 0x4b00f8
mov edx, esi
mov ecx, ebx
call fcn.0045f050
test eax, eax
je 0x4b00f8
mov edx, esi
mov ecx, ebx
call fcn.0045f430
call fcn.004ae470
inc esi
sub dword [ebp - 4], 1
jne 0x4b0080
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret