Function at 0x421410
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x4cdbf8]
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 0x421471
cmp dword [0x4e5f4c], ebx
je 0x42145e
push 0x555af0
mov dword [0x555b08], 1
mov dword [0x4e5f4c], ebx
call fcn.0041f910
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0047fe8c
mov esp, ebp
pop ebp
ret
cmp dword [0x4e5f4c], 0
jne 0x4214b4
push 0x50
push 0
push 0x555ac0
call fcn.00481c10
push str.pTS.cs
push 0x555af0
call fcn.004224f0
add esp, 0x14
push 0
push 0
push 0
push 0x422d50
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x4e5f4c], eax
push 0x11d3
push str.D:MyProjectsProPilotLibMisc.c
push 0
push 0x555af0
call fcn.004208b0
mov eax, dword [0x4b9c70]
add esp, 0x10
test eax, eax
jns 0x4214e6
push 0x4e5f58
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
mov dword [0x4b9c70], eax
cmp dword [ebp - 0x28], 0
jne 0x4214f4
test edi, edi
jne 0x4214f4
test esi, esi
je 0x421503
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
mov eax, dword [0x4b9c70]
test eax, eax
je 0x421548
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.004805f0
push dword [0x4e5f5c]
push dword [0x4e5f58]
push edx
push eax
call fcn.00480540
mov ecx, eax
mov dword [ebp - 0x20], ecx
jmp 0x42159e
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 [0x4a0868]
shr eax, 0x1f
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x4a1160]
mulsd xmm0, xmm1
call fcn.004806b0
push 1
mov dword [ebp - 0x20], eax
call dword [sym.imp.WINMM.dll_timeEndPeriod]
mov ecx, dword [ebp - 0x20]
test esi, esi
je 0x4216c9
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 0x421617
movd xmm1, dword [ebp - 0x24]
mov eax, ecx
movsd xmm0, qword [0x4a0868]
cvtdq2pd xmm1, xmm1
shr eax, 0x1f
divsd xmm0, xmm1
movd xmm1, ecx
cvtdq2pd xmm1, xmm1
addsd xmm1, qword [eax*8 + 0x4a1160]
mulsd xmm0, xmm1
call fcn.004806b0
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 [0x555ac4]
sub eax, dword [0x555ac0]
add eax, ecx
mov ecx, 0x3e8
div ecx
mov ecx, 0x3e3
movzx eax, dx
mov word [esi + 0xe], ax
cmp ax, cx
jbe 0x42166c
cmp edi, dword [0x555aec]
jl 0x42168c
jg 0x421668
cmp ebx, dword [0x555ae8]
jbe 0x42168c
xor eax, eax
jmp 0x421688
cmp eax, 5
jae 0x42168c
cmp edi, dword [0x555aec]
jg 0x42168c
jl 0x421683
cmp ebx, dword [0x555ae8]
jae 0x42168c
mov eax, 0x3e7
mov word [esi + 0xe], ax
mov ecx, dword [ebp - 0x28]
test ecx, ecx
je 0x4216aa
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 0x4216c9
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 0x555af0
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.0047fe8c
mov esp, ebp
pop ebp
ret