//
// __tlregdtor from 0x18001f7a8 to 0x18001f840 (152 bytes)
//
// 2 xrefs:
// > sub_180001120 @ 0x180001152
// > ??> @ 0x18004b238
//
// 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 __fastcall _tlregdtor(__int64 a1)
{
__int64 v2; // rdi
_QWORD *v3; // rbx
v2 = *((_QWORD *)NtCurrentTeb()->ThreadLocalStoragePointer + (unsigned int)TlsIndex);
v3 = *(_QWORD **)(v2 + 32);
if ( !v3 )
{
v3 = (_QWORD *)(v2 + 48);
LABEL_7:
*(_DWORD *)v3 = 0;
*(_QWORD *)(v2 + 32) = v3;
goto LABEL_8;
}
if ( *(_DWORD *)v3 == 30 )
{
v3 = malloc(0x100u);
free(nullptr);
if ( !v3 )
return 0xFFFFFFFFLL;
v3[1] = *(_QWORD *)(v2 + 32);
goto LABEL_7;
}
LABEL_8:
v3[(*(_DWORD *)v3)++ + 2] = a1;
return 0;
}