Function at 0x485320
Capabilities:
Get thread local storage value

Disassembly:
push ecx
push edi
mov edi, dword [esp + 0xc]
mov dword [esp + 4], 0
test edi, edi
je 0x48533a
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x48533c
xor eax, eax
push dword [eax + 0xb8]
call dword [sym.imp.kernel32.dll_TlsGetValue]
test eax, eax
je 0x485356
mov eax, 0xfffffffa
pop edi
pop ecx
ret 0x20
push esi
push 0
call fcn.004885f0
mov esi, eax
test esi, esi
jne 0x48536d
lea eax, [esi - 0xb]
pop esi
pop edi
pop ecx
ret 0x20
mov eax, dword [esp + 0x28]
push ebx
push ebp
movzx ebp, ax
lea eax, [ebp + 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 0x48539a
push esi
call fcn.00488740
pop ebp
lea eax, [ebx - 0xb]
pop ebx
pop esi
pop edi
pop ecx
ret 0x20
mov al, byte [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov dl, byte [esp + 0x1c]
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 0x48540a
push ebp
push dword [esp + 0x30]
lea eax, [ebx + 8]
push eax
call fcn.00517140
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], 0x485570
and ecx, 0xffffff00
movzx eax, al
or ecx, eax
mov byte [esi + 4], 2
add ecx, 8
lea eax, [esp + 0x10]
push esi
mov dword [esi + 0x10], ecx
mov dword [esi + 0x1c], eax
call fcn.00488f50
mov ebx, eax
push esi
test ebx, ebx
jns 0x485461
call fcn.00488740
pop ebp
mov eax, ebx
pop ebx
pop esi
pop edi
pop ecx
ret 0x20
call fcn.004855b0
add esp, 4
cmp byte [esp + 0x1c], 0
jge 0x485486
push dword [esi + 0x14]
mov eax, dword [esi + 0x20]
add eax, 8
push eax
push dword [esp + 0x34]
call fcn.00517140
add esp, 0xc
mov ecx, dword [esi + 0xc]
cmp ecx, 6
ja case.default.0x485492
jmp dword [ecx*4 + 0x48554c]
mov edi, dword [esi + 0x14]
push esi
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20
push esi
mov edi, 0xfffffff9
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20
push esi
mov edi, 0xfffffff7
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20
push esi
mov edi, 0xfffffffc
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20
push esi
mov edi, 0xfffffff8
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20
push esi
or edi, 0xffffffff
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20
test edi, edi
je 0x48551f
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 4]
jmp 0x485521
xor eax, eax
push ecx
push str.unrecognised_status_code__d
push str.libusb_control_transfer
push 2
push eax
call fcn.00486eb0
add esp, 0x14
mov edi, 0xffffff9d
push esi
call fcn.00488740
pop ebp
pop ebx
pop esi
mov eax, edi
pop edi
pop ecx
ret 0x20