Function at 0x10018840
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x24
push ebx
push esi
mov esi, ecx
push edi
lea eax, [esi + 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi + 0x7c], 0
je 0x1001893c
lea eax, [esp + 0x20]
push eax
lea ecx, [esi + 0x6c]
call fcn.100192f0
mov edi, dword [eax]
test edi, edi
je 0x10018877
mov edi, dword [edi]
mov edx, dword [eax + 8]
mov eax, dword [edi + 8]
mov ecx, edx
dec eax
shr ecx, 2
and ecx, eax
mov eax, dword [edi + 4]
and edx, 3
mov eax, dword [eax + ecx*4]
mov edi, dword [eax + edx*4]
test edi, edi
je 0x10018919
mov ecx, dword [edi + 0x28]
lea eax, [edi + 0x18]
test ecx, ecx
je 0x100188bb
mov edx, dword [ecx]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
lea eax, [edi + 0x18]
mov dword [eax + 0x10], 0
mov ecx, dword [eax + 0x10]
test ecx, ecx
je 0x100188d7
mov edx, dword [ecx]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [edi + 0x28], 0
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x100188f3
mov edx, dword [ecx]
cmp ecx, edi
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [edi + 0x10], 0
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x1001890f
mov edx, dword [ecx]
cmp ecx, edi
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov dword [edi + 0x10], 0
push edi
call dword [sym.imp.MSVCR110.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, dword [esi + 0x7c]
test eax, eax
je 0x10018932
dec eax
mov dword [esi + 0x7c], eax
jne 0x1001892f
mov dword [esi + 0x78], 0
jmp 0x10018932
inc dword [esi + 0x78]
cmp dword [esi + 0x7c], 0
jne 0x10018862
lea eax, [esi + 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor edi, edi
cmp dword [esi + 0x4c], edi
jbe 0x10018967
mov ebx, dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [esi + 0x80]
mov eax, dword [eax + edi*4]
push dword [eax + 4]
call ebx
inc edi
cmp edi, dword [esi + 0x4c]
jb 0x10018953
xor eax, eax
mov dword [esp + 0xc], eax
cmp dword [esi + 0x4c], eax
jbe 0x10018a80
jmp 0x10018980
lea edi, [eax*4]
mov eax, dword [esi + 0x80]
mov eax, dword [edi + eax]
mov ebx, dword [eax]
test ebx, ebx
je 0x10018a30
lea eax, [esp + 0x18]
push 0x10017c70
push eax
call fcn.10018d40
mov eax, esp
lea edx, [esp + 0x20]
lea ecx, [esp + 0x28]
mov dword [eax], 0xf4240
mov dword [eax + 4], 0
call fcn.10018c80
mov edx, dword [eax]
mov dword [esp + 0x18], edx
mov eax, dword [eax + 4]
add esp, 8
mov dword [esp + 0x14], eax
lea eax, [esp + 0x10]
push eax
mov ecx, ebx
call fcn.1002a180
test al, al
jne 0x10018a01
mov ecx, dword [esi + 0x80]
mov ecx, dword [ecx + edi]
mov ecx, dword [ecx]
call fcn.10029b30
push 0xff
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [esi + 0x80]
mov eax, dword [edi + eax]
mov ebx, dword [eax]
test ebx, ebx
je 0x10018a21
mov ecx, ebx
call fcn.10028f50
push ebx
call dword [sym.imp.MSVCR110.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, dword [esi + 0x80]
mov eax, dword [edi + eax]
mov dword [eax], 0
mov eax, dword [esi + 0x80]
mov ebx, dword [edi + eax]
test ebx, ebx
je 0x10018a61
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebx + 0xc]
push eax
mov dword [ebx + 8], vtable.elex::thread::Mutex.0
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push ebx
call dword [sym.imp.MSVCR110.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov eax, dword [esi + 0x80]
mov dword [edi + eax], 0
mov eax, dword [esp + 0xc]
inc eax
mov dword [esp + 0xc], eax
cmp eax, dword [esi + 0x4c]
jb 0x10018980
mov eax, dword [esi + 0x80]
pop edi
mov dword [esi + 0x84], eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret