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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x40
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x10], ecx
mov eax, dword [ecx]
mov ebx, eax
test eax, eax
jne 0x4f1714
jmp 0x4f16fa
cmp byte [ebp - 0x3c], 0
je 0x4f1bc1
mov ecx, dword [ebp - 0x10]
mov eax, ebx
mov edx, 2
lock cmpxchg dword [ecx], edx
je 0x4f1a64
mov ebx, eax
test eax, eax
je 0x4f16fa
cmp ebx, 1
je 0x4f16f0
cmp ebx, 3
je 0x4f1a8f
mov eax, ebx
and eax, 3
cmp eax, 2
je 0x4f174e
jmp 0x4f1baa
mov eax, ebx
and eax, 3
cmp eax, 2
jne 0x4f1a50
mov eax, dword [0x54a2a4]
test eax, eax
je 0x4f1773
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jb 0x4f1790
cmp dword [eax + 4], 0
mov esi, eax
je 0x4f1790
add esi, 8
jmp 0x4f1850
mov ecx, 0x54a2a4
call dbg.init
push eax
call sub.KERNEL32.dll_TlsGetValue
cmp eax, 2
jae 0x4f1763
nop dword [eax + eax]
mov eax, dword [0x54a2a4]
test eax, eax
je 0x4f17b0
dec eax
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
je 0x4f17d0
mov edi, eax
cmp eax, 1
jne 0x4f1828
jmp 0x4f1b4d
mov ecx, 0x54a2a4
call dbg.init
push eax
call sub.KERNEL32.dll_TlsGetValue
test eax, eax
jne 0x4f17a4
nop word cs:[eax + eax]
nop
movzx eax, byte [0x5c6170]
mov eax, dword [0x5c6108]
test eax, eax
jne 0x4f17f2
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x4f1ad2
mov dword [0x5c6108], eax
push 0xc
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x4f1ad2
mov dword [eax], 0x54a2a4
mov dword [eax + 4], 0
mov edi, eax
mov eax, dword [0x54a2a4]
test eax, eax
je 0x4f193f
dec eax
push edi
push eax
call sub.KERNEL32.dll_TlsSetValue
mov ecx, dword [edi + 8]
cmp dword [edi + 4], 0
lea esi, [edi + 8]
mov dword [edi + 4], 1
mov dword [edi + 8], 0
je 0x4f1850
test ecx, ecx
je 0x4f1850
lock dec dword [ecx]
jne 0x4f1850
call dbg.drop_slow<std::thread::Inner, alloc::alloc::Global>
mov edi, dword [esi]
test edi, edi
jne 0x4f18f2
movzx eax, byte [0x5c6170]
mov eax, dword [0x5c6108]
test eax, eax
jne 0x4f187c
call sub.KERNEL32.dll_GetProcessHeap
test eax, eax
je 0x4f1ac1
mov dword [0x5c6108], eax
push 0x20
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x4f1ac1
mov dword [eax], 1
mov dword [eax + 4], 1
mov dword [ebp - 0x40], ebx
mov dword [eax + 0x10], 0
mov edi, eax
movq xmm0, qword [0x5c6100]
movd eax, xmm0
pshufd xmm0, xmm0, 0x55
movd edx, xmm0
nop dword [eax]
mov ebx, eax
mov ecx, edx
add ebx, 1
adc ecx, 0
jb 0x4f1a97
lock cmpxchg8b qword [0x5c6100]
jne 0x4f18c0
mov dword [edi + 8], ebx
mov dword [edi + 0xc], ecx
mov byte [edi + 0x18], 0
cmp dword [esi], 0
jne 0x4f1ae3
mov ebx, dword [ebp - 0x40]
mov dword [esi], edi
lock inc dword [edi]
jle 0x4f1aa1
mov ecx, dword [ebp - 0x10]
mov eax, ebx
mov dword [ebp - 0x34], edi
mov byte [ebp - 0x2c], 0
lea edx, [ebp - 0x32]
add eax, 0xfffffffe
mov dword [ebp - 0x30], eax
mov eax, ebx
lock cmpxchg dword [ecx], edx
je 0x4f1a30
mov ebx, eax
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x4f1740
lock dec dword [eax]
jne 0x4f1740
mov ecx, dword [ebp - 0x34]
call dbg.drop_slow<std::thread::Inner, alloc::alloc::Global>
jmp 0x4f1740
mov ecx, 0x54a2a4
call dbg.init
jmp 0x4f1821
call sym.std::sys_common::thread_info::THREAD_INFO::__getit::h3fc2010d449fccbf
mov esi, eax
test eax, eax
je 0x4f1aa5
mov edi, dword [esi]
test edi, edi
jne 0x4f1979
xor ecx, ecx
call sym.std::thread::Thread::new::h58b72483cca6f6fd
cmp dword [esi], 0
mov edi, eax
jne 0x4f1b18
mov dword [esi], edi
lock inc dword [edi]
jle 0x4f1aa1
lock dec byte [edi + 0x18]
je 0x4f19b6
mov esi, dword [0x5c6128]
lea ebx, [edi + 0x18]
test esi, esi
je 0x4f19c4
nop word cs:[eax + eax]
nop
push 0xffffffffffffffff
push 1
push 0x59fd63
push ebx
call esi
xor ecx, ecx
mov al, 1
lock cmpxchg byte [ebx], cl
jne 0x4f19a0
lock dec dword [edi]
jne 0x4f1a30
mov ecx, edi
call dbg.drop_slow<std::thread::Inner, alloc::alloc::Global>
jmp 0x4f1a30
mov ecx, dword [0x54a27c]
cmp ecx, 0xffffffff
jne 0x4f1a0e
mov dword [ebp - 0x38], 0xffffffff
mov eax, dword [sym.__ZN3std3sys7windows1c18NtCreateKeyedEvent4load17h93ec9fa010bcfd0dE_16]
push 0
push 0
push 0xc0000000
lea ecx, [ebp - 0x38]
push ecx
call eax
test eax, eax
jne 0x4f1b66
mov ecx, dword [ebp - 0x38]
mov eax, 0xffffffff
lock cmpxchg dword [0x54a27c], ecx
je 0x4f1a0e
mov esi, eax
push ecx
call sub.KERNEL32.dll_CloseHandle
mov ecx, esi
mov eax, dword [sym.__ZN3std3sys7windows1c19NtWaitForKeyedEvent4load17h4cd9b00e60425e24E_16]
push 0
push 0
push ebx
push ecx
call eax
xor eax, eax
xchg byte [ebx], al
lock dec dword [edi]
je 0x4f19bb
nop word cs:[eax + eax]
nop
movzx eax, byte [ebp - 0x2c]
test al, al
je 0x4f1950
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x4f1a50
lock dec dword [eax]
jne 0x4f1a50
mov ecx, dword [ebp - 0x34]
call dbg.drop_slow<std::thread::Inner, alloc::alloc::Global>
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov ebx, eax
test eax, eax
jne 0x4f1714
jmp 0x4f16fa
mov eax, dword [ebp + 0xc]
cmp ebx, 1
mov dword [ebp - 0x28], 3
sete byte [ebp - 0x24]
mov eax, dword [eax + 0x10]
lea ecx, [ebp - 0x28]
push ecx
push dword [ebp + 8]
call eax
add esp, 8
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x10]
call dbg.drop
add esp, 0x40
pop esi
pop edi
pop ebx
pop ebp
ret
call dbg.exhausted
jmp 0x4f1c39
ud2
mov edx, 0x5e
mov ecx, 0x5a0480
push 0x5a04e0
call dbg.expect_failed
add esp, 4
jmp 0x4f1c39
mov ecx, 8
mov edx, 0x20
call dbg.handle_alloc_error
ud2
mov ecx, 4
mov edx, 0xc
call dbg.handle_alloc_error
ud2
mov dword [ebp - 0x28], str.reentrant_init
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], str.called__Option::unwrap____on_a__None__value_rustc_82e1608dfa6e0b5569232559e3d385fea5a93112library_std_src_threadmod.rs
mov dword [ebp - 0x1c], 0
lea ecx, [ebp - 0x28]
mov edx, 0x59fcb4
call dbg.panic_fmt
jmp 0x4f1c39
mov dword [ebp - 0x28], str.reentrant_init
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], str.called__Option::unwrap____on_a__None__value_rustc_82e1608dfa6e0b5569232559e3d385fea5a93112library_std_src_threadmod.rs
mov dword [ebp - 0x1c], 0
lea ecx, [ebp - 0x28]
mov edx, 0x59fcb4
call dbg.panic_fmt
jmp 0x4f1c39
mov ecx, 0x5a0480
mov edx, 0x5e
push 0x5a04e0
call dbg.expect_failed
add esp, 4
ud2
lea ebx, [ebp - 0x44]
lea esi, [ebp - 0x4c]
mov dword [ebp - 0x28], 0x5a201c
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x48], sym.core::fmt::num::imp::__LT_impl_u20_core..fmt..Display_u20_for_u20_i32_GT_::fmt::h05fb97e4e6b3c14f
mov dword [ebp - 0x1c], 1
lea ecx, [ebp - 0x28]
mov edx, 0x5a2054
call dbg.panic_fmt
jmp 0x4f1c39
mov ecx, str.assertion_failed:_state_and_queue.addr____STATE_MASK__RUNNINGlibrary_std_src_sys_commononcequeue.rs
mov edx, 0x40
push dword [ebp + 0x10]
call dbg.panic
add esp, 4
ud2
mov dword [ebp - 0x28], 0x5a233c
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], str.called__Option::unwrap____on_a__None__value_rustc_82e1608dfa6e0b5569232559e3d385fea5a93112library_std_src_threadmod.rs
mov dword [ebp - 0x1c], 0
mov edx, dword [ebp + 0x10]
lea ecx, [ebp - 0x28]
call dbg.panic_fmt
ud2
ud2