Function at 0x59a850
Capabilities:
Allocate thread local storage

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [ebp + 8]
mov ebx, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea edi, [esi + 0x84]
mov dword [esp], edi
call ebx
lea eax, [esi + 0x9c]
sub esp, 4
mov dword [ebp - 0x1c], eax
mov dword [esp], eax
call ebx
lea eax, [esi + 0xbc]
sub esp, 4
mov dword [ebp - 0x20], eax
mov dword [esp], eax
call ebx
lea eax, [esi + 0xd4]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_InitializeConditionVariable]
lea eax, [esi + 0xd8]
sub esp, 4
mov dword [ebp - 0x24], eax
mov dword [esp], eax
call ebx
sub esp, 4
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
mov dword [esi + 0xb8], eax
je 0x59aa90
lea eax, [esi + 0x7c]
lea ebx, [esi + 0xc]
mov dword [esi + 0x80], eax
mov dword [esi + 0x7c], eax
lea eax, [esi + 0xf8]
mov dword [esi + 0xfc], eax
mov dword [esi + 0xf8], eax
lea eax, [esi + 0x100]
mov dword [esi + 0x104], eax
mov dword [esi + 0x100], eax
lea eax, [esi + 0x110]
mov dword [esi + 0x114], eax
mov dword [esi + 0x110], eax
lea eax, [esi + 0x118]
mov dword [esi + 0x11c], eax
mov dword [esi + 0x118], eax
mov dword [esp], ebx
call sym._usbi_create_event
test eax, eax
mov ecx, eax
js 0x59a9df
mov dword [esp + 8], 0
mov eax, dword [esi + 0xc]
mov dword [esp], esi
mov dword [esp + 4], eax
call sym._usbi_add_event_source
test eax, eax
mov ecx, eax
js 0x59a9d1
lea eax, [esi + 0x10]
mov dword [esp], eax
mov dword [ebp - 0x28], eax
call sym._usbi_create_timer
test eax, eax
jne 0x59aa60
mov dword [esp + 0xc], str.using_timer_for_timeouts
mov dword [esp + 8], str.usbi_io_init
mov dword [esp + 4], 4
mov dword [esp], esi
call sym._usbi_log
mov dword [esp + 8], 0
mov eax, dword [esi + 0x10]
mov dword [esp], esi
mov dword [esp + 4], eax
call sym._usbi_add_event_source
test eax, eax
js 0x59a9b1
xor ebx, ebx
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sym._usbi_destroy_timer
mov eax, dword [esi + 0xc]
mov dword [esp], esi
mov dword [esp + 4], eax
call sym._usbi_remove_event_source
mov ecx, dword [ebp - 0x2c]
mov dword [esp], ebx
mov dword [ebp - 0x28], ecx
call sym._usbi_destroy_event
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 0x28], ecx
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov dword [esp], edi
call ebx
mov eax, dword [ebp - 0x1c]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x20]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x24]
sub esp, 4
mov dword [esp], eax
call ebx
mov eax, dword [esi + 0xb8]
sub esp, 4
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsFree]
mov ecx, dword [ebp - 0x28]
sub esp, 4
test eax, eax
mov ebx, ecx
jne 0x59a9a7
mov dword [esp + 8], 0x69
mov dword [esp + 4], str.os_threads_windows.h
mov dword [esp], str.TlsFree_key____0
call dword [sym.imp.msvcrt.dll__assert]
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], str.timer_not_available_for_timeouts
mov dword [esp + 8], str.usbi_io_init
xor ebx, ebx
mov dword [esp + 4], 4
mov dword [esp], esi
call sym._usbi_log
jmp 0x59a9a7
mov dword [esp + 8], 0x5d
mov dword [esp + 4], str.os_threads_windows.h
mov dword [esp], str.key___TLS_OUT_OF_INDEXES
call dword [sym.imp.msvcrt.dll__assert]
jmp 0x59a8ca