//
// sub_10066D6B0 from 0x10066d6b0 to 0x10066d73e (142 bytes)
//
// 8 xrefs:
// > ??> @ 0x1006662e3
// > ??> @ 0x100666313
// > ??> @ 0x1006d6f3b
// > ??> @ 0x1006d6f55
// > ??> @ 0x1006d7743
// > ??> @ 0x1006d775a
// > ??> @ 0x1006d7e5d
// > ??> @ 0x1006d7e77
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:35:02 +0000
//
void __fastcall sub_10066D6B0(void ***a1)
{
void **v2; // r14
void **v3; // r15
void **v4; // r12
void *v5; // rdi
if ( !*((_BYTE *)a1 + 8) )
{
v2 = *a1;
v3 = (void **)**a1;
if ( v3 )
{
v4 = (void **)v2[1];
v5 = **a1;
if ( v4 == v3 )
{
LABEL_13:
v2[1] = v3;
operator delete(v5);
return;
}
while ( 1 )
{
if ( (*(_BYTE *)(v4 - 3) & 1) != 0 )
{
operator delete(*(v4 - 1));
if ( (*(_BYTE *)(v4 - 6) & 1) != 0 )
LABEL_10:
operator delete(*(v4 - 4));
}
else if ( (*(_BYTE *)(v4 - 6) & 1) != 0 )
{
goto LABEL_10;
}
v4 -= 7;
if ( v4 == v3 )
{
v5 = **a1;
goto LABEL_13;
}
}
}
}
}