Function at 0x6b8065d0
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
lea edi, [eax + 0xd4]
mov ebx, eax
mov esi, edx
sub esp, 0x6c
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp], edi
mov dword [ebp - 0x44], eax
call eax
sub esp, 4
test byte [ebx + 0xec], 1
je 0x6b806644
mov dword [esp + 0xc], str.event_sources_modified__reallocating_event_data
mov dword [esp + 8], str.handle_events
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, ebx
call sym._cleanup_removed_event_sources
mov dword [esp], ebx
call sym.libusb_1.0.dll_usbi_alloc_event_data
test eax, eax
jne 0x6b806765
and dword [ebx + 0xec], 0xfffffffe
je 0x6b806755
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp], edi
mov dword [ebp - 0x48], eax
call eax
mov ecx, dword [esi + 4]
mov edx, 0x10624dd3
sub esp, 4
imul esi, dword [esi], 0x3e8
mov dword [esp + 4], ebx
mov dword [ebp - 0x28], 0
mov eax, ecx
imul edx
mov eax, ecx
sar eax, 0x1f
sar edx, 6
sub edx, eax
mov eax, dword [ebx + 0xb4]
add esi, edx
imul edx, edx, 0x3e8
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub ecx, edx
cmp ecx, 1
mov dword [ebp - 0x40], eax
sbb esi, 0xffffffff
call eax
sub esp, 8
test eax, eax
jne 0x6b8066c1
mov dword [esp + 8], 0x65
mov dword [esp + 4], str.os_threads_windows.h
mov dword [esp], str.TlsSetValue_key__ptr____0
call dbg._assert
lea eax, [ebp - 0x28]
mov dword [esp + 8], esi
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym.libusb_1.0.dll_usbi_wait_for_events
test eax, eax
mov dword [ebp - 0x3c], eax
jne 0x6b806740
movzx eax, byte [ebp - 0x28]
test al, 1
jne 0x6b806783
test al, 2
jne 0x6b806980
mov eax, dword [ebp - 0x1c]
test eax, eax
jne 0x6b8069c0
mov dword [esp + 4], 0
mov eax, dword [ebx + 0xb4]
mov dword [esp], eax
call dword [ebp - 0x40]
sub esp, 8
test eax, eax
mov ebx, dword [ebp - 0x3c]
jne 0x6b806734
mov dword [esp + 8], 0x65
mov dword [esp + 4], str.os_threads_windows.h
mov dword [esp], str.TlsSetValue_key__ptr____0
call dbg._assert
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 0xfffffff9
jne 0x6b8066fa
mov eax, ebx
call sym._handle_timeouts
mov dword [ebp - 0x3c], 0
jmp 0x6b8066fa
lea eax, [ebx + 0xc]
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_clear_event
jmp 0x6b806644
mov dword [ebp - 0x3c], eax
mov dword [esp], edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x3c]
sub esp, 4
lea esp, [ebp - 0xc]
mov ebx, eax
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], str.event_triggered
mov dword [esp + 8], str.handle_event_trigger
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
lea eax, [ebp - 0x38]
mov dword [esp], edi
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x38], eax
call dword [ebp - 0x44]
mov eax, dword [ebx + 0xec]
sub esp, 4
test al, 1
jne 0x6b806ad0
test al, 2
jne 0x6b806b00
test al, 0x20
jne 0x6b806a90
test al, 8
jne 0x6b806a20
test al, 0x10
mov dword [ebp - 0x4c], 0
je 0x6b8068f3
mov eax, dword [ebx + 0x118]
lea ecx, [ebx + 0x114]
mov dword [ebp - 0x54], ecx
cmp eax, ecx
je 0x6b806b72
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x2c], eax
mov dword [eax], ecx
mov eax, dword [ebx + 0x114]
mov dword [ebp - 0x50], ecx
mov dword [eax + 4], ecx
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x54]
mov dword [ebx + 0x118], eax
mov dword [ebx + 0x114], eax
mov dword [esp], edi
call dword [ebp - 0x48]
mov edx, dword [ebp - 0x2c]
sub esp, 4
cmp dword [ebp - 0x50], edx
lea eax, [edx - 0xc]
mov ecx, dword [eax + 0x10]
lea esi, [ecx - 0xc]
je 0x6b806b43
mov dword [ebp - 0x4c], edi
mov edi, dword [ebp - 0x50]
jmp 0x6b806866
mov ecx, dword [esi + 0x10]
mov eax, esi
lea esi, [esi + 0xc]
cmp edi, esi
lea edx, [ecx - 0xc]
je 0x6b806b40
mov esi, edx
mov edx, dword [eax + 0xc]
mov dword [ecx], edx
mov edx, dword [eax + 0xc]
mov dword [edx + 4], ecx
mov dword [eax + 0xc], 0
mov dword [eax + 0x10], 0
mov dword [esp], eax
call dword [0x6b81b720]
test eax, eax
je 0x6b806851
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.backend_handle_transfer_completion_failed_with_error__d
mov dword [esp + 8], str.handle_event_trigger
mov dword [esp + 4], 1
mov dword [esp], ebx
mov edi, dword [ebp - 0x4c]
mov dword [ebp - 0x4c], eax
call sym.libusb_1.0.dll_usbi_log
mov dword [esp], edi
call dword [ebp - 0x44]
mov eax, dword [ebp - 0x2c]
sub esp, 4
cmp eax, dword [ebp - 0x50]
je 0x6b806b4f
mov ecx, dword [ebp - 0x54]
mov edx, dword [ebx + 0x118]
mov dword [eax], ecx
mov eax, dword [ebp - 0x30]
mov dword [eax + 4], edx
mov edx, dword [ebx + 0x118]
mov dword [edx], eax
mov eax, dword [ebp - 0x2c]
mov dword [ebx + 0x118], eax
mov eax, dword [ebx + 0xec]
test eax, eax
je 0x6b806ac0
mov dword [esp], edi
call dword [ebp - 0x48]
mov edi, dword [ebp - 0x34]
lea eax, [ebp - 0x38]
sub esp, 4
cmp edi, eax
jne 0x6b806930
jmp 0x6b806960
mov eax, dword [esi + 0xc]
mov edx, dword [esi + 8]
mov dword [eax], edx
mov edx, dword [esi + 8]
mov dword [edx + 4], eax
mov dword [esp], esi
call sym._free
mov edi, dword [ebp - 0x34]
lea eax, [ebp - 0x38]
cmp edi, eax
je 0x6b806960
mov eax, dword [edi - 8]
lea esi, [edi - 8]
mov dword [esp + 8], eax
mov eax, dword [esi + 4]
mov dword [esp], ebx
mov dword [esp + 4], eax
call sym.libusb_1.0.dll_usbi_hotplug_match
cmp dword [edi - 8], 2
jne 0x6b806910
mov eax, dword [esi + 4]
mov dword [esp], eax
call sym.libusb_1.0.dll_libusb_unref_device
sub esp, 4
jmp 0x6b806910
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x6b806a10
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x3c], eax
jmp 0x6b8066fa
lea esi, [ebx + 0x80]
mov dword [esp], esi
call dword [ebp - 0x44]
mov eax, ebx
sub esp, 4
call sym._handle_timeouts_locked
mov eax, ebx
call sym._arm_timer_for_next_timeout
mov edi, eax
mov dword [esp], esi
call dword [ebp - 0x48]
sub esp, 4
test edi, edi
je 0x6b8066ef
mov dword [ebp - 0x3c], edi
jmp 0x6b8066fa
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x20]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
call dword [0x6b81b71c]
test eax, eax
mov dword [ebp - 0x3c], eax
je 0x6b8066fa
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.backend_handle_events_failed_with_error__d
mov dword [esp + 8], str.handle_events
mov dword [esp + 4], 1
mov dword [esp], ebx
call sym.libusb_1.0.dll_usbi_log
jmp 0x6b8066fa
movzx eax, byte [ebp - 0x28]
jmp 0x6b8066e7
mov dword [esp + 0xc], str.hotplug_message_received
mov dword [esp + 8], str.handle_event_trigger
lea esi, [ebx + 0x10c]
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [ebx + 0x110]
and dword [ebx + 0xec], 0xfffffff7
cmp eax, esi
je 0x6b806bae
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x34], eax
mov dword [eax], ecx
mov eax, dword [ebx + 0x10c]
mov dword [eax + 4], ecx
mov dword [ebp - 0x38], eax
mov dword [ebx + 0x110], esi
mov dword [ebx + 0x10c], esi
mov eax, dword [ebx + 0xec]
jmp 0x6b8067df
mov dword [esp + 0xc], str.someone_is_closing_a_device
mov dword [esp + 8], str.handle_event_trigger
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [ebx + 0xec]
jmp 0x6b8067d7
lea eax, [ebx + 0xc]
mov dword [esp], eax
call sym.libusb_1.0.dll_usbi_clear_event
jmp 0x6b8068fb
mov dword [esp + 0xc], str.someone_updated_the_event_sources
mov dword [esp + 8], str.handle_event_trigger
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [ebx + 0xec]
jmp 0x6b8067c7
mov dword [esp + 0xc], str.someone_purposefully_interrupted
mov dword [esp + 8], str.handle_event_trigger
mov dword [esp + 4], 4
mov dword [esp], 0
call sym.libusb_1.0.dll_usbi_log
mov eax, dword [ebx + 0xec]
and eax, 0xfffffffd
mov dword [ebx + 0xec], eax
jmp 0x6b8067cf
mov edi, dword [ebp - 0x4c]
mov dword [ebp - 0x4c], 0
jmp 0x6b8068b6
mov eax, dword [ebp - 0x54]
cmp eax, dword [ebx + 0x118]
mov eax, dword [ebx + 0xec]
jne 0x6b8068f3
and eax, 0xffffffef
mov dword [ebx + 0xec], eax
jmp 0x6b8068f3
mov dword [esp + 8], 0x83f
mov dword [esp + 4], str.io.c
mov dword [esp], str._list_empty_ctx__completed_transfers_
call dbg._assert
mov eax, dword [ebx + 0x118]
cmp dword [ebp - 0x54], eax
jne 0x6b806805
lea eax, [ebp - 0x30]
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], eax
jmp 0x6b80682b
mov dword [esp + 8], 0x836
mov dword [esp + 4], str.io.c
mov dword [esp], str._list_empty_ctx__hotplug_msgs_
call dbg._assert
mov eax, dword [ebx + 0x110]
cmp esi, eax
jne 0x6b806a5f
lea eax, [ebp - 0x38]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x38], eax
mov eax, dword [ebx + 0xec]
jmp 0x6b8067df