//
// TabbedPopupLayer::onTabPage from 0xc37c88 to 0xc37d68 (224 bytes)
//
// 4 xrefs:
// > ??> @ 0x86788
// > TabbedPopupLayer::createTabButtons @ 0xc38480
// > TabbedPopupLayer::createTabButtons @ 0xc38520
// > ??> @ 0x1543868
//
// 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:04:52 +0000
//
__int64 __fastcall TabbedPopupLayer::onTabPage(__int64 this, cocos2d::CCObject *a2)
{
signed int v2; // w2
__int64 v3; // x4
__int64 v4; // x20
unsigned int *v5; // x19
int v6; // w0
v2 = *(_DWORD *)(this + 1064);
if ( (v2 & 0x80000000) == 0 )
{
v3 = *(_QWORD *)(this + 1016);
if ( v2 < (int)(954437177 * ((*(_QWORD *)(this + 1024) - v3) >> 3)) )
{
v4 = v3 + 72LL * v2;
if ( *(int *)(v4 + 56) > 1 )
{
v5 = (unsigned int *)this;
v6 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2) + *(_DWORD *)(v4 + 52);
*(_DWORD *)(v4 + 52) = v6;
if ( v6 < 0 )
{
*(_DWORD *)(v4 + 52) = *(_DWORD *)(v4 + 56) - 1;
return (*(__int64 (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)v5 + 1504LL))(v5, v5[266]);
}
else
{
if ( v6 >= *(_DWORD *)(v4 + 56) )
*(_DWORD *)(v4 + 52) = 0;
return (*(__int64 (__fastcall **)(unsigned int *, _QWORD))(*(_QWORD *)v5 + 1504LL))(v5, v5[266]);
}
}
}
}
return this;
}