Function at 0x407be0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
push edi
mov edi, ecx
mov byte [ebp - 1], dl
mov dword [ebp - 8], 0
test edi, edi
je 0x407c01
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x407c03
xor eax, eax
push dword [eax + 0xb8]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x407c21
mov eax, 0xfffffffa
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
push 0xf0
push 1
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov esi, eax
add esp, 8
test esi, esi
je 0x407c79
lea ecx, [esi + 0xac]
mov dword [esi + 0x70], 0
push ecx
mov dword [esi + 0xc4], esi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
add esi, 0xc8
je 0x407c79
mov eax, dword [ebp + 0x18]
movzx eax, ax
add eax, 8
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x407c87
mov ecx, esi
call fcn.00408e40
mov eax, 0xfffffff5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov al, byte [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov dl, byte [ebp - 1]
mov byte [ebx + 1], al
mov eax, ecx
shr eax, 8
mov byte [ebp + 9], al
mov byte [ebp + 8], cl
movzx eax, word [ebp + 8]
mov ecx, dword [ebp + 0x10]
mov word [ebx + 2], ax
mov eax, ecx
shr eax, 8
mov byte [ebp + 9], al
mov byte [ebp + 8], cl
movzx eax, word [ebp + 8]
mov ecx, dword [ebp + 0x18]
mov word [ebx + 4], ax
mov eax, ecx
shr eax, 8
mov byte [ebp + 9], al
mov byte [ebp + 8], cl
movzx eax, word [ebp + 8]
mov byte [ebx], dl
mov word [ebx + 6], ax
test dl, dl
js 0x407ceb
movzx eax, cx
push eax
push dword [ebp + 0x14]
lea eax, [ebx + 8]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov eax, dword [ebp + 0x1c]
mov dword [esi + 8], eax
mov dword [esi], edi
mov word [esi + 5], 0
mov dword [esi + 0x20], ebx
movzx eax, word [ebx + 6]
mov ecx, eax
mov dword [esi + 0x18], 0x407a40
and ecx, 0xffffff00
movzx eax, al
or ecx, eax
mov byte [esi + 4], 2
add ecx, 8
lea eax, [ebp - 8]
mov dword [esi + 0x10], ecx
mov ecx, esi
mov dword [esi + 0x1c], eax
call fcn.004092a0
mov ebx, eax
mov ecx, esi
test ebx, ebx
jns 0x407d43
call fcn.00408e40
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
call fcn.00407a80
cmp byte [ebp - 1], 0
jge 0x407d63
push dword [esi + 0x14]
mov eax, dword [esi + 0x20]
add eax, 8
push eax
push dword [ebp + 0x14]
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov ecx, dword [esi + 0xc]
cmp ecx, 6
ja case.default.0x407d6f
jmp dword [ecx*4 + 0x407e38]
mov edi, dword [esi + 0x14]
mov ecx, esi
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, esi
mov edi, 0xfffffff9
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, esi
mov edi, 0xfffffff7
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, esi
mov edi, 0xfffffffc
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, esi
mov edi, 0xfffffff8
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, esi
or edi, 0xffffffff
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
test edi, edi
je 0x407e08
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x407e0a
xor eax, eax
push ecx
push str.unrecognised_status_code__d
push str.libusb_control_transfer
push 2
push eax
call fcn.004078c0
add esp, 0x14
mov ecx, esi
mov edi, 0xffffff9d
call fcn.00408e40
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18