Function at 0x21054ad6
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov dword [ebp - 0x1c], ecx
cmp dword [ebp + 0x10], 0
je 0x21054aee
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
cmp dword [ebp + 0x14], 0
je 0x21054afd
mov ecx, dword [ebp + 0x14]
mov dword [ecx], 0
mov ecx, dword [ebp - 0x1c]
call fcn.2105469b
test eax, eax
je 0x21054b13
mov eax, 1
jmp 0x21054cf5
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 8], 0
jne 0x21054b23
xor eax, eax
jmp 0x21054cf5
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0
push 4
push 0
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp - 0x1c]
push eax
push 0x21054cfb
call fcn.2106ec27
mov ecx, dword [ebp - 0x1c]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 4], 0
jne 0x21054b5e
xor eax, eax
jmp 0x21054cf5
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 4]
mov edx, dword [ebp + 0xc]
mov dword [ecx + 0x24], edx
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp + 0xc]
mov dword [eax + 0x44], ecx
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x44], 0
je 0x21054c1c
cmp dword [ebp + 0x10], 0
je 0x21054bba
push 0x18
call fcn.2106e07d
add esp, 4
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 4]
mov dword [eax + 0x48], ecx
cmp dword [ebp - 4], 0
je 0x21054bba
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x48]
mov dword [ecx], eax
cmp dword [ebp + 0x14], 0
je 0x21054bdf
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov ecx, dword [ebp - 0x1c]
mov dword [ecx + 0x4c], eax
mov edx, dword [ebp + 0x14]
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x4c]
mov dword [edx], ecx
push 0x2109d308
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 4]
mov ecx, dword [eax + 0x28]
mov dword [ebp - 0x10], ecx
mov edx, dword [0x2109d330]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x10]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
mov ecx, 0x2109d328
call fcn.2106d772
push 0x2109d308
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 4]
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x21054cf0
mov eax, dword [ebp - 0x1c]
cmp dword [eax + 0x44], 0
je 0x21054cec
push 0x2109d308
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ecx + 4]
mov eax, dword [edx + 0x28]
push eax
push 0x2109d328
call fcn.210379ed
add esp, 8
push 0x2109d308
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 0x1c]
cmp dword [ecx + 0x4c], 0
je 0x21054c99
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x1c]
mov dword [ecx + 0x4c], 0
mov edx, dword [ebp - 0x1c]
cmp dword [edx + 0x48], 0
je 0x21054cce
mov eax, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x48]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0x48]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.2106e0a6
add esp, 4
mov edx, dword [ebp - 0x1c]
mov dword [edx + 0x48], 0
cmp dword [ebp + 0x10], 0
je 0x21054cdd
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
cmp dword [ebp + 0x14], 0
je 0x21054cec
mov ecx, dword [ebp + 0x14]
mov dword [ecx], 0
xor eax, eax
jmp 0x21054cf5
mov eax, 1
mov esp, ebp
pop ebp
ret 0x10