Function at 0x59b000
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 0x14]
mov esi, dword [ebp + 0x20]
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp + 0x10]
mov word [ebp - 0x32], di
mov word [ebp - 0x3a], si
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x38], eax
mov word [ebp - 0x34], ax
mov eax, dword [ebp + 8]
test eax, eax
je 0x59b1a0
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
mov eax, dword [eax + 4]
mov eax, dword [eax + 0xb8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
test eax, eax
mov edx, 0xfffffffa
jne 0x59b192
mov dword [esp], 0
call sym._libusb_alloc_transfer_4
sub esp, 4
test eax, eax
mov ebx, eax
je 0x59b270
movzx eax, si
mov dword [ebp - 0x40], eax
add eax, 8
mov dword [esp], eax
call sym._malloc
test eax, eax
mov edx, eax
je 0x59b27a
movzx eax, byte [ebp - 0x2c]
xor ecx, ecx
mov byte [edx], al
movzx eax, byte [ebp - 0x30]
mov byte [edx + 1], al
mov eax, edi
shr ax, 8
mov ch, al
movzx eax, word [ebp - 0x38]
mov cl, byte [ebp - 0x32]
mov word [edx + 2], cx
xor ecx, ecx
shr ax, 8
mov ch, al
mov cl, byte [ebp - 0x34]
mov eax, esi
shr ax, 8
mov word [edx + 4], cx
xor ecx, ecx
cmp byte [ebp - 0x2c], 0
mov ch, al
mov cl, byte [ebp - 0x3a]
mov word [edx + 6], cx
js 0x59b102
mov edi, dword [ebp - 0x40]
lea eax, [edx + 8]
mov dword [ebp - 0x30], edx
mov dword [esp], eax
mov dword [esp + 8], edi
mov edi, dword [ebp + 0x1c]
mov dword [esp + 4], edi
call sym._memcpy
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp + 8]
mov byte [ebx + 5], 0
mov byte [ebx + 6], 0
mov dword [ebx + 0x20], edx
movzx edx, word [edx + 6]
mov dword [ebx + 0x18], sym._sync_transfer_cb_4
mov dword [ebx], eax
mov eax, dword [ebp + 0x24]
mov byte [ebx + 4], 2
mov ecx, edx
mov dword [ebx + 8], eax
xor eax, eax
shr cx, 8
mov ah, cl
mov al, dl
movzx eax, ax
add eax, 8
mov dword [ebx + 0x10], eax
lea eax, [ebp - 0x1c]
mov dword [ebx + 0x1c], eax
mov dword [esp], ebx
call sym._libusb_submit_transfer_4
sub esp, 4
test eax, eax
js 0x59b250
mov eax, ebx
call sym._sync_transfer_wait_for_completion
cmp byte [ebp - 0x2c], 0
js 0x59b1f0
mov eax, dword [ebx + 0xc]
cmp eax, 6
ja case.default.0x59b172
jmp dword [eax*4 + 0x729730]
mov esi, 0xfffffff9
mov dword [esp], ebx
call sym._libusb_free_transfer_4
mov edx, esi
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, edx
pop ebx
pop esi
pop edi
pop ebp
ret 0x20
mov eax, dword [0xb8]
ud2
mov esi, 0xfffffff7
jmp 0x59b185
mov esi, 0xfffffffc
jmp 0x59b185
mov esi, 0xffffffff
jmp 0x59b185
mov esi, dword [ebx + 0x14]
jmp 0x59b185
mov esi, 0xfffffff8
jmp 0x59b185
mov eax, dword [ebx + 0x20]
mov edx, dword [ebx + 0x14]
add eax, 8
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x1c]
mov dword [esp], eax
call sym._memcpy
jmp 0x59b166
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 8]
mov esi, 0xffffff9d
mov dword [esp + 0xc], str.unrecognised_status_code__d
mov dword [esp + 8], str.libusb_control_transfer
mov dword [esp + 4], 2
mov eax, dword [eax + 0x24]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sym._usbi_log
jmp 0x59b185
mov dword [esp], ebx
mov dword [ebp - 0x2c], eax
call sym._libusb_free_transfer_4
mov eax, dword [ebp - 0x2c]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
mov edx, eax
pop esi
mov eax, edx
pop edi
pop ebp
ret 0x20
mov edx, 0xfffffff5
jmp 0x59b192
mov dword [esp], ebx
call sym._libusb_free_transfer_4
mov edx, 0xfffffff5
sub esp, 4
jmp 0x59b192