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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
push ebx
push esi
push edi
mov esi, ecx
call fcn.00459230
mov eax, dword [0x55f1c0]
xor edi, edi
mov dword [0x55f195], esi
mov dword [ebp - 0xc], edi
mov edx, dword [eax + 4]
test edx, edx
jle 0x458736
mov ecx, dword [eax + 8]
mov ecx, dword [ecx + edx*4 - 4]
cmp esi, dword [ecx]
jg 0x458ce5
test esi, esi
jle 0x45874c
cmp esi, edx
jg 0x45874c
mov ecx, dword [eax + 8]
mov ebx, dword [ecx + esi*4 - 4]
mov dword [ebp - 0x14], ebx
cmp dword [ebx], esi
je 0x458777
xor ecx, ecx
test edx, edx
jle 0x458ce5
mov eax, dword [eax + 8]
nop dword [eax]
mov ebx, dword [eax]
mov dword [ebp - 0x14], ebx
cmp esi, dword [ebx]
je 0x458777
inc ecx
add eax, 4
cmp ecx, edx
jge 0x458ce5
jmp 0x458760
mov eax, dword [ebx + 8]
mov eax, dword [eax]
mov ecx, dword [eax + 4]
mov edx, dword [eax + 8]
xor eax, eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x1c], edx
test ecx, ecx
jle 0x4588ac
mov ebx, dword [edx + eax*4]
inc eax
mov ecx, eax
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x10], eax
call fcn.004572c0
mov ecx, dword [0x55f180]
mov edi, eax
mov edx, edi
call fcn.00461c50
mov esi, dword [ebx + 4]
mov ecx, esi
call fcn.00453b60
mov ecx, edi
mov ebx, eax
call fcn.004573d0
mov dword [edi + 0xc4], esi
mov ecx, dword [ebx + 0x10]
mov dword [edi + 0x10], ecx
mov ecx, dword [ebx + 0x14]
mov dword [edi + 0x14], ecx
mov ecx, str._Monster_
mov edx, dword [ebx + 8]
call fcn.00462a60
mov ecx, dword [edi + 0xc8]
mov esi, eax
mov edx, esi
call fcn.0041f120
mov ecx, dword [edi + 0xcc]
mov edx, esi
call fcn.0041f120
test esi, esi
je 0x45881f
mov eax, dword [esi - 8]
lea ecx, [esi - 8]
cmp eax, 0xffffffff
je 0x45881f
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x45881f
push ecx
call fcn.00501c9e
add esp, 4
mov edx, dword [ebx + 0xc]
mov ecx, dword [edi + 0xc8]
call fcn.0041eb60
mov edx, dword [ebx + 0xc]
mov ecx, dword [edi + 0xcc]
call fcn.0041eb60
mov ecx, dword [edi + 0xcc]
call fcn.0041f390
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp - 0xc]
mov cl, byte [eax + 0x10]
xor cl, 1
mov byte [edi + 0xbc], cl
test ebx, ebx
jle 0x45888b
mov eax, dword [ebp - 0x14]
cmp byte [eax + 0x18], 0
je 0x45888b
imul eax, dword [0x563db0], 0x8088405
mov ecx, 0xf
inc eax
mov dword [0x563db0], eax
mul ecx
cmp edx, 9
mov dword [ebp - 0x58], eax
setl cl
mov byte [edi + 0xbc], cl
mov edx, dword [ebp - 0x1c]
lea eax, [ebx + 1]
test cl, cl
mov ecx, dword [ebp - 0x18]
cmove eax, ebx
mov edi, eax
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
cmp eax, ecx
jl 0x458792
mov dword [ebp - 0xc], edi
mov esi, dword [0x563e5c]
xor ebx, ebx
mov eax, esi
sub eax, 3
je 0x4588d4
sub eax, 1
jne 0x4588f0
cmp dword [0x5602d0], ebx
je 0x4588cd
cmp edi, 2
jge 0x4588f0
mov esi, 2
jmp 0x4588ea
cmp dword [0x5602d0], ebx
je 0x4588e5
cmp dword [0x5605e8], 2
jge 0x4588f0
mov esi, 1
mov dword [0x563e5c], esi
xor edx, edx
mov dword [ebp - 0x20], edx
test ecx, ecx
jle 0x458cd4
movsd xmm0, qword [0x5455d0]
xorps xmm5, xmm5
movsd xmm2, qword [0x5454e0]
movsd xmm3, qword [0x545548]
movsd xmm4, qword [0x5455a0]
movsd xmm1, qword [0x545598]
movsd qword [ebp - 0x30], xmm0
movsd qword [ebp - 0x40], xmm2
movsd qword [ebp - 0x58], xmm5
movsd qword [ebp - 0x48], xmm3
movsd qword [ebp - 0x50], xmm4
movsd qword [ebp - 0x38], xmm1
nop word [eax + eax]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + edx*4]
mov eax, dword [0x55f180]
mov dword [ebp - 0x10], ecx
cmp dword [eax + 4], edx
jb 0x458cdb
mov eax, dword [eax + 8]
mov edi, dword [eax + edx*4]
mov eax, dword [edi + 0xc8]
mov eax, dword [eax + 0xc]
cdq
sub eax, edx
mov edx, eax
mov eax, dword [ebp - 0x14]
sar edx, 1
mov dword [ebp - 0x24], edx
cmp dword [eax + 0x19], 0
jne 0x4589ac
cmp esi, 3
jge 0x4589ac
mov ecx, dword [ecx + 8]
mov eax, 0x140
sub eax, ecx
cmp esi, 2
cmove ecx, eax
mov dword [edi + 0x48], ecx
mov ecx, dword [ebp - 0x10]
mov ecx, dword [ecx + 0xc]
jmp 0x458c23
mov eax, dword [edi + 0xc8]
cmp byte [edi + 0xbc], 0
mov ecx, dword [ebp - 0x18]
cmovne ecx, dword [ebp - 0xc]
mov eax, dword [eax + 8]
cdq
sub eax, edx
mov dword [ebp - 4], ecx
mov ecx, dword [0x563e68]
sar eax, 1
mov dword [ebp - 0x10], eax
test ecx, ecx
jle 0x4589fb
call fcn.00466a20
movsd xmm0, qword [ebp - 0x30]
movsd xmm2, qword [ebp - 0x40]
movsd xmm3, qword [ebp - 0x48]
mov ecx, dword [eax + 0x44]
movsd xmm4, qword [ebp - 0x50]
movsd xmm5, qword [ebp - 0x58]
jmp 0x458a0b
cmp esi, 2
mov ecx, 0x3e80
mov eax, 0x5dc0
cmove ecx, eax
sub esi, 2
je 0x458ad6
sub esi, 1
je 0x458abc
movd xmm1, ecx
sub esi, 1
cvtdq2pd xmm1, xmm1
mov esi, dword [ebp - 4]
lea eax, [esi + ebx]
divsd xmm1, xmm0
movaps xmm0, xmm2
mulsd xmm1, qword [eax*8 + 0x53cf68]
subsd xmm0, xmm1
je 0x458a70
sub esp, 8
movsd qword [esp], xmm0
call fcn.0050322a
fstp qword [ebp - 8]
cvttsd2si ecx, qword [ebp - 8]
lea eax, [ebx + esi*8]
add esp, 8
mov edx, dword [eax*4 + 0x53cc48]
add edx, ecx
add edx, dword [ebp - 0x10]
jmp 0x458b24
sub esp, 8
comisd xmm5, xmmword [ebx*8 + 0x53cda8]
movsd qword [esp], xmm0
jbe 0x458aa0
call fcn.0050322a
mov edx, dword [ebp - 0x10]
add esp, 8
fstp qword [ebp - 8]
cvttsd2si eax, qword [ebp - 8]
add edx, 0x10
add edx, eax
jmp 0x458b24
call fcn.0050322a
fstp qword [ebp - 8]
cvttsd2si eax, qword [ebp - 8]
mov edx, 0x130
add esp, 8
sub edx, dword [ebp - 0x10]
sub edx, eax
jmp 0x458b24
movsd xmm0, qword [ebx*8 + 0x53cd68]
mov esi, dword [ebp - 4]
mulsd xmm0, xmm3
addsd xmm0, xmm4
cvttsd2si edx, xmm0
jmp 0x458b24
movd xmm1, ecx
sub esp, 8
cvtdq2pd xmm1, xmm1
mov esi, dword [ebp - 4]
lea eax, [esi + ebx]
divsd xmm1, xmm0
movaps xmm0, xmm2
mulsd xmm1, qword [eax*8 + 0x53cf68]
subsd xmm0, xmm1
movsd qword [esp], xmm0
call fcn.0050322a
fstp qword [ebp - 8]
cvttsd2si ecx, qword [ebp - 8]
lea eax, [ebx + esi*8]
mov edx, 0x140
sub edx, dword [eax*4 + 0x53cc48]
add esp, 8
sub edx, ecx
sub edx, dword [ebp - 0x10]
mov dword [edi + 0x48], edx
mov eax, dword [0x563e68]
mov ecx, dword [0x563e5c]
mov dword [ebp - 4], ecx
cmp eax, 1
jge 0x458b95
cmp ecx, 2
mov edx, 0x84
mov ecx, 0x188
cmove eax, edx
mov dword [ebp - 0x10], eax
mov eax, 0xc4
cmovne eax, ecx
movd xmm0, eax
cvtdq2pd xmm0, xmm0
divsd xmm0, qword [ebp - 0x30]
call fcn.00523090
mulsd xmm0, qword [ebp - 0x38]
lea eax, [esi + ebx]
sub esp, 8
mulsd xmm0, qword [eax*8 + 0x53d168]
movsd qword [esp], xmm0
call fcn.0050322a
fstp qword [ebp - 8]
cvttsd2si ecx, qword [ebp - 8]
add esp, 8
add ecx, dword [ebp - 0x10]
jmp 0x458c05
mov ecx, eax
call fcn.00466a20
mov dword [ebp - 0x10], eax
add esi, ebx
movd xmm0, dword [eax + 0x40]
cvtdq2pd xmm0, xmm0
divsd xmm0, qword [ebp - 0x30]
call fcn.00523090
mulsd xmm0, qword [ebp - 0x38]
sub esp, 8
cmp dword [ebp - 4], 4
je 0x458bdf
mulsd xmm0, qword [esi*8 + 0x53d168]
movsd qword [esp], xmm0
call fcn.0050322a
fstp qword [ebp - 8]
cvttsd2si eax, qword [ebp - 8]
jmp 0x458bfa
mulsd xmm0, qword [esi*8 + 0x53ca28]
movsd qword [esp], xmm0
call fcn.0050322a
fstp qword [ebp - 8]
cvttsd2si eax, qword [ebp - 8]
mov ecx, dword [ebp - 0x10]
add esp, 8
mov ecx, dword [ecx + 0x3c]
add ecx, eax
mov edx, dword [ebp - 0x24]
sub ecx, edx
movsd xmm0, qword [ebp - 0x30]
movsd xmm2, qword [ebp - 0x40]
movsd xmm3, qword [ebp - 0x48]
movsd xmm4, qword [ebp - 0x50]
movsd xmm5, qword [ebp - 0x58]
mov eax, 0xe6
mov dword [edi + 0x4c], ecx
sub eax, edx
cmp ecx, edx
jl 0x458c38
cmp ecx, eax
cmovle eax, ecx
jmp 0x458c3a
mov eax, edx
mov dword [edi + 0x4c], eax
mov eax, dword [0x563e5c]
test eax, eax
jle 0x458c5f
cmp eax, 3
jle 0x458c58
cmp eax, 4
jne 0x458c5f
lea eax, [ebx - 1]
and eax, 1
jmp 0x458c61
mov eax, 1
jmp 0x458c61
xor eax, eax
cmp byte [edi + 0xbc], 0
mov dword [edi + 0x40], eax
je 0x458cb7
mov eax, dword [0x563e5c]
dec eax
cmp eax, 3
ja case.default.0x458c78
jmp dword [eax*4 + 0x458cf4]
mov dword [edi + 0x3c], 0
add byte [eax], al
add byte [eax], al
jmp 0x458c98
mov dword [edi + 0x3c], 0x493e0
jmp 0x458c98
mov dword [edi + 0x3c], 0x249f0
cmp byte [0x563eba], 0
mov esi, dword [0x563e5c]
je 0x458cb4
test esi, esi
jne 0x458cb4
mov dword [edi + 0x3c], esi
mov esi, dword [0x563e5c]
inc ebx
jmp 0x458cc4
mov dword [edi + 0x3c], 0
mov esi, dword [0x563e5c]
mov edx, dword [ebp - 0x20]
inc edx
mov dword [ebp - 0x20], edx
cmp edx, dword [ebp - 0x18]
jl 0x458950
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, str.st_gEnemy_idx
call fcn.00469b60
mov edx, esi
mov ecx, str.Troop
call fcn.004a1c00
nop dword [eax]
jg 0x458c82
inc ebp
add byte [eax + 0x7f00458c], cl
mov word [ebp], es
mov byte [ebp + eax*2 - 0x33333400], cl
int3