Function at 0x5946e0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [ebp + 8]
test edi, edi
je 0x594803
mov eax, dword [edi + 0x24]
mov esi, dword [eax + 4]
mov dword [esp + 0xc], 0x727a74
mov dword [esp + 8], str.libusb_close
mov dword [esp + 4], 4
mov dword [esp], esi
call sym._usbi_log
mov eax, dword [esi + 0xb8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
test eax, eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x1c], edx
je 0x59495f
lea eax, [esi + 0x84]
mov dword [ebp - 0x28], eax
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [esi + 0x80]
lea edx, [esi + 0x7c]
sub esp, 4
lea ebx, [ecx - 4]
mov eax, dword [ebx + 8]
sub eax, 4
cmp edx, ecx
je 0x59478d
mov dword [ebp - 0x20], esi
nop
cmp edi, dword [ebx + 0x4c]
mov esi, eax
je 0x594810
mov eax, dword [esi + 8]
lea ecx, [esi + 4]
mov ebx, esi
sub eax, 4
cmp edx, ecx
jne 0x594770
mov esi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x28]
lea ebx, [esi + 0x3c]
mov dword [esp], eax
call dword [ebp - 0x1c]
sub esp, 4
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x20]
mov ecx, dword [edi + 0x1c]
sub esp, 4
mov dword [eax], ecx
mov ecx, dword [edi + 0x1c]
mov dword [ecx + 4], eax
mov dword [edi + 0x1c], 0
mov dword [edi + 0x20], 0
mov dword [esp], ebx
call dword [ebp - 0x1c]
sub esp, 4
mov dword [esp], edi
call dword [0x72a464]
mov eax, dword [edi + 0x24]
mov dword [esp], eax
call sym._libusb_unref_device_4
sub esp, 4
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
sub esp, 4
mov dword [esp], edi
call sym._free
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x5948ec
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 4
lea eax, [ebx + 0x30]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x2c], eax
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
test byte [ebx + 0x24], 4
mov edx, dword [ebp - 0x30]
je 0x594895
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x30], edx
add ebx, 0x4c
mov dword [esp], eax
call dword [ebp - 0x1c]
mov eax, dword [ebx - 0x44]
mov ecx, dword [ebx - 0x48]
sub esp, 4
mov dword [eax], ecx
mov ecx, dword [ebx - 0x48]
mov dword [ecx + 4], eax
mov eax, dword [ebp - 0x20]
mov dword [ebx - 0x48], 0
mov dword [ebx - 0x44], 0
mov dword [ebx], 0
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.Removed_transfer__p_from_the_in_flight_list_because_device_handle__p_closed
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 4
mov dword [esp], eax
call sym._usbi_log
mov edx, dword [ebp - 0x30]
jmp 0x59477b
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], str.Device_handle_closed_while_transfer_was_still_being_processed__but_the_device_is_still_connected_as_far_as_we_know
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._usbi_log
test byte [ebx + 0x24], 2
mov edx, dword [ebp - 0x30]
je 0x594931
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], str.A_cancellation_for_an_in_flight_transfer_hasnt_completed_but_closing_the_device_handle
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 2
mov dword [esp], eax
call sym._usbi_log
mov edx, dword [ebp - 0x30]
jmp 0x59482e
lea ebx, [esi + 0xd8]
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
sub esp, 4
sub dword [esi + 0xf4], 1
mov eax, dword [esi + 0xf0]
je 0x5949b9
test eax, eax
je 0x5949d4
mov dword [esp], ebx
call dword [ebp - 0x1c]
mov dword [ebp + 8], esi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp sym._libusb_unlock_events_4
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], str.A_cancellation_hasnt_even_been_scheduled_on_the_transfer_for_which_the_device_is_closing
mov dword [esp + 8], str.do_close
mov dword [esp + 4], 1
mov dword [ebp - 0x30], edx
mov dword [esp], eax
call sym._usbi_log
mov edx, dword [ebp - 0x30]
jmp 0x59482e
lea ebx, [esi + 0xd8]
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi + 0xf4]
sub esp, 4
mov edx, dword [esi + 0xf0]
lea ecx, [eax + 1]
test eax, eax
mov dword [esi + 0xf4], ecx
jne 0x594995
mov eax, edx
or eax, 0x20
mov dword [esi + 0xf0], eax
test edx, edx
je 0x5949c7
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp], ebx
mov dword [ebp - 0x1c], eax
call eax
sub esp, 4
mov dword [esp], esi
call sym._libusb_lock_events_4
sub esp, 4
jmp 0x594740
and eax, 0xffffffdf
mov dword [esi + 0xf0], eax
jmp 0x594911
lea eax, [esi + 0xc]
mov dword [esp], eax
call sym._usbi_signal_event
jmp 0x594999
lea eax, [esi + 0xc]
mov dword [esp], eax
call sym._usbi_clear_event
jmp 0x594919