Function at 0x54f900
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, 0x1c
mov dword [ebp - 0x18], edx
mov esi, ecx
mov eax, dword [0x55e0e4]
cmp eax, 2
jne 0x54fa2e
lea eax, [0x55e0ec]
push eax
call sub.kernel32.dll_AcquireSRWLockExclusive
mov eax, dword [0x5da168]
test eax, 0x7fffffff
jne 0x54fa38
xor ecx, ecx
movzx eax, byte [0x55e0f0]
test al, al
jne 0x54fa51
mov edi, dword [0x55e0fc]
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x28], ecx
test edi, edi
je 0x54f99c
mov esi, edi
dec esi
mov dword [0x55e0fc], esi
mov edx, dword [0x55e0f4]
mov ebx, dword [edx + edi*4 - 4]
je 0x54fa81
mov dword [ebp - 0x10], ebx
mov eax, dword [edx]
xor ebx, ebx
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x14], eax
mov dword [edx], ecx
mov ecx, esi
sub ecx, 2
cmovb ecx, ebx
cmp edi, 4
jae 0x54f9b5
cmp esi, 2
jne 0x54f9f3
xor ebx, ebx
mov esi, 1
jmp 0x54f9e3
mov ebx, dword [0x55e100]
mov eax, ebx
inc eax
je 0x54fc58
mov dword [0x55e100], eax
jmp 0x54fa81
mov esi, 1
nop word [eax + eax]
mov eax, ebx
mov ebx, dword [edx + esi*4]
cmp ebx, dword [edx + esi*4 + 4]
mov ebx, esi
sbb ebx, 0xffffffff
mov esi, dword [edx + ebx*4]
mov dword [edx + eax*4], esi
lea esi, [ebx + ebx + 1]
cmp esi, ecx
jbe 0x54f9c0
add edi, 0xfffffffe
cmp esi, edi
jne 0x54f9fb
mov eax, dword [edx + esi*4]
mov dword [edx + ebx*4], eax
mov eax, dword [ebp - 0x10]
mov ebx, esi
mov dword [edx + esi*4], eax
jmp 0x54fa10
mov ebx, dword [ebp - 0x14]
jmp 0x54fa81
mov eax, dword [ebp - 0x10]
test ebx, ebx
mov dword [edx + ebx*4], eax
je 0x54fa79
nop word cs:[eax + eax]
nop
lea esi, [ebx - 1]
mov ecx, esi
shr ecx, 1
mov edi, dword [edx + ecx*4]
cmp edi, eax
jbe 0x54fa2a
mov dword [edx + ebx*4], edi
cmp esi, 2
mov ebx, ecx
jae 0x54fa10
jmp 0x54fa7b
mov ecx, ebx
jmp 0x54fa7b
call sym.once_cell::imp::OnceCell_LT_T_GT_::initialize::h8aa448749b1b5041
jmp 0x54f91c
call dbg.is_zero_slow_path
mov ecx, eax
xor cl, 1
movzx eax, byte [0x55e0f0]
test al, al
je 0x54f949
lea eax, [0x55e0ec]
mov edx, 0x2b
mov dword [ebp - 0x20], eax
mov byte [ebp - 0x1c], cl
lea eax, [ebp - 0x20]
mov ecx, str.called__Result::unwrap____on_an__Err__value
push 0x5bfdc0
push 0x5bfd14
jmp 0x54fb4c
xor ecx, ecx
mov ebx, dword [ebp - 0x14]
mov dword [edx + ecx*4], eax
mov ecx, 0x20
test ebx, ebx
mov eax, 0x20
je 0x54fa95
bsr eax, ebx
xor eax, 0x1f
sub ecx, eax
xor eax, eax
mov esi, 1
mov edi, ebx
mov dword [ebp - 0x10], ecx
sub ecx, 1
cmovb ecx, eax
btc edi, ecx
shl esi, cl
test ebx, ebx
cmove edi, ebx
cmp byte [ebp - 0x28], 0
jne 0x54fac9
mov eax, dword [0x5da168]
test eax, 0x7fffffff
jne 0x54fc22
lea eax, [0x55e0ec]
push eax
call sub.kernel32.dll_ReleaseSRWLockExclusive
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
mov dword [eax], 1
mov dword [eax + 4], ebx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], esi
mov dword [eax + 0x10], edi
mov eax, dword [0x55e118]
mov dword [ebp - 0x18], esi
mov esi, edi
mov dword [ebp - 0x14], ebx
test eax, eax
je 0x54fb57
dec eax
push eax
call sub.kernel32.dll_TlsGetValue
cmp eax, 1
jbe 0x54fb16
cmp dword [eax + 4], 0
mov edi, eax
jne 0x54fbfe
mov eax, dword [0x55e118]
test eax, eax
je 0x54fb6e
dec eax
push eax
call sub.kernel32.dll_TlsGetValue
test eax, eax
je 0x54fb82
mov edi, eax
cmp eax, 1
jne 0x54fbd6
lea eax, [ebp - 0x20]
mov ecx, 0x5bfdd0
mov edx, 0x46
push 0x5bfe68
push 0x5bfcd8
push eax
call dbg.unwrap_failed
add esp, 0xc
ud2
mov ecx, 0x55e118
call sym.std::sys::windows::thread_local_key::StaticKey::init::he0afa17cd17428ff
push eax
call sub.kernel32.dll_TlsGetValue
cmp eax, 1
ja 0x54fb0a
jmp 0x54fb16
mov ecx, 0x55e118
call sym.std::sys::windows::thread_local_key::StaticKey::init::he0afa17cd17428ff
push eax
call sub.kernel32.dll_TlsGetValue
test eax, eax
jne 0x54fb2a
movzx eax, byte [0x5da16c]
mov eax, dword [0x5da100]
test eax, eax
jne 0x54fba4
call sub.kernel32.dll_GetProcessHeap
test eax, eax
je 0x54fc47
mov dword [0x5da100], eax
push 0xc
push 0
push eax
call sub.kernel32.dll_HeapAlloc
test eax, eax
je 0x54fc47
mov dword [eax], 0x55e118
mov dword [eax + 4], 0
mov edi, eax
mov eax, dword [0x55e118]
test eax, eax
je 0x54fc3b
dec eax
push edi
push eax
call sub.kernel32.dll_TlsSetValue
movq xmm0, qword [edi + 4]
movd eax, xmm0
movq qword [ebp - 0x20], xmm0
mov dword [edi + 4], 1
mov dword [edi + 8], 0
test eax, eax
je 0x54fbfe
lea ecx, [ebp - 0x1c]
call sym.__LT_thread_local..thread_id..ThreadGuard_u20_as_u20_core..ops..drop..Drop_GT_::drop::hd2bb761eb4aa4cb0
mov eax, dword [ebp - 0x14]
add edi, 8
mov ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x18]
mov dword [edi], eax
mov edi, dword [ebp - 0x10]
mov dword [ecx], eax
mov dword [ecx + 4], edi
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], esi
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
call dbg.is_zero_slow_path
test al, al
jne 0x54fac9
mov byte [0x55e0f0], 1
jmp 0x54fac9
mov ecx, 0x55e118
call sym.std::sys::windows::thread_local_key::StaticKey::init::he0afa17cd17428ff
jmp 0x54fbcf
mov ecx, 4
mov edx, 0xc
call dbg.handle_alloc_error
ud2
mov ecx, str.Ran_out_of_thread_IDsC:UsersTEST.cargo_registry_srcindex.crates.io_6f17d22bba15001f_thread_local_1.1.7_src_thread_id.rs
mov edx, 0x15
push 0x5bfda0
call dbg.expect_failed
add esp, 4
ud2