Function at 0x408d80
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x478bf4]
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 0x408de1
cmp dword [0x48362c], ebx
je 0x408dce
push 0x4efb10
mov dword [0x4efb28], 1
mov dword [0x48362c], ebx
call fcn.004073f0
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004379e8
mov esp, ebp
pop ebp
ret
cmp dword [0x48362c], 0
jne 0x408e24
push 0x50
push 0
push 0x4efae0
call fcn.00439330
push str.pTS.cs
push 0x4efb10
call fcn.004093a0
add esp, 0x14
push 0
push 0
push 0
push 0x409b90
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x48362c], eax
push 0x11d3
push str.D:MyProjectsProPilotLibMisc.c
push 0
push 0x4efb10
call fcn.004082d0
mov eax, dword [0x464c70]
add esp, 0x10
test eax, eax
jns 0x408e56
push 0x483638
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov dword [0x464c70], eax
cmp dword [ebp - 0x28], 0
jne 0x408e64
test edi, edi
jne 0x408e64
test esi, esi
je 0x408e73
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [0x464c70]
test eax, eax
je 0x408eb8
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.00438140
push dword [0x48363c]
push dword [0x483638]
push edx
push eax
call fcn.00438090
mov ecx, eax
mov dword [ebp - 0x20], ecx
jmp 0x408f0e
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 [0x4546d8]
shr eax, 0x1f
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x455030]
mulsd xmm0, xmm1
call fcn.00438180
push 1
mov dword [ebp - 0x20], eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov ecx, dword [ebp - 0x20]
test esi, esi
je 0x409039
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 0x408f87
movd xmm1, dword [ebp - 0x24]
mov eax, ecx
movsd xmm0, qword [0x4546d8]
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
divsd xmm0, xmm1
movd xmm1, ecx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x455030]
mulsd xmm0, xmm1
call fcn.00438180
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 [0x4efae4]
sub eax, dword [0x4efae0]
add eax, ecx
mov ecx, 0x3e8
div ecx
mov ecx, 0x3e3
movzx eax, dx
mov word [esi + 0xe], ax
cmp ax, cx
jbe 0x408fdc
cmp edi, dword [0x4efb0c]
jl 0x408ffc
jg 0x408fd8
cmp ebx, dword [0x4efb08]
jbe 0x408ffc
xor eax, eax
jmp 0x408ff8
cmp eax, 5
jae 0x408ffc
cmp edi, dword [0x4efb0c]
jg 0x408ffc
jl 0x408ff3
cmp ebx, dword [0x4efb08]
jae 0x408ffc
mov eax, 0x3e7
mov word [esi + 0xe], ax
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x40901a
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 0x409039
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 0x4efb10
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.004379e8
mov esp, ebp
pop ebp
ret