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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
mov edi, ecx
mov ecx, edx
call fcn.00465690
mov ebx, eax
mov ecx, edi
mov dword [ebp - 0x24], ebx
call fcn.0045ee30
mov edx, eax
mov ecx, edi
imul edx, dword [ebx + 0x38]
mov eax, 0x66666667
imul edx
sar edx, 4
mov esi, edx
shr esi, 0x1f
add esi, edx
call fcn.0045ed10
mov edi, dword [ebx + 0x40]
mov ecx, eax
imul ecx, dword [ebx + 0x34]
mov eax, 0x66666667
imul ecx
sar edx, 3
mov eax, edx
shr eax, 0x1f
add eax, edx
add eax, esi
add edi, eax
cmp byte [ebx + 0x20], 2
jae 0x4600c8
cmp byte [ebx + 0x4f], 0
jne 0x4600c8
mov ecx, dword [ebp + 8]
call fcn.0045eda0
mov ecx, eax
mov eax, 0x99999999
imul ecx, dword [ebx + 0x34]
imul ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
add edi, ecx
mov ecx, dword [ebp + 8]
call fcn.0045ee30
mov ecx, eax
mov eax, 0x99999999
imul ecx, dword [ebx + 0x38]
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
add edi, eax
mov eax, dword [0x55f150]
xor ebx, ebx
test edi, edi
mov dword [ebp - 0x1c], 0
mov ecx, 0xffffd8f1
mov dword [ebp - 0x20], 0
cmovns ebx, edi
mov dword [ebp - 0x14], ecx
mov esi, dword [eax + 4]
mov edi, ecx
mov edx, dword [eax + 8]
mov dword [ebp - 0xc], ebx
mov dword [ebp - 8], esi
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x10], edi
test esi, esi
jle 0x46022c
mov ebx, dword [ebp + 8]
mov esi, 1
mov eax, dword [ebp - 8]
test esi, esi
jle 0x460216
mov eax, dword [ebp - 0x24]
cmp esi, dword [eax + 0x58]
jg 0x460213
mov eax, dword [eax + 0x5c]
mov al, byte [eax + esi - 1]
test al, al
je 0x460213
mov eax, dword [edx]
mov dword [ebp - 4], eax
mov al, byte [eax + 8]
test al, al
jne 0x4601a7
mov eax, dword [ebx]
push esi
push ebx
mov eax, dword [eax + 0x1c]
call eax
add esp, 8
mov edx, esi
mov ecx, ebx
mov edi, eax
call fcn.0045ef50
add eax, edi
cmp eax, 4
ja case.default.0x46015e
jmp dword [eax*4 + 0x460308]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 9]
jmp 0x46018f
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xd]
jmp 0x46018f
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
jmp 0x46018f
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x15]
jmp 0x46018f
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x19]
jmp 0x46018f
xor eax, eax
cmp dword [ebp - 0x14], eax
mov edi, dword [ebp - 0x10]
cmovg eax, dword [ebp - 0x14]
mov ecx, eax
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x14], ecx
jmp 0x460210
cmp al, 1
jne 0x460213
mov eax, dword [ebx]
push esi
push ebx
mov eax, dword [eax + 0x1c]
call eax
add esp, 8
mov edx, esi
mov ecx, ebx
mov edi, eax
call fcn.0045ef50
add eax, edi
cmp eax, 4
ja case.default.0x4601c9
jmp dword [eax*4 + 0x46031c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 9]
jmp 0x4601fa
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xd]
jmp 0x4601fa
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x11]
jmp 0x4601fa
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x15]
jmp 0x4601fa
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x19]
jmp 0x4601fa
xor eax, eax
cmp dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x14]
cmovg eax, dword [ebp - 0x10]
mov edi, eax
mov dword [ebp - 0x20], 2
mov dword [ebp - 0x10], edi
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 8]
add edx, 4
inc esi
sub eax, 1
mov dword [ebp - 0x18], edx
mov dword [ebp - 8], eax
jne 0x460111
mov ebx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 0x20]
sub eax, 1
je 0x46027f
sub eax, 1
je 0x46027a
sub eax, 1
jne 0x460296
test ecx, ecx
js 0x460269
test edi, edi
js 0x460269
imul ebx, ecx
mov eax, 0x51eb851f
imul ebx
mov eax, 0x51eb851f
sar edx, 5
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
imul ecx, edi
imul ecx
jmp 0x460289
cmp ecx, edi
mov eax, 0x51eb851f
cmovl edi, ecx
imul edi, ebx
imul edi
jmp 0x460289
imul ebx, edi
jmp 0x460282
imul ebx, ecx
mov eax, 0x51eb851f
imul ebx
sar edx, 5
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
mov dword [ebp - 0xc], ebx
test ebx, ebx
jle 0x4602fd
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 0x3c]
test ecx, ecx
jle 0x4602fd
imul ecx, ebx
mov eax, 0x66666667
imul ecx
mov eax, 1
sar edx, 2
mov ebx, edx
shr ebx, 0x1f
add ebx, edx
cmp ebx, eax
cmovl 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 - 0x28], eax
add edi, edx
mov eax, ebx
cdq
sub eax, edx
sar eax, 1
sub edi, eax
mov eax, dword [ebp - 0xc]
add eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret