Function at 0x1009b3d0
Capabilities:
Create thread
Get thread local storage value
Set thread local storage value

Disassembly:
push ecx
push ebx
push esi
mov dword [esp + 8], 1
call fcn.1009acf0
mov esi, dword [esp + 0x10]
mov dword [esi + 8], eax
test eax, eax
je 0x1009b5fd
mov ebx, dword [esp + 0x14]
push 0x14
push ebx
call fcn.1008aa30
add esp, 8
mov dword [esi], eax
test eax, eax
je 0x1009b5fd
push ebp
xor ebp, ebp
mov dword [esi + 4], ebx
push edi
test ebx, ebx
jle 0x1009b558
xor ebx, ebx
nop dword [eax]
push 0x18
mov dword [ebx + eax], esi
call fcn.1008aa70
mov edi, eax
add esp, 4
test edi, edi
je 0x1009b43f
push 0xfa0
push edi
call dword [sym.imp.kernel32.dll_InitializeCriticalSectionAndSpinCount]
mov eax, dword [esi]
mov dword [ebx + eax + 0xc], edi
mov eax, dword [esi]
cmp dword [ebx + eax + 0xc], 0
je 0x1009b54f
call fcn.1009acf0
mov ecx, dword [esi]
mov dword [ebx + ecx + 0x10], eax
mov eax, dword [esi]
cmp dword [eax + ebx + 0x10], 0
je 0x1009b537
mov dword [eax + ebx + 8], 0
mov eax, dword [esi]
add eax, ebx
push 0xc
mov dword [esp + 0x1c], eax
call fcn.1008aa70
mov edi, eax
add esp, 4
test edi, edi
je 0x1009b4be
mov eax, dword [esp + 0x18]
push 0
push 0
push edi
push 0x1009aee0
push 0
push 0
mov dword [edi], 0x1009b8e0
mov dword [edi + 4], eax
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__beginthreadex]
add esp, 0x18
mov dword [edi + 8], eax
test eax, eax
jne 0x1009b4c0
push edi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
xor edi, edi
mov eax, dword [esi]
mov dword [ebx + eax + 4], edi
mov eax, dword [esi]
cmp dword [ebx + eax + 4], 0
je 0x1009b4df
inc ebp
add ebx, 0x14
cmp ebp, dword [esp + 0x1c]
jl 0x1009b420
jmp 0x1009b558
mov ecx, dword [sym.imp.kernel32.dll_DeleteCriticalSection]
lea edi, [ebp*4]
add edi, ebp
mov ebx, dword [eax + edi*4 + 0xc]
test ebx, ebx
je 0x1009b508
push ebx
call ecx
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov ecx, dword [sym.imp.kernel32.dll_DeleteCriticalSection]
add esp, 4
mov eax, dword [esi]
mov ebx, dword [eax + edi*4 + 0x10]
test ebx, ebx
je 0x1009b52d
mov edi, dword [ebx]
test edi, edi
je 0x1009b524
push edi
call ecx
push edi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
push ebx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
mov dword [esp + 0x10], 0
jmp 0x1009b555
mov edi, dword [eax + ebx + 0xc]
test edi, edi
je 0x1009b54f
push edi
call dword [sym.imp.kernel32.dll_DeleteCriticalSection]
push edi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
xor eax, eax
mov dword [esp + 0x10], eax
mov dword [esi + 4], ebp
push dword [esi + 0xc]
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x20]
mov ebx, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
cmp eax, dword [esi + 4]
jge 0x1009b5e3
nop
push dword [0x101ec1a0]
mov ebp, dword [esi + 0xc]
mov ebx, dword [esi + 8]
call dword [sym.imp.kernel32.dll_TlsGetValue]
mov edi, eax
test edi, edi
jne 0x1009b5a1
push eax
push eax
push eax
push eax
call dword [sym.imp.kernel32.dll_CreateEventA]
mov edi, eax
push edi
push dword [0x101ec1a0]
call dword [sym.imp.kernel32.dll_TlsSetValue]
push dword [ebx]
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
push 8
call fcn.1008aa70
add esp, 4
mov dword [eax], edi
mov ecx, dword [ebx + 4]
mov dword [eax + 4], ecx
push dword [ebx]
mov dword [ebx + 4], eax
mov ebx, dword [sym.imp.kernel32.dll_LeaveCriticalSection]
call ebx
push ebp
call ebx
push 0xffffffffffffffff
push edi
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
push ebp
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov eax, dword [esi + 0x20]
cmp eax, dword [esi + 4]
jl 0x1009b570
push dword [esi + 0xc]
call ebx
mov ecx, dword [esi + 0x10]
xor edx, edx
mov eax, dword [esp + 0x10]
cmp ecx, 2
pop edi
pop ebp
pop esi
cmove eax, edx
pop ebx
pop ecx
ret
pop esi
xor eax, eax
pop ebx
pop ecx
ret