Function at 0x499820
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, 0x28
mov dword [ebp - 0x1c], esp
mov dword [ebp - 0x10], 0xffffffff
mov dword [ebp - 0x14], 0x4c3990
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x18]
mov edx, dword fs:[0]
mov dword [ebp - 0x18], edx
mov dword fs:[0], ecx
mov eax, dword [eax]
cmp byte [eax], 0
mov byte [eax], 0
je 0x499a65
mov byte [ebp - 0x1d], 0
mov eax, dword [0x537f70]
cmp eax, 3
jne 0x499a05
cmp byte [ebp - 0x1d], 0
jne 0x499a17
mov eax, dword [0x537068]
test eax, eax
je 0x499a38
dec eax
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp eax, 2
jb 0x4998a1
cmp byte [eax + 4], 0
mov esi, eax
jne 0x499924
mov eax, dword [0x537068]
test eax, eax
je 0x499a47
dec eax
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x4998de
mov esi, eax
cmp eax, 1
jne 0x49991e
lea eax, [ebp - 0x34]
mov ecx, str.cannot_access_a_Thread_Local_Storage_value_during_or_after_destruction_rustc_07dca489ac2d933c78d3c5158e3f43beefeb02celibrary_std_src_threadlocal.rs
mov edx, 0x46
push 0x528880
push 0x527afc
push eax
call fcn.004e8f30
movzx eax, byte [0x538038]
mov ecx, 8
mov edx, 4
call fcn.004018b0
test eax, eax
je 0x499a8c
mov dword [eax], 0x537068
mov byte [eax + 4], 0
mov esi, eax
mov eax, dword [0x537068]
test eax, eax
je 0x499a56
dec eax
push esi
push eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov word [esi + 4], 1
mov eax, dword [0x537f90]
add esi, 5
cmp eax, esi
jne 0x49994c
mov eax, dword [0x537f94]
inc eax
jne 0x49996c
mov ecx, str.lock_count_overflow_in_reentrant_mutexlibrary_std_src_sync_remutex.rs
mov edx, 0x26
push 0x528be0
call fcn.004e8fb0
lea eax, [0x537f8c]
push eax
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x499a17
mov eax, 1
mov dword [0x537f90], esi
mov dword [0x537f94], eax
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 1
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x2c], 0
mov word [ebp - 0x24], 0
cmp dword [0x537f74], 0
jne 0x499a79
lea ecx, [0x537f78]
mov dword [0x537f74], 0xffffffff
mov dword [ebp - 0x10], 1
call fcn.00499b30
mov eax, dword [ebp - 0x24]
movsd xmm0, qword [ebp - 0x34]
movsd xmm1, qword [ebp - 0x2c]
mov dword [0x537f88], eax
movsd qword [0x537f80], xmm1
movsd qword [0x537f78], xmm0
inc dword [0x537f74]
dec dword [0x537f94]
jne 0x499a17
lea eax, [0x537f8c]
mov dword [0x537f90], 0
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x499a17
lea ecx, [ebp - 0x1d]
call fcn.004ec550
cmp byte [ebp - 0x1d], 0
je 0x49987b
mov eax, dword [0x537fcc]
cmp eax, 3
jne 0x499a27
call dword [0x537fd0]
mov eax, dword [ebp - 0x18]
mov dword fs:[0], eax
add esp, 0x28
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, 0x537068
call fcn.004ec360
jmp 0x499889
mov ecx, 0x537068
call fcn.004ec360
jmp 0x4998af
mov ecx, 0x537068
call fcn.004ec360
jmp 0x499916
mov ecx, str.called__Option::unwrap____on_a__None__value
mov edx, 0x2b
push 0x528b40
call fcn.004e8ca0
mov ecx, 0x528850
mov dword [ebp - 0x10], 2
call fcn.004e8e90
ud2
mov ecx, 4
mov edx, 8
call fcn.004e8800
nop dword [eax + eax]
push ebp
sub esp, 0xc
add ebp, 0xc
dec dword [0x537f94]
jne 0x499ac6
lea eax, [0x537f8c]
mov dword [0x537f90], 0
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
add esp, 0xc
pop ebp
ret