//
// TabbedPopupLayer::ensurePopupPage from 0x72e14c to 0x72e1dc (144 bytes)
//
// 1 xrefs:
// > GameSettingsLayer::addToggle @ 0x710ca4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:17 +0000
//
int __fastcall TabbedPopupLayer::ensurePopupPage(TabbedPopupLayer *this, int a2, int a3)
{
int v5; // r2
_DWORD *v7; // r4
_DWORD *v8; // r3
unsigned int v9[2]; // [sp+0h] [bp-8h] BYREF
v9[0] = (unsigned int)this;
v9[1] = a2;
if ( a2 < 0 )
return 0;
v5 = *((_DWORD *)this + 181);
if ( a2 >= -1431655765 * ((*((_DWORD *)this + 182) - v5) >> 2) || a3 < 0 )
return 0;
v7 = (_DWORD *)(v5 + 12 * a2);
while ( a3 >= (v7[1] - *v7) >> 2 )
{
v9[0] = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 164));
SetupTriggerPopup::getPageContainer((cocos2d::CCArray **)this, v9[0]);
v8 = (_DWORD *)v7[1];
if ( v8 == (_DWORD *)v7[2] )
{
std::vector::__push_back_slow_path((int)v7, v9);
}
else
{
if ( v8 )
*v8 = v9[0];
v7[1] += 4;
}
}
return *(_DWORD *)(*v7 + 4 * a3);
}