//
// GJBaseGameLayer::countCollectedUserCoins from 0x99e684 to 0x99e6f8 (116 bytes)
//
// 2 xrefs:
// > PlayLayer::levelComplete @ 0x703df0
// > ??> @ 0x69ca0
//
// 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 12:58:05 +0000
//
__int64 __fastcall GJBaseGameLayer::countCollectedUserCoins(GJBaseGameLayer *this)
{
__int64 v1; // x0
__int64 v2; // x0
__int64 v3; // x19
unsigned int v4; // w20
v1 = *((_QWORD *)this + 1574);
if ( !v1 )
return 0;
v2 = *(_QWORD *)(v1 + 56);
if ( !v2 )
return 0;
v3 = *(_QWORD *)(v2 + 288);
v4 = 0;
while ( 1 )
{
if ( (*(unsigned int (__fastcall **)(_QWORD))(**(_QWORD **)(v2 + 264) + 1800LL))(*(_QWORD *)(v2 + 264)) == 31 )
++v4;
if ( !v3 )
break;
v2 = v3;
v3 = *(_QWORD *)(v3 + 288);
}
return v4;
}