Function at 0x4090a0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x479bf0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x28], eax
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x2c], edi
test ebx, ebx
jne 0x409101
cmp dword [0x48464c], ebx
je 0x4090ee
push 0x4f02b0
mov dword [0x4f02c8], 1
mov dword [0x48464c], ebx
call fcn.00407710
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004380f8
mov esp, ebp
pop ebp
ret
cmp dword [0x48464c], 0
jne 0x409144
push 0x50
push 0
push 0x4f0280
call fcn.00439a50
push str.pTS.cs
push 0x4f02b0
call fcn.004096c0
add esp, 0x14
push 0
push 0
push 0
push 0x409fa0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x48464c], eax
push 0x11d3
push str.D:MyProjectsProPilotLibMisc.c
push 0
push 0x4f02b0
call fcn.004085f0
mov eax, dword [0x465c70]
add esp, 0x10
test eax, eax
jns 0x409176
push 0x484658
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov dword [0x465c70], eax
cmp dword [ebp - 0x28], 0
jne 0x409184
test edi, edi
jne 0x409184
test esi, esi
je 0x409193
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [0x465c70]
test eax, eax
je 0x4091d8
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
push dword [ebp - 8]
mov edi, 1
push dword [ebp - 0xc]
cmp ebx, edi
cmovg edi, ebx
mov eax, edi
mov dword [ebp - 0x24], edi
cdq
push edx
push eax
call fcn.00438600
push dword [0x48465c]
push dword [0x484658]
push edx
push eax
call fcn.00438550
mov ecx, eax
mov dword [ebp - 0x20], ecx
jmp 0x40922e
push 1
call dword [sym.imp.WINMM.dll_timeBeginPeriod]
mov edi, 1
cmp ebx, edi
cmovg edi, ebx
mov dword [ebp - 0x24], edi
call dword [sym.imp.WINMM.dll_timeGetTime]
movd xmm0, edi
cvtdq2pd xmm0, xmm0
movd xmm1, eax
divsd xmm0, qword [0x4556e8]
shr eax, 0x1f
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x456070]
mulsd xmm0, xmm1
call fcn.00438640
push 1
mov dword [ebp - 0x20], eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov ecx, dword [ebp - 0x20]
test esi, esi
je 0x409359
movups xmm0, xmmword [ebp - 0x1c]
movups xmmword [esi], xmm0
movzx edi, word [esi]
movzx eax, word [esi + 2]
movzx ebx, word [esi + 6]
shl edi, 8
or edi, eax
movzx eax, word [esi + 0xa]
shl edi, 8
or edi, ebx
movzx ebx, word [esi + 8]
shl ebx, 8
or ebx, eax
movzx eax, word [esi + 0xc]
shl ebx, 8
or ebx, eax
cmp dword [ebp + 8], 0x3e8
je 0x4092a7
movd xmm1, dword [ebp - 0x24]
mov eax, ecx
movsd xmm0, qword [0x4556e8]
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
divsd xmm0, xmm1
movd xmm1, ecx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x456070]
mulsd xmm0, xmm1
call fcn.00438640
mov ecx, eax
mov eax, 0x10624dd3
mul ecx
mov eax, 1
shr edx, 6
sub eax, edx
xor edx, edx
imul eax, eax, 0x3e8
sub eax, dword [0x4f0284]
sub eax, dword [0x4f0280]
add eax, ecx
mov ecx, 0x3e8
div ecx
mov ecx, 0x3e3
movzx eax, dx
mov word [esi + 0xe], ax
cmp ax, cx
jbe 0x4092fc
cmp edi, dword [0x4f02ac]
jl 0x40931c
jg 0x4092f8
cmp ebx, dword [0x4f02a8]
jbe 0x40931c
xor eax, eax
jmp 0x409318
cmp eax, 5
jae 0x40931c
cmp edi, dword [0x4f02ac]
jg 0x40931c
jl 0x409313
cmp ebx, dword [0x4f02a8]
jae 0x40931c
mov eax, 0x3e7
mov word [esi + 0xe], ax
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x40933a
movzx eax, word [esi]
movzx edx, word [esi + 2]
imul eax, eax, 0x64
add eax, edx
movzx edx, word [esi + 6]
imul eax, eax, 0x64
add eax, edx
mov dword [ecx], eax
mov edx, dword [ebp - 0x2c]
test edx, edx
je 0x409359
movzx eax, word [esi + 8]
imul ecx, eax, 0x64
movzx eax, word [esi + 0xa]
add ecx, eax
movzx eax, word [esi + 0xc]
imul ecx, ecx, 0x64
add ecx, eax
mov dword [edx], ecx
push 0x4f02b0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x20]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004380f8
mov esp, ebp
pop ebp
ret