Function at 0x4858c0
Capabilities:
Get thread local storage value

Disassembly:
push ecx
mov eax, dword [esp + 8]
test eax, eax
je 0x485ae0
mov eax, dword [eax + 0x24]
push ebx
push ebp
push esi
push edi
mov edi, dword [eax + 4]
push 0x55e1e8
push str.libusb_close
push 4
push edi
call fcn.00486eb0
add esp, 0x10
push dword [edi + 0xb8]
call dword [sym.imp.kernel32.dll_TlsGetValue]
mov ebx, dword [sym.imp.kernel32.dll_EnterCriticalSection]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x485950
lea esi, [edi + 0xd8]
push esi
call ebx
mov ecx, dword [edi + 0xf4]
mov edx, dword [edi + 0xf0]
lea eax, [ecx + 1]
mov dword [edi + 0xf4], eax
test ecx, ecx
jne 0x485933
mov eax, edx
or eax, 0x20
mov dword [edi + 0xf0], eax
test edx, edx
jne 0x485943
lea eax, [edi + 0xc]
push eax
call fcn.0048b4f0
add esp, 4
push esi
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
push edi
call fcn.00488ef0
lea eax, [edi + 0x84]
push eax
call ebx
mov ebp, dword [edi + 0x80]
lea eax, [edi + 0x7c]
mov ebx, dword [ebp + 4]
lea esi, [ebp - 4]
sub ebx, 4
cmp ebp, eax
je 0x485a34
mov eax, dword [esp + 0x18]
cmp dword [esi + 0x58], eax
jne 0x485a1e
lea eax, [esi + 0x3c]
push eax
call dword [sym.imp.kernel32.dll_EnterCriticalSection]
test byte [esi + 0x30], 4
jne 0x4859ce
push str.Device_handle_closed_while_transfer_was_still_being_processed__but_the_device_is_still_connected_as_far_as_we_know
push str.do_close
push 1
push edi
call fcn.00486eb0
add esp, 0x10
test byte [esi + 0x30], 2
je 0x4859b9
push str.A_cancellation_for_an_in_flight_transfer_hasnt_completed_but_closing_the_device_handle
push str.do_close
push 2
jmp 0x4859c5
push str.A_cancellation_hasnt_even_been_scheduled_on_the_transfer_for_which_the_device_is_closing
push str.do_close
push 1
push edi
call fcn.00486eb0
add esp, 0x10
lea eax, [esi + 0x3c]
push eax
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov ecx, dword [ebp + 4]
mov eax, dword [ebp]
push dword [esp + 0x18]
mov dword [ecx], eax
mov ecx, dword [ebp]
mov eax, dword [ebp + 4]
mov dword [ecx + 4], eax
lea eax, [esi + 0x58]
push eax
push str.Removed_transfer__p_from_the_in_flight_list_because_device_handle__p_closed
push str.do_close
push 4
mov dword [ebp], 0
mov dword [ebp + 4], 0
push edi
mov dword [eax], 0
call fcn.00486eb0
mov eax, dword [esp + 0x30]
add esp, 0x18
mov esi, ebx
lea ecx, [edi + 0x7c]
mov ebx, dword [ebx + 8]
sub ebx, 4
lea ebp, [esi + 4]
cmp ebp, ecx
jne 0x485977
lea eax, [edi + 0x84]
push eax
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
mov ebp, dword [sym.imp.kernel32.dll_EnterCriticalSection]
lea esi, [edi + 0x3c]
push esi
call ebp
mov ebx, dword [esp + 0x18]
push esi
mov ecx, dword [ebx + 0x20]
mov eax, dword [ebx + 0x1c]
mov dword [ecx], eax
mov ecx, dword [ebx + 0x1c]
mov eax, dword [ebx + 0x20]
mov dword [ecx + 4], eax
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x20], 0
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
push ebx
call dword [0x55f5ac]
add esp, 4
push dword [ebx + 0x24]
call fcn.00486950
push ebx
call dword [sym.imp.kernel32.dll_DeleteCriticalSection]
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
cmp dword [esp + 0x10], 0
jne 0x485adc
lea esi, [edi + 0xd8]
push esi
call ebp
add dword [edi + 0xf4], 0xffffffff
jne 0x485aba
and dword [edi + 0xf0], 0xffffffdf
cmp dword [edi + 0xf0], 0
jne 0x485acf
lea eax, [edi + 0xc]
push eax
call fcn.0048b370
add esp, 4
push esi
call dword [sym.imp.kernel32.dll_LeaveCriticalSection]
push edi
call fcn.00489060
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 4