Function at 0x498520
Capabilities:
Resume thread

Disassembly:
mov eax, dword [0x719d7c]
sub esp, 8
push ebx
xor ebx, ebx
push ebp
push esi
cmp eax, ebx
push edi
je 0x4987d6
mov eax, dword [0x719d80]
mov ecx, dword [0x718f64]
cmp eax, ecx
jae 0x4987d1
cmp dword [esp + 0x1c], ebx
je 0x4987d6
mov ebp, dword [esp + 0x20]
cmp ebp, ebx
je 0x4987d6
push 1
call fcn.004980e0
mov eax, dword [0x719d94]
add esp, 4
cmp eax, ebx
je 0x4985bd
mov dword [0x719d94], ebx
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ecx, dword [0x719d80]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], ecx
mov esi, eax
fild qword [esp + 0x10]
fmul qword [0x4ba2a0]
fmul qword [0x4ba298]
fadd qword [0x4ba290]
call fcn.004afaa4
sub esi, eax
mov dword [0x719d78], ebx
mov dword [0x718f54], esi
mov dword [0x718f58], ebx
mov eax, dword [0x719d80]
xor edx, edx
mov ecx, 0xf
div ecx
test edx, edx
jne 0x4985df
mov eax, dword [0x719d9c]
cmp eax, ebx
je 0x4985df
push eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov edx, dword [0x515848]
mov eax, dword [0x51584c]
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, edx
jle 0x49864f
mov edx, dword [0x719d94]
mov eax, dword [0x719d8c]
inc edx
cmp eax, ebx
mov dword [0x719d94], edx
je 0x498610
mov ecx, dword [eax]
push eax
call dword [ecx + 0x48]
xor esi, esi
mov edx, dword [0x515848]
mov eax, dword [0x51584c]
cmp eax, edx
jle 0x49864f
cmp esi, 0x1388
jge 0x4987d1
push 0xa
call edi
add esi, 0xa
mov eax, dword [0x515848]
mov ecx, dword [0x51584c]
cmp ecx, eax
jg 0x498621
cmp esi, 0x1388
jge 0x4987d1
mov eax, dword [0x719da4]
cmp eax, ebx
jne 0x4987d1
mov ecx, dword [esp + 0x1c]
mov eax, dword [0x719d80]
push ecx
xor edx, edx
mov ecx, 0xf
push ebp
div ecx
push edx
mov edx, dword [0x51584c]
and edx, 0x80000003
jns 0x498684
dec edx
or edx, 0xfffffffc
inc edx
imul edx, edx, 0x5ab5c
add edx, 0x5561a0
push edx
call fcn.004a1c20
add esp, 0x10
test eax, eax
jne 0x4987d6
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ecx, eax
mov eax, dword [0x719d78]
sub eax, ecx
dec eax
cmp eax, ebx
jle 0x4986b8
push eax
call edi
mov eax, dword [0x719d8c]
cmp eax, ebx
je 0x498721
mov edx, dword [eax]
lea ecx, [esp + 0x1c]
push ecx
push eax
call dword [edx + 0x24]
test byte [esp + 0x1c], 1
jne 0x498721
mov eax, dword [0x719d8c]
mov ecx, dword [0x719da0]
push ecx
push eax
mov edx, dword [eax]
call dword [edx + 0x3c]
mov ecx, dword [0x719d80]
xor edx, edx
mov esi, dword [0x719d8c]
lea eax, [ecx + ecx*2]
shl eax, 4
add eax, ecx
mov ecx, 0x2b110
mov edi, dword [esi]
lea eax, [eax + eax*2]
lea eax, [eax + eax*4]
shl eax, 2
div ecx
push edx
push esi
call dword [edi + 0x34]
mov eax, dword [0x719d8c]
push 1
push ebx
push ebx
mov edx, dword [eax]
push eax
call dword [edx + 0x30]
cmp dword [0x719d90], ebx
je 0x49873a
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [0x718f54], eax
mov dword [0x719d90], ebx
mov esi, dword [0x719d80]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], esi
fild qword [esp + 0x10]
fmul qword [0x4ba2a0]
fmul qword [0x4ba298]
fadd qword [0x4ba290]
call fcn.004afaa4
add eax, dword [0x718f54]
mov dword [0x719d78], eax
mov eax, dword [0x718f58]
cmp eax, ebx
jne 0x4987a2
call dword [sym.imp.WINMM.dll_timeGetTime]
mov ecx, dword [0x719d78]
mov esi, dword [0x719d80]
cmp eax, ecx
jb 0x4987a2
cmp esi, ebx
je 0x4987a2
mov eax, dword [0x718f64]
dec eax
cmp esi, eax
je 0x4987a2
mov ecx, 1
jmp 0x4987a4
xor ecx, ecx
inc esi
mov eax, 0x88888889
mul esi
shr edx, 3
mov dword [0x718f58], ecx
mov dword [0x719d80], esi
mov dword [0x51584c], edx
cmp ecx, ebx
je 0x4987c7
neg esi
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret
call fcn.00498430
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret