//
// BoomScrollLayer::pageNumberForPosition from 0x14003dd10 to 0x14003de0a (250 bytes)
//
// 5 xrefs:
// > BoomScrollLayer::updateDots @ 0x14003da3a
// > BoomScrollLayer::moveToPageEnded @ 0x14003dce1
// > BoomScrollLayer::ccTouchMoved @ 0x14003ea4d
// > BoomScrollLayer::ccTouchEnded @ 0x14003ec75
// > ??> @ 0x1406c402c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)
{
float v3; // xmm6_4
float v4; // xmm6_4
int v5; // eax
int v6; // edi
cocos2d::CCArray *v7; // rcx
v3 = *(float *)((__int64 (__fastcall *)(_QWORD, _QWORD))a1->m_extendedLayer->getPosition_0)(a1->m_extendedLayer, a2);
v4 = (float)-v3 / (float)(a1->getContentSize(a1)->width - a1->m_pageOffset);
v5 = (int)ceilf(v4);
v6 = v5 - 1;
if ( (float)((float)v5 - v4) < 0.5 )
v6 = v5;
if ( a1->m_looped )
return v6;
if ( v6 < 0 )
v6 = 0;
v7 = a1->m_dynamic ? a1->m_dynamicObjects : a1->m_pages;
if ( (int)(cocos2d::CCArray::count(v7) - 1) >= v6 )
return v6;
if ( a1->m_dynamic )
return cocos2d::CCArray::count(a1->m_dynamicObjects) - 1;
return cocos2d::CCArray::count(a1->m_pages) - 1;
}