Function at 0x409190
Capabilities:
Check for time delay via gettickcount

Disassembly:
mov al, byte [esp + 8]
sub esp, 8
test al, al
push ebx
push esi
mov esi, dword [esp + 0x14]
push edi
mov edi, ecx
mov bl, 1
mov byte [edi + 0x31], bl
je 0x40945c
push 0xa
mov ecx, 0x5e0d08
call fcn.0049dd20
cmp eax, 3
jne 0x409215
push 0x3e32b8c3
push 0xbe32b8c3
mov ecx, 0x5e0d08
call fcn.0049de30
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x18]
push ecx
fchs
fstp dword [esp]
call fcn.00481d10
fld dword [esp + 0x1c]
fmul dword [esi + 0x1c]
fld dword [esp + 0x18]
fmul dword [esi + 0x18]
faddp st(1)
fld dword [esp + 0x1c]
fchs
fmul dword [esi + 0x18]
fld dword [esp + 0x18]
fmul dword [esi + 0x1c]
faddp st(1)
fstp dword [esp + 0x10]
mov eax, dword [esp + 0x10]
fstp dword [esi + 0x18]
mov dword [esi + 0x1c], eax
mov ecx, dword [esi + 0x18]
mov edx, dword [esi + 0x1c]
push ecx
push edx
call fcn.00481e30
fst dword [esp + 0x1c]
fcomp dword [0x5158dc]
fnstsw ax
test ah, 1
je 0x409241
fld dword [esp + 0x1c]
fadd dword [0x515944]
fstp dword [esp + 0x1c]
fld dword [esp + 0x1c]
fcomp dword [0x515944]
fnstsw ax
test ah, 1
jne 0x409260
fld dword [esp + 0x1c]
fsub dword [0x515944]
fstp dword [esp + 0x1c]
fld dword [esp + 0x1c]
fcomp dword [0x515940]
fnstsw ax
test ah, 1
jne 0x40929f
fld dword [esp + 0x1c]
fcomp dword [0x51593c]
fnstsw ax
test ah, 0x41
je 0x40929f
fld dword [esp + 0x1c]
fsub dword [0x515938]
fabs
fcomp qword [0x515930]
fnstsw ax
test ah, 1
je 0x409455
fld dword [esi + 0x3c]
fcomp dword [0x51592c]
fnstsw ax
test ah, 0x41
je 0x4092b1
xor bl, bl
mov eax, dword [edi + 0x34]
test eax, eax
jne 0x4092c0
call sub.KERNEL32.dll_GetTickCount
mov dword [edi + 0x34], eax
call sub.KERNEL32.dll_GetTickCount
sub eax, dword [edi + 0x34]
cmp eax, 0x7d0
seta al
test bl, bl
jne 0x4092dc
test al, al
je 0x40945c
fld dword [esp + 0x1c]
fcomp dword [0x515940]
fnstsw ax
test ah, 1
jne 0x409302
fld dword [esp + 0x1c]
fcomp dword [0x51593c]
fnstsw ax
test ah, 0x41
jne 0x40939c
fld dword [esi + 0x1c]
fcomp dword [0x5158dc]
fnstsw ax
test ah, 1
jne 0x40935a
test bl, bl
jne 0x40935a
lea edx, [esp + 0xc]
lea ecx, [esp + 0x18]
push 0xbe0efa35
call fcn.00481d10
fld dword [esp + 0xc]
fmul dword [esi + 0x18]
fld dword [esp + 0x18]
fmul dword [esi + 0x1c]
faddp st(1)
fld dword [esp + 0x18]
fchs
fmul dword [esi + 0x18]
fld dword [esp + 0xc]
fmul dword [esi + 0x1c]
faddp st(1)
fstp dword [esp + 0x10]
mov eax, dword [esp + 0x10]
fstp dword [esi + 0x18]
mov dword [esi + 0x1c], eax
jmp 0x40939c
lea edx, [esp + 0xc]
lea ecx, [esp + 0x18]
push 0x3e0efa35
call fcn.00481d10
fld dword [esp + 0x18]
fmul dword [esi + 0x1c]
fld dword [esp + 0xc]
fmul dword [esi + 0x18]
faddp st(1)
fld dword [esp + 0x18]
fchs
fmul dword [esi + 0x18]
fld dword [esp + 0xc]
fmul dword [esi + 0x1c]
faddp st(1)
fstp dword [esp + 0x10]
mov ecx, dword [esp + 0x10]
fstp dword [esi + 0x18]
mov dword [esi + 0x1c], ecx
fld dword [esp + 0x1c]
fsub dword [0x515938]
fabs
fcomp qword [0x515930]
fnstsw ax
test ah, 1
je 0x40945c
fld dword [esi + 0x1c]
fcomp dword [0x5158dc]
fnstsw ax
test ah, 1
jne 0x409411
test bl, bl
jne 0x409411
lea edx, [esp + 0x18]
lea ecx, [esp + 0x1c]
push 0x3e0efa35
call fcn.00481d10
fld dword [esp + 0x18]
fmul dword [esi + 0x18]
fld dword [esp + 0x1c]
fmul dword [esi + 0x1c]
faddp st(1)
fld dword [esp + 0x1c]
fchs
fmul dword [esi + 0x18]
fld dword [esp + 0x18]
fmul dword [esi + 0x1c]
faddp st(1)
fstp dword [esp + 0x10]
mov edx, dword [esp + 0x10]
fstp dword [esi + 0x18]
mov dword [esi + 0x1c], edx
jmp 0x40945c
lea edx, [esp + 0x18]
lea ecx, [esp + 0x1c]
push 0xbe0efa35
call fcn.00481d10
fld dword [esp + 0x1c]
fmul dword [esi + 0x1c]
fld dword [esp + 0x18]
fmul dword [esi + 0x18]
faddp st(1)
fld dword [esp + 0x1c]
fchs
fmul dword [esi + 0x18]
fld dword [esp + 0x18]
fmul dword [esi + 0x1c]
faddp st(1)
fstp dword [esp + 0x10]
mov eax, dword [esp + 0x10]
fstp dword [esi + 0x18]
mov dword [esi + 0x1c], eax
jmp 0x40945c
mov dword [edi + 0x34], 0
mov al, byte [edi + 0x32]
test al, al
jne 0x409606
fld dword [esi + 0x1c]
fld dword [esi + 0x18]
fld st(0)
fmul st(1)
fld st(2)
fmul st(3)
faddp st(1)
fsqrt
fstp dword [esp + 0x1c]
fstp st(0)
fstp st(0)
fld dword [esp + 0x1c]
fcomp dword [0x5158dc]
fnstsw ax
test ah, 0x40
jne 0x4094aa
fld dword [0x5158ec]
fdiv dword [esp + 0x1c]
fld st(0)
fmul dword [esi + 0x18]
fstp dword [esi + 0x18]
fmul dword [esi + 0x1c]
fstp dword [esi + 0x1c]
mov dword [esp + 0x18], 0
call fcn.004913e0
mov ecx, eax
call fcn.00494900
cmp eax, 3
ja case.default.0x4094c3
jmp dword [eax*4 + 0x409610]
fld dword [0x515928]
jmp 0x4094ee
fld dword [0x515924]
jmp 0x4094ee
fld dword [0x515920]
jmp 0x4094ee
fld dword [0x51591c]
jmp 0x4094ee
fld dword [esp + 0x18]
fadd dword [esp + 0x1c]
fld st(0)
fmul dword [esi + 0x18]
fstp dword [esi + 0x18]
fmul dword [esi + 0x1c]
fstp dword [esi + 0x1c]
fld dword [edi + 0x2c]
fcomp dword [0x515830]
fnstsw ax
test ah, 0x41
jne 0x409606
fld dword [edi + 0x2c]
fsub dword [0x515830]
fdiv dword [0x515834]
fcom dword [0x5158dc]
fnstsw ax
test ah, 1
je 0x40953c
fstp st(0)
mov dword [esp + 0x1c], 0
jmp 0x409559
fcom dword [0x5158ec]
fnstsw ax
test ah, 0x41
jne 0x409555
fstp st(0)
mov dword [esp + 0x1c], 0x3f800000
jmp 0x409559
fstp dword [esp + 0x1c]
push 0
push esi
mov ecx, edi
call fcn.00409620
test al, al
jne 0x4095ff
fld dword [0x515844]
fsub dword [0x515840]
mov ecx, dword [0x515840]
fmul dword [esp + 0x1c]
mov dword [esp + 0x1c], ecx
fadd dword [0x515840]
fst dword [esp + 0x18]
fsub dword [0x515840]
fld dword [0x51583c]
fmul dword [0x515918]
fdivp st(1)
fstp dword [esp + 0xc]
fld dword [0x515840]
fcomp dword [esp + 0x18]
fnstsw ax
test ah, 0x41
je 0x409606
mov edx, dword [esp + 0x1c]
mov ecx, edi
push edx
push esi
call fcn.00409620
test al, al
jne 0x4095ff
fld dword [esp + 0x1c]
push ecx
mov ecx, edi
fchs
fstp dword [esp]
push esi
call fcn.00409620
test al, al
jne 0x4095ff
fld dword [esp + 0xc]
fadd dword [esp + 0x1c]
fst dword [esp + 0x1c]
fcomp dword [esp + 0x18]
fnstsw ax
test ah, 0x41
jne 0x4095b8
pop edi
pop esi
pop ebx
add esp, 8
ret 8
mov dword [edi + 0x2c], 0
pop edi
pop esi
pop ebx
add esp, 8
ret 8