//
// cocos2d::CCBMFontConfiguration::purgeFontDefDictionary from 0x100396344 to 0x10039646c (296 bytes)
//
// 1 xrefs:
// > cocos2d::CCBMFontConfiguration::dCCBMFontConfiguration @ 0x1003962d8
//
// This function is hookable on this platform (idp: arm, 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 11:03:40 +0000
//
void __fastcall cocos2d::CCBMFontConfiguration::purgeFontDefDictionary(__int64 a1)
{
_QWORD *v1; // x19
__int64 v2; // x20
__int64 v3; // x9
__int64 v4; // x21
__int64 v5; // x8
__int64 v6; // x10
__int64 v7; // x11
__int64 v8; // x10
_QWORD *v9; // x11
__int64 v10; // x8
__int64 v11; // x9
__int64 v12; // x9
__int64 v13; // x10
v1 = (_QWORD *)(a1 + 56);
v2 = *(_QWORD *)(a1 + 56);
if ( v2 )
{
while ( 1 )
{
v3 = *(_QWORD *)(v2 + 40);
v4 = *(_QWORD *)(v2 + 48);
if ( v3 )
break;
v5 = *v1;
if ( v4 )
goto LABEL_5;
free(**(void ***)(v5 + 32));
free(*(void **)(*v1 + 32LL));
*v1 = 0;
LABEL_18:
free((void *)v2);
v2 = v4;
if ( !v4 )
return;
}
v5 = *v1;
LABEL_5:
v6 = *(_QWORD *)(v5 + 32);
v7 = *(_QWORD *)(v6 + 32);
if ( v2 == *(_QWORD *)(v6 + 24) - v7 )
*(_QWORD *)(v6 + 24) = v7 + v3;
v8 = *(_QWORD *)(v2 + 48);
v9 = (_QWORD *)(v7 + v3 + 16);
if ( !v3 )
{
v9 = v1;
v5 = *(_QWORD *)(v2 + 48);
}
*v9 = v8;
v10 = *(_QWORD *)(v5 + 32);
if ( v8 )
*(_QWORD *)(*(_QWORD *)(v10 + 32) + v8 + 8) = v3;
v11 = *(_QWORD *)v10 + 16LL * ((unsigned int)(*(_DWORD *)(v10 + 8) - 1) & *(_DWORD *)(v2 + 84));
--*(_DWORD *)(v11 + 8);
if ( *(_QWORD *)v11 == v2 + 32 )
*(_QWORD *)v11 = *(_QWORD *)(v2 + 64);
v12 = *(_QWORD *)(v2 + 56);
v13 = *(_QWORD *)(v2 + 64);
if ( v12 )
*(_QWORD *)(v12 + 32) = v13;
if ( v13 )
*(_QWORD *)(v13 + 24) = v12;
--*(_DWORD *)(v10 + 16);
goto LABEL_18;
}
}