Function at 0x10005980
Capabilities:
Allocate thread local storage

Disassembly:
push edi
push esi
cmp dword [0x10044e34], 1
jne 0x1000598e
pop esi
pop edi
ret
push 0x1003a020
call fcn.10003e50
add esp, 4
mov eax, dword [0x10044e48]
test eax, eax
je 0x100059c3
nop word cs:[eax + eax]
mov esi, eax
cmp dword [eax], 0x10044e34
je 0x10005a03
mov eax, dword [esi + 0xc]
test eax, eax
jne 0x100059b0
jmp 0x100059c5
xor esi, esi
push 0x10
push 1
call sub.msvcrt.dll_calloc
add esp, 8
mov edi, eax
mov dword [eax], 0x10044e34
lea eax, [esi + 0xc]
test esi, esi
mov ecx, 0x10044e48
cmovne ecx, eax
mov dword [edi + 8], 1
mov dword [ecx], edi
mov eax, edi
add eax, 4
push 0
push eax
call fcn.100031f0
add esp, 8
mov esi, edi
jmp 0x10005a06
inc dword [esi + 8]
push 0x1003a020
call fcn.10003e90
add esp, 4
lea edi, [esi + 4]
push edi
call fcn.10002f90
add esp, 4
mov eax, dword [0x10044e34]
cmp eax, 1
je 0x10005a6d
test eax, eax
jne 0x10005a49
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x1003a01c], eax
cmp eax, 0xffffffff
je 0x10005a7f
mov dword [0x10044e34], 1
jmp 0x10005a6d
push 2
call dword [0x10044bd4]
add esp, 4
push dword [0x10044e34]
push 0x10044e34
push str._once__p_is__ld_n
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
push edi
call fcn.100030f0
add esp, 4
mov ecx, esi
pop esi
pop edi
jmp fcn.10004840
call sub.msvcrt.dll_abort
nop word cs:[eax + eax]
push ebp
push ebx
push edi
push esi
sub esp, 0x50
call fcn.10005da0
mov ebp, 0xb
test eax, eax
je 0x10005d4e
mov ebx, eax
mov ecx, dword [esp + 0x70]
mov eax, dword [esp + 0x6c]
mov edi, dword [esp + 0x64]
mov esi, ebx
test edi, edi
je 0x10005ac5
mov edx, dword [esi + 0xb4]
mov dword [edi], edx
mov dword [esi + 0x68], 0
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
mov dword [esi + 0x24], 1
mov dword [esi + 0x14], 0xffffffff
movaps xmm0, xmmword [0x10033210]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov dword [esi + 0x18], eax
test eax, eax
jne 0x10005bbf
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
movaps xmm0, xmmword [0x10033210]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov dword [esi + 0x18], eax
test eax, eax
jne 0x10005bbf
mov dword [esp], 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
movaps xmm0, xmmword [0x10033210]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov dword [esi + 0x18], eax
test eax, eax
jne 0x10005bbf
mov dword [esp], 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
movaps xmm0, xmmword [0x10033210]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov dword [esi + 0x18], eax
test eax, eax
jne 0x10005bbf
mov dword [esp], 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
movaps xmm0, xmmword [0x10033210]
movups xmmword [esp], xmm0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
sub esp, 0x10
mov dword [esi + 0x18], eax
test eax, eax
jne 0x10005bbf
mov dword [esp], 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
mov dword [esi + 0x1c], 0xffffffff
lea edi, [ebx + 0x38]
mov dword [esp], edi
call fcn.10003e40
cmp eax, 1
je 0x10005d58
mov dword [esi + 0x38], 0xffffffff
mov dword [esi], 0xbab1f00d
mov dword [esi + 0x6c], 0
mov dword [esi + 0x64], 0
cmp dword [esi + 0x18], 0
je 0x10005d06
mov eax, dword [esp + 0x68]
test eax, eax
je 0x10005c19
mov ecx, dword [eax]
mov dword [esi + 0x24], ecx
mov ebp, dword [eax + 8]
test cl, 8
jne 0x10005c1d
add eax, 0xc
jmp 0x10005c25
xor ebp, ebp
jmp 0x10005c2a
call fcn.100043f0
add eax, 0x6c
mov eax, dword [eax]
mov dword [esi + 0x6c], eax
mov dword [esp + 0xc], esi
mov dword [esp + 4], ebp
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 4
mov dword [esp + 8], 0x10005810
mov dword [esp], 0
call dword [sym.imp.msvcrt.dll__beginthreadex]
test eax, eax
je 0x10005cc1
mov ebp, eax
cmp eax, 0xffffffff
je 0x10005cc1
mov ecx, dword [esi + 0x6c]
mov eax, 0xfffffff1
cmp ecx, 0xfffffff2
jl 0x10005c8e
mov eax, 0xfffffffe
cmp ecx, 0xffffffff
jl 0x10005c8e
mov eax, 0xf
cmp ecx, 0xe
jg 0x10005c8e
cmp ecx, 2
mov eax, 2
cmovl eax, ecx
mov dword [esp + 4], eax
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
sub esp, 8
mov eax, dword [esi + 0x18]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
sub esp, 4
test byte [esi + 0x24], 4
jne 0x10005d1d
mov dword [esi + 0x14], ebp
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x10005d39
add ebx, 0x1c
mov eax, dword [esi + 0x18]
test eax, eax
je 0x10005cd7
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov dword [esp], ebx
call fcn.10003280
mov dword [esp], edi
call fcn.10003e40
cmp eax, 1
mov ebp, 0xb
je 0x10005d58
mov dword [esi + 0x38], 0xffffffff
mov dword [esi + 0x18], 0
mov dword [esi + 0x14], 0
mov eax, dword [esp + 0x64]
test eax, eax
je 0x10005d14
mov dword [eax], 0
mov ecx, esi
call fcn.10004f70
jmp 0x10005d4e
mov dword [esi + 0x14], 0
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_ResumeThread]
sub esp, 4
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_Sleep]
sub esp, 4
xor ebp, ebp
mov eax, ebp
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret
xorps xmm0, xmm0
movsd qword [esp + 0x45], xmm0
xorps xmm0, xmm0
movups xmmword [esp + 0x38], xmm0
movups xmmword [esp + 0x28], xmm0
movups xmmword [esp + 0x18], xmm0
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esp + 0xc], eax
lea esi, [esp + 0x18]
mov dword [esp], esi
call fcn.10006790
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
sub esp, 4
call sub.msvcrt.dll_abort
nop word [eax + eax]