Function at 0x10021e50
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100bc5ff
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x100fe39c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x3c], esi
test esi, esi
je 0x10021e9c
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x18], xmm0
mov byte [ebp - 4], 1
lea eax, [ebp - 0x38]
mov ecx, dword [edi + 4]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov eax, dword [eax]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x34]
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x20], eax
test ecx, ecx
je 0x10021ee2
lock inc dword [ecx + 4]
mov ecx, dword [edi + 4]
mov eax, dword [edi]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], ecx
mov byte [ebp - 4], 4
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
mov byte [ebp - 4], 1
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x18]
mov dword [ebp - 0x28], 1
push eax
call fcn.100221b0
add esp, 8
mov byte [ebp - 4], 8
mov eax, 1
mov dword [ebp - 0x28], eax
and eax, 0xfffffffe
mov dword [ebp - 0x28], eax
mov byte [ebp - 4], 9
lea eax, [ebp - 0x38]
mov dword [ebp - 0x20], eax
mov byte [ebp - 4], 9
lea eax, [ebp - 0x34]
mov dword [ebp - 0x20], eax
mov byte [ebp - 4], 9
mov dword [ebp - 0x20], eax
mov byte [ebp - 4], 9
or ebx, 0xffffffff
mov edi, dword [ebp - 0x30]
test edi, edi
je 0x10021f6b
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x10021f6b
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
mov eax, ebx
lock xadd dword [edi + 8], eax
jne 0x10021f6b
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
test ecx, ecx
je 0x10021f87
lock inc dword [ecx + 4]
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], ecx
mov byte [ebp - 4], 0x10
lea eax, [ebp - 0x24]
push eax
lea ecx, [esi + 0x20]
call fcn.10022060
mov byte [ebp - 4], 9
mov edi, dword [ebp - 0x20]
test edi, edi
je 0x10021fca
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x10021fca
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
mov eax, ebx
lock xadd dword [edi + 8], eax
jne 0x10021fca
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
cmp dword [esi + 0x18], 0
jne 0x10021ff1
lea eax, [esi + 0x1c]
push eax
push 0
push esi
push 0x10007de0
push 0
push 0
call fcn.1008e013
add esp, 0x18
mov dword [esi + 0x18], eax
mov byte [ebp - 0x19], 1
jmp 0x10021ff5
mov byte [ebp - 0x19], 0
mov byte [ebp - 4], 0
mov edi, dword [ebp - 0x14]
test edi, edi
je 0x1002201e
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x1002201e
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
lock xadd dword [edi + 8], ebx
dec ebx
jne 0x1002201e
mov edx, dword [edi]
mov ecx, edi
call dword [edx + 4]
mov dword [ebp - 4], 0xffffffff
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, byte [ebp - 0x19]
mov dword [ebp - 0x3c], 0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1004f51c
mov esp, ebp
pop ebp
ret 0xc