Function at 0x408080
Capabilities:
Get thread local storage value

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov byte [esp + 0x17], dl
mov dword [esp + 0x18], 0
test edi, edi
je 0x4080a1
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x4080a3
xor eax, eax
push dword [eax + 0xb8]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x4080c2
mov eax, 0xfffffffa
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
push 0xf0
push 1
call fcn.00420a64
mov esi, eax
add esp, 8
test esi, esi
je 0x408119
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 0x408119
mov eax, dword [esp + 0x30]
movzx ebp, ax
lea eax, [ebp + 8]
push eax
call fcn.00421172
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x408128
mov ecx, esi
call fcn.004092f0
mov eax, 0xfffffff5
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov al, byte [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov dl, byte [esp + 0x17]
mov byte [ebx + 1], al
mov eax, ecx
shr eax, 8
mov byte [esp + 0x21], al
mov byte [esp + 0x20], cl
movzx eax, word [esp + 0x20]
mov ecx, dword [esp + 0x28]
mov word [ebx + 2], ax
mov eax, ecx
shr eax, 8
mov byte [esp + 0x21], al
mov byte [esp + 0x20], cl
movzx eax, word [esp + 0x20]
mov ecx, dword [esp + 0x30]
mov word [ebx + 4], ax
mov eax, ecx
shr eax, 8
mov byte [esp + 0x21], al
mov byte [esp + 0x20], cl
movzx eax, word [esp + 0x20]
mov byte [ebx], dl
mov word [ebx + 6], ax
test dl, dl
js 0x408198
push ebp
push dword [esp + 0x30]
lea eax, [ebx + 8]
push eax
call fcn.00418990
add esp, 0xc
mov eax, dword [esp + 0x34]
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], 0x407fa0
and ecx, 0xffffff00
movzx eax, al
or ecx, eax
mov byte [esi + 4], 2
add ecx, 8
lea eax, [esp + 0x18]
mov dword [esi + 0x10], ecx
mov ecx, esi
mov dword [esi + 0x1c], eax
call fcn.00409770
mov ebx, eax
mov ecx, esi
test ebx, ebx
jns 0x4081f3
call fcn.004092f0
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
call fcn.00407fe0
cmp byte [esp + 0x17], 0
jge 0x408215
push dword [esi + 0x14]
mov eax, dword [esi + 0x20]
add eax, 8
push eax
push dword [esp + 0x34]
call fcn.00418990
add esp, 0xc
mov ecx, dword [esi + 0xc]
cmp ecx, 6
ja case.default.0x408221
jmp dword [ecx*4 + 0x4082f0]
mov edi, dword [esi + 0x14]
mov ecx, esi
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffff9
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffff7
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffffc
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
mov edi, 0xfffffff8
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
mov ecx, esi
or edi, 0xffffffff
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18
test edi, edi
je 0x4082c0
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x4082c2
xor eax, eax
push ecx
push str.unrecognised_status_code__d
push str.libusb_control_transfer
push 2
push eax
call fcn.00407e20
add esp, 0x14
mov ecx, esi
mov edi, 0xffffff9d
call fcn.004092f0
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x18