Function at 0x4019b0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, ecx
mov ebx, dword [edi + 0x24]
test ebx, ebx
je 0x401d14
cmp byte [edi + 0x13], 0
je 0x401afd
cmp dword [edi], 0
lea esi, [edi + 0xef6110]
jne 0x401a21
push 0x1f4
push 1
push esi
push 0xe0
push 0
push 1
mov dl, 0x40
mov byte [esi], 9
mov ecx, ebx
call fcn.00407e70
test eax, eax
jns 0x4019fe
mov dword [edi], eax
cmp dword [edi], 0
jne 0x401a21
mov ecx, dword [edi + 0x24]
mov dl, 0xc0
push 0x1f4
push 1
push esi
push 0x21
push 0
push 1
call fcn.00407e70
test eax, eax
jns 0x401a53
mov dword [edi], eax
xor al, al
cmp dword [edi], 0
jne 0x401a4f
push 0x1f4
push 1
push esi
push 0x21
or al, 0x80
mov dl, 0x40
push 0
mov byte [esi], al
mov ecx, dword [edi + 0x24]
push 1
call fcn.00407e70
test eax, eax
jns 0x401a4a
mov dword [edi], eax
cmp dword [edi], 0
je 0x401a57
xor al, al
jmp 0x401a7b
mov al, byte [esi]
jmp 0x401a23
mov ecx, dword [edi + 0x24]
mov dl, 0xc0
push 0x1f4
push 1
push esi
push 0x23
push 0
push 1
call fcn.00407e70
test eax, eax
jns 0x401a79
mov dword [edi], eax
xor al, al
jmp 0x401a7b
mov al, byte [esi]
cmp dword [edi], 0
jne 0x401ac5
push 0x1f4
push 1
push esi
push 0x23
and al, 0x7f
mov dl, 0x40
push 0
mov byte [esi], al
mov ecx, dword [edi + 0x24]
push 1
call fcn.00407e70
test eax, eax
jns 0x401aa2
mov dword [edi], eax
cmp dword [edi], 0
jne 0x401ac5
mov ecx, dword [edi + 0x24]
mov dl, 0xc0
push 0x1f4
push 1
push esi
push 0x21
push 0
push 1
call fcn.00407e70
test eax, eax
jns 0x401b09
mov dword [edi], eax
xor al, al
and al, 0x7f
cmp dword [edi], 0
jne 0x401aee
push 0x1f4
push 1
push esi
push 0x21
push 0
mov byte [esi], al
mov dl, 0x40
mov ecx, dword [edi + 0x24]
push 1
call fcn.00407e70
test eax, eax
jns 0x401aee
mov dword [edi], eax
lea ecx, [edi + 0x28]
call fcn.00404580
mov ebx, dword [edi + 0x24]
mov byte [edi + 0x13], 0
test ebx, ebx
je 0x401b0d
mov eax, dword [ebx + 0x24]
mov eax, dword [eax + 4]
jmp 0x401b0f
mov al, byte [esi]
jmp 0x401ac7
xor eax, eax
push 0
push str.interface__d
push str.libusb_release_interface
push 4
push eax
call fcn.00407c10
add esp, 0x14
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test byte [ebx + 0x18], 1
je 0x401b52
mov eax, dword [ebx + 0x24]
push 0
push ebx
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x128]
mov eax, dword [eax + 0x2c]
call eax
add esp, 8
test eax, eax
jne 0x401b52
and dword [ebx + 0x18], 0xfffffffe
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [edi + 0x24]
mov ebx, 0x24
test esi, esi
je 0x401b6d
mov eax, dword [esi + 0x24]
mov eax, dword [eax + 4]
jmp 0x401b6f
xor eax, eax
push 0
push str.interface__d
push str.libusb_attach_kernel_driver
push 4
push eax
call fcn.00407c10
mov eax, dword [esi + ebx]
add esp, 0x14
mov eax, dword [eax + 0x34]
mov eax, dword [edi + 0x24]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x401d14
mov eax, dword [eax + 0x24]
push 0x43b354
push str.libusb_close
push 4
mov ebx, dword [eax + 4]
push ebx
call fcn.00407c10
add esp, 0x10
push dword [ebx + 0xb8]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
xor ecx, ecx
lea edx, [ebx + 0xd8]
test eax, eax
setne cl
mov dword [ebp - 0x10], ecx
lea ecx, [ebx + 0xf4]
mov dword [ebp - 8], ecx
test eax, eax
jne 0x401c69
push edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebx + 0xf4]
test ecx, ecx
mov eax, dword [ebx + 0xf0]
mov dword [ebp - 4], eax
lea eax, [ecx + 1]
mov ecx, dword [ebp - 4]
mov dword [ebx + 0xf4], eax
jne 0x401c13
mov eax, ecx
or eax, 0x20
mov dword [ebx + 0xf0], eax
test ecx, ecx
jne 0x401c42
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x401c42
xor ecx, ecx
call fcn.0040a9e0
push eax
push str.SetEvent_failed:__s
push str.usbi_signal_event
push 2
push 0
call fcn.00407c10
add esp, 0x14
lea eax, [ebx + 0xd8]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call eax
lea eax, [ebx + 0x9c]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebx + 0xb4], 1
jmp 0x401c6c
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0xc]
mov ecx, ebx
call fcn.00406fb0
cmp dword [ebp - 0x10], 0
jne 0x401d14
lea eax, [ebx + 0xd8]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 8]
add dword [eax], 0xffffffff
jne 0x401c9c
and dword [ebx + 0xf0], 0xffffffdf
cmp dword [ebx + 0xf0], 0
jne 0x401cd0
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
jne 0x401cd0
xor ecx, ecx
call fcn.0040a9e0
push eax
push str.ResetEvent_failed:__s
push str.usbi_clear_event
push 2
push 0
call fcn.00407c10
add esp, 0x14
mov esi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebx + 0xd8]
push eax
call esi
lea eax, [ebx + 0x9c]
mov dword [ebx + 0xb4], 0
push eax
call esi
lea esi, [ebx + 0xbc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebx + 0xd4]
push eax
call dword [sym.imp.KERNEL32.dll_WakeAllConditionVariable]
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call eax
mov dword [edi], 0
mov dword [edi + 0x24], 0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret