Function at 0x4208b0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x4ccbf8]
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 0x420911
cmp dword [0x4e4f4c], ebx
je 0x4208fe
push 0x554a70
mov dword [0x554a88], 1
mov dword [0x4e4f4c], ebx
call fcn.0041e750
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0047f41c
mov esp, ebp
pop ebp
ret
cmp dword [0x4e4f4c], 0
jne 0x420954
push 0x50
push 0
push 0x554a40
call fcn.004811a0
push str.pTS.cs
push 0x554a70
call fcn.00421990
add esp, 0x14
push 0
push 0
push 0
push 0x4221f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x4e4f4c], eax
push 0x11d3
push str.D:MyProjectsProPilotLibMisc.c
push 0
push 0x554a70
call fcn.0041fd60
mov eax, dword [0x4b8c70]
add esp, 0x10
test eax, eax
jns 0x420986
push 0x4e4f58
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov dword [0x4b8c70], eax
cmp dword [ebp - 0x28], 0
jne 0x420994
test edi, edi
jne 0x420994
test esi, esi
je 0x4209a3
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [0x4b8c70]
test eax, eax
je 0x4209e8
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.0047fb80
push dword [0x4e4f5c]
push dword [0x4e4f58]
push edx
push eax
call fcn.0047fad0
mov ecx, eax
mov dword [ebp - 0x20], ecx
jmp 0x420a3e
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 [0x4a08d8]
shr eax, 0x1f
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x4a12a0]
mulsd xmm0, xmm1
call fcn.0047fc40
push 1
mov dword [ebp - 0x20], eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov ecx, dword [ebp - 0x20]
test esi, esi
je 0x420b69
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 0x420ab7
movd xmm1, dword [ebp - 0x24]
mov eax, ecx
movsd xmm0, qword [0x4a08d8]
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
divsd xmm0, xmm1
movd xmm1, ecx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x4a12a0]
mulsd xmm0, xmm1
call fcn.0047fc40
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 [0x554a44]
sub eax, dword [0x554a40]
add eax, ecx
mov ecx, 0x3e8
div ecx
mov ecx, 0x3e3
movzx eax, dx
mov word [esi + 0xe], ax
cmp ax, cx
jbe 0x420b0c
cmp edi, dword [0x554a6c]
jl 0x420b2c
jg 0x420b08
cmp ebx, dword [0x554a68]
jbe 0x420b2c
xor eax, eax
jmp 0x420b28
cmp eax, 5
jae 0x420b2c
cmp edi, dword [0x554a6c]
jg 0x420b2c
jl 0x420b23
cmp ebx, dword [0x554a68]
jae 0x420b2c
mov eax, 0x3e7
mov word [esi + 0xe], ax
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x420b4a
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 0x420b69
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 0x554a70
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.0047f41c
mov esp, ebp
pop ebp
ret