Function at 0x411080
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 4], ebx
lea eax, [edi + 0xec]
push eax
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [edi + 0xc0]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x4110c5
mov esi, dword [ebp - 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
lea eax, [ebx - 6]
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push dword [edi + 0xc0]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
lea esi, [edi + 0xec]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push edi
call fcn.00410fa0
add esp, 4
test byte [edi + 0x104], 1
je 0x4111c2
push str.poll_fds_modified__reallocating
push str.handle_events
push 4
push 0
call fcn.0040fc50
push dword [edi + 0x11c]
call fcn.00425d83
push 8
push dword [edi + 0x120]
mov dword [edi + 0x11c], ebx
call fcn.00429fb4
add esp, 0x1c
mov dword [edi + 0x11c], eax
test eax, eax
jne 0x41114c
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call eax
mov esi, 0xfffffff5
jmp 0x4115b1
mov eax, dword [edi + 0x110]
lea ebx, [edi + 0x10c]
lea esi, [eax - 8]
cmp eax, ebx
je 0x41118b
mov edx, 0xfffffff8
mov ecx, dword [edi + 0x11c]
lea edx, [edx + 8]
mov eax, dword [esi]
mov dword [edx + ecx], eax
mov ecx, dword [edi + 0x11c]
mov ax, word [esi + 4]
mov word [edx + ecx + 4], ax
mov eax, dword [esi + 0xc]
lea esi, [eax - 8]
cmp eax, ebx
jne 0x411164
and dword [edi + 0x104], 0xfffffffe
jne 0x4111c2
cmp dword [edi + 0x108], 0
jne 0x4111c2
lea eax, [edi + 0x124]
cmp dword [edi + 0x128], eax
jne 0x4111c2
lea eax, [edi + 0x12c]
cmp dword [edi + 0x130], eax
jne 0x4111c2
push edi
call fcn.0040fb00
add esp, 4
mov ebx, dword [edi + 0x120]
mov eax, dword [edi + 0x11c]
push ebx
push eax
mov dword [ebp - 4], eax
call fcn.00412e40
add esp, 8
lea eax, [edi + 0xec]
push eax
mov eax, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call eax
mov ecx, dword [ebp + 0xc]
mov esi, 0x3e8
mov eax, dword [ecx + 4]
cdq
idiv esi
imul ecx, dword [ecx], 0x3e8
add eax, ecx
test edx, edx
lea esi, [eax + 1]
cmove esi, eax
push esi
push ebx
push str.poll____d_fds_with_timeout_in__dms
push str.handle_events
push 4
push 0
call fcn.0040fc50
push esi
push ebx
push dword [ebp - 4]
call fcn.00413000
mov esi, eax
push esi
push str.poll___returned__d
push str.handle_events
push 4
push 0
mov dword [ebp - 8], esi
call fcn.0040fc50
add esp, 0x38
test esi, esi
jne 0x41126e
lea esi, [edi + 0x80]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push edi
call fcn.004115e0
add esp, 4
mov dword [ebp - 8], eax
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [ebp - 8]
jmp 0x4115b1
cmp esi, 0xffffffff
jne 0x411287
call fcn.0042a043
cmp dword [eax], 4
jne 0x41128b
mov esi, 0xfffffff6
jmp 0x4115b1
test esi, esi
jns 0x4112b0
call fcn.0042a043
push dword [eax]
push esi
push str.poll_failed__d_err_d
push str.handle_events
push 1
push edi
call fcn.0040fc50
add esp, 0x18
or esi, 0xffffffff
jmp 0x4115b1
mov edx, dword [ebp - 4]
cmp word [edx + 6], 0
je 0x411515
push str.caught_a_fish_on_the_event_pipe
push str.handle_events
xor esi, esi
mov dword [ebp - 0xc], 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x10], esi
push 4
push esi
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], eax
call fcn.0040fc50
add esp, 0x10
lea eax, [edi + 0xec]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [edi + 0x104]
test al, 1
je 0x41131a
push str.someone_updated_the_poll_fds
push str.handle_events
push 4
push esi
call fcn.0040fc50
mov eax, dword [edi + 0x104]
add esp, 0x10
test al, 2
je 0x411341
push str.someone_purposely_interrupted
push str.handle_events
push 4
push 0
call fcn.0040fc50
add esp, 0x10
and dword [edi + 0x104], 0xfffffffd
mov eax, dword [edi + 0x104]
test al, 4
je 0x411369
push str.someone_unregistered_a_hotplug_cb
push str.handle_events
push 4
push 0
call fcn.0040fc50
add esp, 0x10
mov dword [ebp - 0xc], 1
and dword [edi + 0x104], 0xfffffffb
cmp dword [edi + 0x108], esi
je 0x411387
push str.someone_is_closing_a_device
push str.handle_events
push 4
push 0
call fcn.0040fc50
add esp, 0x10
lea esi, [edi + 0x124]
cmp dword [edi + 0x128], esi
je 0x4113c7
push str.hotplug_message_received
push str.handle_events
push 4
push 0
call fcn.0040fc50
mov eax, dword [esi + 4]
add esp, 0x10
cmp eax, esi
je 0x4113c7
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x18]
mov dword [eax], ecx
mov eax, dword [esi]
mov dword [ebp - 0x18], eax
mov dword [eax + 4], ecx
mov dword [esi + 4], esi
mov dword [esi], esi
mov esi, dword [edi + 0x130]
lea ecx, [edi + 0x12c]
cmp esi, ecx
je 0x41144e
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [ecx], eax
mov ecx, dword [esi]
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
lea eax, [edi + 0xec]
push eax
mov dword [esi], 0
mov dword [esi + 4], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [esi - 0xc]
push eax
call dword [0x43f42c]
add esp, 4
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x411423
lea eax, [edi + 0xec]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x4113c7
push eax
push str.backend_handle_transfer_completion_failed_with_error__d
push str.handle_events
push 1
push edi
call fcn.0040fc50
add esp, 0x14
lea esi, [edi + 0xec]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [edi + 0x12c]
jmp 0x411454
lea esi, [edi + 0xec]
cmp dword [edi + 0x104], 0
jne 0x411485
cmp dword [edi + 0x108], 0
jne 0x411485
lea eax, [edi + 0x124]
cmp dword [edi + 0x128], eax
jne 0x411485
cmp dword [edi + 0x130], ecx
jne 0x411485
push edi
call fcn.0040fb00
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 0xc], 0
je 0x41149d
push 0
push edi
call fcn.00413250
add esp, 8
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x18]
cmp eax, ecx
je 0x4114f8
push dword [eax - 8]
lea esi, [eax - 8]
push dword [esi + 4]
push edi
call fcn.00413300
add esp, 0xc
cmp dword [esi], 2
jne 0x4114c6
push dword [esi + 4]
call fcn.0040f920
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 8]
push esi
mov dword [ecx], eax
mov ecx, dword [esi + 8]
mov eax, dword [esi + 0xc]
mov dword [ecx + 4], eax
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0
call fcn.00425d83
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x18]
add esp, 4
cmp eax, ecx
jne 0x4114a7
mov esi, dword [ebp - 0x10]
test esi, esi
jne 0x4115b1
mov esi, dword [ebp - 8]
sub esi, 1
mov dword [ebp - 8], esi
je 0x4115b1
mov edx, dword [ebp - 4]
mov eax, dword [edi + 0x118]
lea esi, [edi + 0x114]
mov dword [ebp - 0xc], esi
lea ecx, [eax - 8]
cmp eax, esi
je 0x41157f
mov edi, ecx
mov ecx, esi
nop
mov esi, 1
cmp ebx, esi
jbe 0x411572
mov ecx, dword [edi]
nop dword [eax + eax]
mov eax, dword [edx + esi*8]
cmp ecx, eax
je 0x41154e
inc esi
cmp esi, ebx
jb 0x411540
jmp 0x41156f
push eax
push str.pollfd__d_was_removed._ignoring_raised_events
push str.handle_events
push 4
push 0
call fcn.0040fc50
mov edx, dword [ebp - 4]
add esp, 0x14
xor eax, eax
mov word [edx + esi*8 + 6], ax
mov ecx, dword [ebp - 0xc]
mov eax, dword [edi + 0xc]
lea edi, [eax - 8]
cmp eax, ecx
jne 0x411530
mov edi, dword [ebp + 8]
mov eax, dword [ebp - 8]
push eax
lea eax, [ebx - 1]
push eax
lea eax, [edx + 8]
push eax
push edi
call dword [0x43f428]
mov esi, eax
add esp, 0x10
test esi, esi
je 0x4115b1
push esi
push str.backend_handle_events_failed_with_error__d
push str.handle_events
push 1
push edi
call fcn.0040fc50
add esp, 0x14
push 0
push dword [edi + 0xc0]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ebx
push dword [ebp - 4]
call fcn.00412d80
add esp, 8
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret