//
// __vcrt_getptd_noexit from 0x180124e48 to 0x180124f07 (191 bytes)
//
// 3 xrefs:
// > Concurrency::details::ScheduleGroupSegmentBase::HasUnrealizedChores @ 0x180124b60
// > __vcrt_getptd @ 0x180124e30
// > ??> @ 0x180202750
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 _vcrt_getptd_noexit()
{
DWORD LastError; // edi
__int64 Value; // rax
__int64 v3; // rsi
_DWORD *v4; // rax
DWORD v5; // ecx
_DWORD *v6; // rbx
_DWORD *v7; // rax
if ( dwTlsIndex == -1 )
return 0;
LastError = GetLastError();
Value = _vcrt_FlsGetValue(dwTlsIndex);
v3 = 0;
if ( Value != -1 )
{
if ( Value )
{
v3 = Value;
goto LABEL_13;
}
if ( !(unsigned int)_vcrt_FlsSetValue(dwTlsIndex, (LPVOID)0xFFFFFFFFFFFFFFFFLL) )
goto LABEL_13;
v4 = j__calloc_base(1u, 0x80u);
v5 = dwTlsIndex;
v6 = v4;
if ( v4 )
{
if ( (unsigned int)_vcrt_FlsSetValue(dwTlsIndex, v4) )
{
v7 = v6;
v6[30] = -2;
v6 = nullptr;
v3 = (__int64)v7;
LABEL_12:
free(v6);
goto LABEL_13;
}
v5 = dwTlsIndex;
}
_vcrt_FlsSetValue(v5, nullptr);
goto LABEL_12;
}
LABEL_13:
SetLastError(LastError);
return v3;
}