//
// sub_D678D8 from 0xd678d8 to 0xd679c8 (240 bytes)
//
// 2 xrefs:
// > sub_D678D8 @ 0xd679ac
// > cocos2d::CCClippingNode::visit @ 0xd680a0
//
// 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 13:07:54 +0000
//
__int64 __fastcall sub_D678D8(__int64 *a1, __int64 a2)
{
__int64 result; // x0
__int64 *v5; // x19
__int64 v6; // x2
__int64 v7; // x1
__int64 *v8; // x0
__int64 v9; // x20
unsigned __int64 i; // x20
(*(void (__fastcall **)(__int64 *))(*a1 + 664))(a1);
result = (*(__int64 (__fastcall **)(__int64 *))(*a1 + 488))(a1);
if ( result )
{
result = (*(__int64 (__fastcall **)(__int64 *))(*a1 + 488))(a1);
if ( result )
{
result = **(unsigned int **)((*(__int64 (__fastcall **)(__int64 *))(*a1 + 488))(a1) + 56);
if ( (_DWORD)result )
{
v5 = *(__int64 **)(*(_QWORD *)((*(__int64 (__fastcall **)(__int64 *))(*a1 + 488))(a1) + 56) + 16LL);
v6 = *(_QWORD *)((*(__int64 (__fastcall **)(__int64 *))(*a1 + 488))(a1) + 56);
v7 = *a1;
v8 = a1;
v9 = *(_QWORD *)(v6 + 16);
result = **(unsigned int **)((*(__int64 (__fastcall **)(__int64 *))(v7 + 488))(v8) + 56);
for ( i = v9 + 8LL * (unsigned int)result - 8; i >= (unsigned __int64)v5; result = sub_D678D8(result, a2) )
{
result = *v5;
if ( !*v5 )
break;
++v5;
}
}
}
}
return result;
}