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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
mov ebx, ecx
push esi
push edi
mov dword [ebp - 0x14], ebx
mov eax, dword [ebx + 0xc]
movzx eax, byte [eax + 1]
cmp eax, 8
ja case.default.0x4aefee
jmp dword [eax*4 + 0x4af460]
cmp byte [ebx + 0xbd], 1
jne case.0x4aefee.0
mov ecx, dword [0x563e20]
call fcn.004a8de0
mov edi, dword [0x563e20]
mov esi, dword [0x564328]
mov eax, dword [edi + 0x75]
cmp eax, esi
je 0x4af054
test eax, eax
je 0x4af041
lea ecx, [eax - 8]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x4af03a
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x4af03a
push ecx
call fcn.00501c9e
add esp, 4
mov dword [edi + 0x75], 0
test esi, esi
je 0x4af054
mov dword [edi + 0x75], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x4af054
inc eax
mov dword [esi - 8], eax
push edi
call fcn.004a8e60
mov edx, 0x28
add esp, 4
lea ecx, [edx - 0x1e]
call fcn.004aa8f0
push dword [0x563e20]
call fcn.004c57d0
add esp, 4
mov ecx, ebx
call fcn.004af650
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0xbd], 0
jne 0x4af09d
mov byte [ebx + 0xc0], 0xa
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x563e20]
call fcn.004a8de0
mov esi, dword [0x56432c]
mov edi, dword [0x563e20]
mov eax, dword [edi + 0x75]
cmp eax, esi
je 0x4af0f3
test eax, eax
je 0x4af0e0
lea ecx, [eax - 8]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x4af0d9
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x4af0d9
push ecx
call fcn.00501c9e
add esp, 4
mov dword [edi + 0x75], 0
test esi, esi
je 0x4af0f3
mov dword [edi + 0x75], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x4af0f3
inc eax
mov dword [esi - 8], eax
push edi
call fcn.004a8e60
mov edx, 0x28
add esp, 4
lea ecx, [edx - 0x1e]
call fcn.004aa8f0
push dword [0x563e20]
call fcn.004c57d0
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0xbd], 1
jne case.default.0x4aefee
mov ecx, dword [0x563e20]
call fcn.004a8de0
mov esi, dword [0x564330]
jmp 0x4af0ae
cmp byte [ebx + 0xbd], 1
jne 0x4af1c4
mov ecx, dword [0x563e20]
call fcn.004a8de0
mov edi, dword [0x563e20]
mov esi, dword [0x564334]
mov eax, dword [edi + 0x75]
cmp eax, esi
je 0x4af1a0
test eax, eax
je 0x4af18d
lea ecx, [eax - 8]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x4af186
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x4af186
push ecx
call fcn.00501c9e
add esp, 4
mov dword [edi + 0x75], 0
test esi, esi
je 0x4af1a0
mov dword [edi + 0x75], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x4af1a0
inc eax
mov dword [esi - 8], eax
push edi
call fcn.004a8e60
mov edx, 0x28
add esp, 4
lea ecx, [edx - 0x1e]
call fcn.004aa8f0
push dword [0x563e20]
call fcn.004c57d0
add esp, 4
mov byte [ebx + 0xbf], 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0xbd], 1
jne 0x4af255
mov ecx, dword [0x563e20]
call fcn.004a8de0
mov edi, dword [0x563e20]
mov esi, dword [0x564338]
mov eax, dword [edi + 0x75]
cmp eax, esi
je 0x4af231
test eax, eax
je 0x4af21e
lea ecx, [eax - 8]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x4af217
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x4af217
push ecx
call fcn.00501c9e
add esp, 4
mov dword [edi + 0x75], 0
test esi, esi
je 0x4af231
mov dword [edi + 0x75], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x4af231
inc eax
mov dword [esi - 8], eax
push edi
call fcn.004a8e60
mov edx, 0x28
add esp, 4
lea ecx, [edx - 0x1e]
call fcn.004aa8f0
push dword [0x563e20]
call fcn.004c57d0
add esp, 4
mov byte [ebx + 0xbc], 0
mov ecx, dword [0x564668]
cmp dword [ecx + 4], 0
cmove ecx, dword [0x5640ac]
call fcn.00492480
mov dword [ebx + 0xd8], 0x14
xor edi, edi
mov eax, dword [0x5605e8]
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], edi
test eax, eax
jle case.default.0x4aefee
cmp edi, dword [0x5605e8]
jb 0x4af29d
xor esi, esi
jmp 0x4af2b0
mov eax, dword [0x5605ec]
movzx ecx, word [eax + edi*2]
call fcn.004800c0
mov esi, eax
mov eax, dword [ebp - 8]
cmp byte [esi + 0xbc], 0
mov dword [ebp - 4], esi
je 0x4af370
cmp dword [esi + 0x10], 0
jle 0x4af370
mov dword [0x563e24], 1
call fcn.004ae470
mov ecx, esi
call fcn.0045eda0
cdq
mov ecx, ebx
sub eax, edx
mov esi, eax
sar esi, 1
call fcn.0045ed10
sub eax, esi
xor ecx, ecx
test eax, eax
cmovle eax, ecx
mov dword [ebp - 0x10], eax
test eax, eax
jle 0x4af35b
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, 1
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 - 0x14]
cdq
sub eax, edx
sar eax, 1
sub edi, eax
mov eax, dword [ebp - 0x10]
add eax, edi
mov edi, dword [ebp - 0xc]
push ecx
mov ecx, dword [ebp - 4]
mov edx, eax
push 0xa
push 0x64
call fcn.004b2bf0
mov eax, dword [ebp - 8]
add esp, 0xc
inc edi
mov dword [ebp - 0xc], edi
cmp edi, eax
jl 0x4af291
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0xbd], 1
jne 0x4af421
mov ecx, dword [0x563e20]
call fcn.004a8de0
mov edi, dword [0x563e20]
mov esi, dword [0x56433c]
mov eax, dword [edi + 0x75]
cmp eax, esi
je 0x4af3e6
test eax, eax
je 0x4af3d3
lea ecx, [eax - 8]
mov eax, dword [ecx]
cmp eax, 0xffffffff
je 0x4af3cc
dec eax
mov dword [ecx], eax
test eax, eax
jg 0x4af3cc
push ecx
call fcn.00501c9e
add esp, 4
mov dword [edi + 0x75], 0
test esi, esi
je 0x4af3e6
mov dword [edi + 0x75], esi
mov eax, dword [esi - 8]
cmp eax, 0xffffffff
je 0x4af3e6
inc eax
mov dword [esi - 8], eax
push edi
call fcn.004a8e60
mov edx, 0x28
add esp, 4
lea ecx, [edx - 0x1e]
call fcn.004aa8f0
push dword [0x563e20]
call fcn.004c57d0
add esp, 4
cmp dword [0x563e5c], 3
jne 0x4af421
mov eax, dword [ebx + 0xc]
mov byte [eax + 1], 7
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.004b0120
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov byte [ebx + 0xc0], 0x11
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0xbd], 0
jne case.default.0x4aefee
mov eax, dword [ebx + 0x60]
dec eax
mov byte [ebx + 0xc0], 0xb
and eax, 1
mov dword [ebx + 0x60], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret