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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52522d
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x552064]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xorps xmm0, xmm0
mov dword [ebp - 0x14], 0
xor ecx, ecx
movq qword [ebp - 0x1c], xmm0
xor ebx, ebx
mov byte [0x5605c6], 0
xor eax, eax
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], eax
mov eax, dword [0x5646d8]
mov edx, dword [0x5646dc]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x28], edx
cmp eax, edx
je 0x470686
mov esi, dword [0x55f1c0]
nop dword [eax + eax]
mov edi, dword [eax]
mov eax, dword [0x560531]
cmp dword [edi], eax
je 0x470555
cmp byte [edi + 0x10], 2
jne 0x47066f
cmp dword [edi + 8], eax
jne 0x47066f
push dword [0x560539]
lea eax, [edi + 0x2f]
push dword [0x560535]
push eax
call dword [sym.imp.USER32.dll_PtInRect]
mov esi, dword [0x55f1c0]
mov edx, dword [ebp - 0x28]
test eax, eax
je 0x47066f
mov eax, dword [edi + 0x27]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x38], eax
cmp ecx, eax
je 0x47066f
nop dword [eax + eax]
mov eax, dword [ecx]
mov ebx, dword [esi + 4]
add eax, 8
mov dword [ebp - 0x20], eax
mov edx, dword [eax]
test ebx, ebx
jle 0x470590
mov eax, dword [esi + 8]
mov eax, dword [eax + ebx*4 - 4]
cmp edx, dword [eax]
jg 0x47086e
test edx, edx
jle 0x4705a3
cmp edx, ebx
jg 0x4705a3
mov eax, dword [esi + 8]
mov edi, dword [eax + edx*4 - 4]
cmp dword [edi], edx
je 0x4705ba
xor eax, eax
cmp eax, ebx
jge 0x47086e
mov ecx, dword [esi + 8]
mov edi, dword [ecx + eax*4]
cmp edx, dword [edi]
je 0x4705ba
inc eax
jmp 0x4705a5
push dword [0x560539]
mov edx, dword [0x560535]
mov ecx, dword [0x563cc8]
call fcn.004a00a0
add esp, 4
cmp eax, 0x1388
jl 0x4705e7
movzx eax, byte [eax + 0x55f040]
add eax, 0x1388
mov ecx, eax
call fcn.00466df0
mov ecx, eax
cmp ecx, 0xa1
ja 0x470604
mov eax, dword [0x5603c0]
movzx eax, word [eax + ecx*2 + 0xc]
jmp 0x470606
xor eax, eax
movzx ecx, ax
dec ecx
cmp ecx, dword [edi + 0xc]
jae 0x470619
mov eax, dword [edi + 0x10]
mov al, byte [ecx + eax]
test al, al
je 0x470657
mov ebx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
cmp ebx, dword [ebp - 0x2c]
je 0x470639
mov eax, dword [eax]
mov dword [ebx], eax
add ebx, 4
mov esi, dword [0x55f1c0]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x18], ebx
jmp 0x47065a
push eax
push ebx
lea ecx, [ebp - 0x1c]
call fcn.00435240
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x18]
mov esi, dword [0x55f1c0]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x24], ebx
jmp 0x47065a
mov ebx, dword [ebp - 0x24]
mov ecx, dword [ebp - 0x30]
add ecx, 4
mov dword [ebp - 0x30], ecx
cmp ecx, dword [ebp - 0x38]
jne 0x470570
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x34]
add eax, 4
mov dword [ebp - 0x34], eax
cmp eax, edx
jne 0x470510
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x20], ecx
sub ebx, ecx
sar ebx, 2
test ebx, ebx
je 0x470822
imul edi, dword [0x563db0], 0x8088405
mov eax, ebx
cdq
mov ecx, eax
mov eax, edx
inc edi
mul edi
mov dword [0x563db0], edi
mov esi, eax
mov eax, ecx
mul edi
mov eax, dword [ebp - 0x20]
add esi, edx
mov eax, dword [eax + esi*4]
mov esi, dword [0x56467c]
mov dword [0x563dec], eax
mov dword [0x563e58], 0
mov dword [0x563e5c], 0
test esi, esi
je 0x470734
mov eax, dword [0x563df0]
cmp eax, esi
je 0x470725
test eax, eax
je 0x47070f
lea ecx, [eax - 8]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x470705
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x470705
push ecx
call fcn.00501c9e
add esp, 4
mov dword [0x563df0], 0
test esi, esi
je 0x470725
mov dword [0x563df0], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x470725
inc eax
mov dword [esi - 8], eax
mov eax, dword [0x564698]
mov dword [0x563e68], eax
jmp 0x4707da
push dword [0x560539]
mov edx, dword [0x560535]
mov ecx, dword [0x563cc8]
call fcn.004a00a0
add esp, 4
cmp eax, 0x1388
jl 0x470761
movzx eax, byte [eax + 0x55f040]
add eax, 0x1388
mov ecx, eax
call fcn.00466df0
cmp eax, 0xa1
ja 0x47077c
mov ecx, dword [0x5603c0]
movzx eax, word [ecx + eax*2 + 0xc]
jmp 0x47077e
xor eax, eax
movzx edi, ax
mov ecx, edi
call fcn.00466a20
mov ecx, dword [0x563df0]
mov esi, dword [eax + 8]
cmp ecx, esi
je 0x4707d4
test ecx, ecx
je 0x4707be
mov eax, dword [ecx - 8]
add ecx, 0xfffffff8
cmp eax, 0xffffffff
je 0x4707b4
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x4707b4
push ecx
call fcn.00501c9e
add esp, 4
mov dword [0x563df0], 0
test esi, esi
je 0x4707d4
mov dword [0x563df0], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x4707d4
inc eax
mov dword [esi - 8], eax
mov dword [0x563e68], edi
imul eax, dword [0x563db0], 0x8088405
mov ecx, 0x20
mov word [0x563eb8], 1
mov dword [0x563e70], 0
mov dword [0x563df4], 0
inc eax
mov dword [0x563db0], eax
mul ecx
test edx, edx
mov dword [ebp - 0x3c], eax
sete byte [0x563eba]
call fcn.004b56b0
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x470852
mov edx, dword [ebp - 0x2c]
mov eax, ecx
sub edx, ecx
and edx, 0xfffffffc
cmp edx, 0x1000
jb 0x470848
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x470878
push edx
push ecx
call fcn.004e68fe
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004e66f2
mov esp, ebp
pop ebp
ret
mov ecx, str.Troop
call fcn.004a1c00
call fcn.005033fd
int3