Function at 0x1005ac00
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x20
mov esi, dword [ebp + 0x18]
test esi, esi
js 0x1005adc3
mov ebx, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
jne 0x1005ac2c
call fcn.1004cf65
xor ecx, ecx
lea esi, [eax + 1]
inc ecx
cmp eax, ecx
cmovle esi, ecx
cmp ebx, 1
mov dword [ebp - 0x20], esi
sbb esi, 0
push 0x34
call fcn.100539f3
add esp, 4
mov dword [edi], eax
mov edi, 0xfffffff4
test eax, eax
je 0x1005adb9
mov edx, eax
test esi, esi
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x10], eax
je 0x1005ac72
push 0x20
push esi
call fcn.100539a9
mov edx, dword [ebp - 0x10]
add esp, 8
test eax, eax
mov dword [edx], eax
je 0x1005adae
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp - 0x20]
xor edi, edi
mov dword [edx + 0x28], ecx
mov dword [edx + 0x2c], eax
lea eax, [edx + 0x18]
mov dword [edx + 0x30], ebx
mov dword [edx + 4], esi
mov dword [edx + 0x24], edi
mov dword [edx + 0xc], edi
mov dword [edx + 8], edi
mov dword [edx + 0x14], edi
mov dword [edx + 0x10], edi
push eax
call dword [sym.imp.KERNEL32.dll_InitializeSRWLock]
mov eax, dword [ebp - 0x10]
add eax, 0x1c
push eax
call dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
mov eax, dword [ebp - 0x10]
cmp dword [ebp - 0x24], 0
mov dword [eax + 0x20], edi
jle 0x1005ad84
xor esi, esi
mov ecx, dword [eax]
mov edi, esi
shl edi, 5
lea ebx, [ecx + edi + 4]
lea edx, [ecx + edi]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], edx
mov dword [ebx - 4], eax
push ebx
call dword [sym.imp.KERNEL32.dll_InitializeSRWLock]
mov eax, dword [ebp - 0x18]
lea eax, [eax + edi + 8]
mov dword [ebp - 0x28], eax
push eax
call dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
mov dword [ebp - 0x1c], ebx
push ebx
mov ebx, dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov ecx, dword [ebp - 0x18]
xor eax, eax
mov dword [ebx + 0x14], eax
lea edx, [ecx + edi + 0xc]
mov ecx, dword [ebp - 0x14]
mov dword [edx + 4], 0x1005adc8
mov dword [ebp - 0x2c], edx
mov dword [edx + 8], ecx
push eax
push eax
push edx
push 0x1001cd6b
push eax
push eax
call fcn.101686af
add esp, 0x18
mov ecx, dword [ebp - 0x2c]
test eax, eax
mov dword [ecx], eax
je 0x1005ad88
mov eax, dword [ebp - 0x18]
mov ecx, 0
mov dword [ebp - 0x14], esi
lea edx, [eax + edi + 0x1c]
mov eax, dword [sym.imp.KERNEL32.dll_SleepConditionVariableSRW]
mov edi, dword [ebp - 0x1c]
cmp dword [edx], 0
jne 0x1005ad68
push ecx
push 0xffffffffffffffff
push edi
push ebx
mov edi, eax
mov esi, edx
call eax
xor ecx, ecx
mov eax, edi
mov edi, dword [ebp - 0x1c]
mov edx, esi
cmp dword [esi], ecx
je 0x1005ad50
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov esi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
inc esi
cmp esi, dword [ebp - 0x24]
jl 0x1005acc1
mov edi, dword [ebp - 0x20]
jmp 0x1005adb9
mov edi, esi
jmp 0x1005adb9
cmp dword [ebp + 0x14], 1
mov eax, dword [ebp - 0x10]
adc esi, 0
mov dword [eax + 4], esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push dword [ebp + 8]
call fcn.1005ae75
add esp, 4
xor edi, edi
dec edi
jmp 0x1005adb9
push dword [ebp + 8]
call fcn.10053962
add esp, 4
mov eax, edi
add esp, 0x20
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.1016a210
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov esi, dword [ebp + 8]
mov ebx, dword [esi]
lea eax, [esi + 4]
mov dword [ebp - 0x10], eax
push eax
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
lea eax, [esi + 8]
mov dword [ebp - 0x20], eax
push eax
call dword [sym.imp.KERNEL32.dll_WakeConditionVariable]
lea eax, [ebx + 0x18]
lea ecx, [ebx + 0x1c]
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], ecx
jmp 0x1005ae30
mov ecx, eax
call fcn.1005b02b
test eax, eax
je 0x1005ae30
mov esi, dword [ebp - 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov eax, dword [ebp - 0x14]
mov dword [eax + 0x20], 1
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WakeConditionVariable]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov eax, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_SleepConditionVariableSRW]
mov esi, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x20]
xor ecx, ecx
mov dword [eax + 0x1c], 1
push ecx
push 0xffffffffffffffff
push esi
push ebx
call edi
mov eax, dword [ebp + 8]
xor ecx, ecx
cmp dword [eax + 0x1c], ecx
jne 0x1005ae48
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0x24], 0
je 0x1005ae01
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
xor eax, eax
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret