Function at 0x100370e0
Capabilities:
Allocate thread local storage

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateMutexW]
push edi
mov edi, ecx
lea ebx, [edi + 0x3c]
mov dword [ebp - 0x10], ebx
test ebx, ebx
je 0x10037105
push 0
push 0
push 0
call esi
mov dword [ebx], eax
lea ebx, [edi + 0x4c]
mov dword [ebp - 0x14], ebx
test ebx, ebx
je 0x10037119
push 0
push 0
push 0
call esi
mov dword [ebx], eax
lea ebx, [edi + 0x58]
mov dword [ebp - 0x18], ebx
test ebx, ebx
je 0x1003712d
push 0
push 0
push 0
call esi
mov dword [ebx], eax
lea eax, [edi + 0x5c]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x10037144
mov dword [eax + 4], eax
mov dword [eax], eax
add eax, 8
mov dword [eax + 4], eax
mov dword [eax], eax
lea ebx, [edi + 0x6c]
mov dword [ebp - 0x20], ebx
test ebx, ebx
je 0x10037158
push 0
push 0
push 0
call esi
mov dword [ebx], eax
lea ebx, [edi + 0x54]
mov dword [ebp - 0x24], ebx
test ebx, ebx
je 0x1003716a
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [ebx], eax
cmp byte [0x100a000e], 0
lea eax, [edi + 0x34]
mov dword [eax + 4], eax
mov dword [eax], eax
lea eax, [edi + 0x78]
mov dword [eax + 4], eax
mov dword [eax], eax
lea eax, [edi + 0x88]
mov dword [eax + 4], eax
mov dword [eax], eax
lea eax, [edi + 0x90]
mov dword [eax + 4], eax
mov dword [eax], eax
jne 0x1003719e
call fcn.10040010
push 0x14
push 1
call fcn.100539fa
mov ebx, eax
add esp, 8
mov dword [ebp - 0xc], ebx
test ebx, ebx
je 0x1003724c
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebx + 0x10], eax
test eax, eax
jne 0x100371cf
push ebx
jmp 0x10037244
xor ecx, ecx
mov dword [ebx], 0x103
xor eax, eax
mov dword [ebx + 4], 0
mov dword [ebp - 4], ecx
mov esi, 0x100ac9c0
mov dword [ebp - 8], eax
nop dword [eax + eax]
cmp dword [esi], 0
jge 0x10037218
lea ebx, [eax + 0x100aa9c0]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esi], 0
jl 0x100372c7
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
inc ecx
add esi, 0x18
add eax, 0x20
mov dword [ebp - 4], ecx
mov dword [ebp - 8], eax
cmp esi, 0x100ae1c0
jl 0x100371f0
mov esi, dword [ebp - 0xc]
mov eax, dword [esi + 0x10]
test eax, eax
je 0x10037243
cmp eax, 0xffffffff
je 0x10037243
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.10053caa
add esp, 4
mov edi, 0xffffff9d
mov esi, dword [ebp - 0x10]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x1003726c
push dword [esi]
call ebx
test eax, eax
je 0x1003726c
mov dword [esi], 0
mov esi, dword [ebp - 0x14]
test esi, esi
je 0x10037281
push dword [esi]
call ebx
test eax, eax
je 0x10037281
mov dword [esi], 0
mov esi, dword [ebp - 0x18]
test esi, esi
je 0x10037296
push dword [esi]
call ebx
test eax, eax
je 0x10037296
mov dword [esi], 0
mov ecx, dword [ebp - 0x1c]
call fcn.1003fda0
mov esi, dword [ebp - 0x20]
test esi, esi
je 0x100372b3
push dword [esi]
call ebx
test eax, eax
je 0x100372b3
mov dword [esi], 0
mov eax, dword [ebp - 0x24]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov esi, dword [ebp - 0xc]
lea eax, [ecx + ecx*2]
mov dword [eax*8 + 0x100ac9c0], ecx
mov dword [edi + 8], ecx
mov dword [edi + 0xc], ecx
mov dword [eax*8 + 0x100ac9c4], 0xfffffffe
mov dword [eax*8 + 0x100ac9c8], esi
mov dword [eax*8 + 0x100ac9d4], 1
mov eax, dword [ebp - 8]
shl ecx, 5
add ecx, 0x100aa9c0
push ecx
mov dword [eax + 0x100aa9d8], 0xffffffff
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [edi + 8]
mov ecx, edi
push 1
call fcn.100383f0
mov ebx, eax
add esp, 4
mov dword [ebp - 0xc], ebx
test ebx, ebx
jns 0x10037346
mov ecx, dword [edi + 8]
call fcn.100408e0
mov ecx, dword [edi + 0xc]
call fcn.100408e0
mov edi, ebx
jmp 0x10037251
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret