//
// cocos2d::CCBMFontConfiguration::purgeFontDefDictionary from 0x1006a76a0 to 0x1006a77fd (349 bytes)
//
// 1 xrefs:
// > cocos2d::CCBMFontConfiguration::dCCBMFontConfiguration @ 0x1006a7624
//
// 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:20 +0000
//
void __fastcall cocos2d::CCBMFontConfiguration::purgeFontDefDictionary(__int64 a1)
{
__int64 v2; // rdi
_QWORD *v3; // rbx
__int64 v4; // rax
__int64 v5; // r14
__int64 v6; // rcx
__int64 v7; // rdx
__int64 v8; // rsi
__int64 v9; // rdx
_QWORD *v10; // rsi
__int64 *v11; // rcx
__int64 v12; // rdx
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rdx
v2 = *(_QWORD *)(a1 + 56);
if ( v2 )
{
v3 = (_QWORD *)(a1 + 56);
while ( 1 )
{
v4 = *(_QWORD *)(v2 + 40);
v5 = *(_QWORD *)(v2 + 48);
if ( v4 )
{
v6 = *v3;
}
else
{
v6 = *v3;
if ( !v5 )
{
free(**(void ***)(v6 + 32));
free(*(void **)(*v3 + 32LL));
*v3 = 0;
free((void *)v2);
return;
}
}
v7 = *(_QWORD *)(v6 + 32);
v8 = *(_QWORD *)(v7 + 32);
if ( v2 == *(_QWORD *)(v7 + 24) - v8 )
*(_QWORD *)(v7 + 24) = v8 + v4;
v9 = *(_QWORD *)(v2 + 48);
v10 = (_QWORD *)(v8 + v4 + 16);
if ( !v4 )
{
v10 = v3;
v6 = *(_QWORD *)(v2 + 48);
}
*v10 = v9;
v11 = *(__int64 **)(v6 + 32);
if ( v9 )
*(_QWORD *)(v11[4] + v9 + 8) = v4;
v12 = *v11;
v13 = 16LL * (*(_DWORD *)(v2 + 84) & (unsigned int)(*((_DWORD *)v11 + 2) - 1));
--*(_DWORD *)(v12 + v13 + 8);
if ( *(_QWORD *)(v12 + v13) == v2 + 32 )
break;
v14 = *(_QWORD *)(v2 + 56);
v15 = *(_QWORD *)(v2 + 64);
if ( v14 )
goto LABEL_15;
LABEL_16:
if ( v15 )
*(_QWORD *)(v15 + 24) = v14;
--*((_DWORD *)v11 + 4);
free((void *)v2);
v2 = v5;
if ( !v5 )
return;
}
*(_QWORD *)(v13 + v12) = *(_QWORD *)(v2 + 64);
v14 = *(_QWORD *)(v2 + 56);
v15 = *(_QWORD *)(v2 + 64);
if ( !v14 )
goto LABEL_16;
LABEL_15:
*(_QWORD *)(v14 + 32) = v15;
goto LABEL_16;
}
}