Function at 0x40b5a0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x4a9bf0]
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 0x40b601
cmp dword [0x4b478c], ebx
je 0x40b5ee
push 0x520610
mov dword [0x520628], 1
mov dword [0x4b478c], ebx
call fcn.00409590
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046300c
mov esp, ebp
pop ebp
ret
cmp dword [0x4b478c], 0
jne 0x40b644
push 0x50
push 0
push 0x5205e0
call fcn.00464960
push str.pTS.cs
push 0x520610
call fcn.0040bdd0
add esp, 0x14
push 0
push 0
push 0
push 0x40c710
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x4b478c], eax
push 0x11d3
push str.D:MyProjectsProPilotLibMisc.c
push 0
push 0x520610
call fcn.0040aaf0
mov eax, dword [0x495c70]
add esp, 0x10
test eax, eax
jns 0x40b676
push 0x4b4798
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov dword [0x495c70], eax
cmp dword [ebp - 0x28], 0
jne 0x40b684
test edi, edi
jne 0x40b684
test esi, esi
je 0x40b693
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [0x495c70]
test eax, eax
je 0x40b6d8
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.00463520
push dword [0x4b479c]
push dword [0x4b4798]
push edx
push eax
call fcn.00463470
mov ecx, eax
mov dword [ebp - 0x20], ecx
jmp 0x40b72e
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 [0x47f840]
shr eax, 0x1f
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x4801d0]
mulsd xmm0, xmm1
call fcn.00463560
push 1
mov dword [ebp - 0x20], eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov ecx, dword [ebp - 0x20]
test esi, esi
je 0x40b859
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 0x40b7a7
movd xmm1, dword [ebp - 0x24]
mov eax, ecx
movsd xmm0, qword [0x47f840]
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
divsd xmm0, xmm1
movd xmm1, ecx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x4801d0]
mulsd xmm0, xmm1
call fcn.00463560
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 [0x5205e4]
sub eax, dword [0x5205e0]
add eax, ecx
mov ecx, 0x3e8
div ecx
mov ecx, 0x3e3
movzx eax, dx
mov word [esi + 0xe], ax
cmp ax, cx
jbe 0x40b7fc
cmp edi, dword [0x52060c]
jl 0x40b81c
jg 0x40b7f8
cmp ebx, dword [0x520608]
jbe 0x40b81c
xor eax, eax
jmp 0x40b818
cmp eax, 5
jae 0x40b81c
cmp edi, dword [0x52060c]
jg 0x40b81c
jl 0x40b813
cmp ebx, dword [0x520608]
jae 0x40b81c
mov eax, 0x3e7
mov word [esi + 0xe], ax
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x40b83a
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 0x40b859
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 0x520610
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.0046300c
mov esp, ebp
pop ebp
ret