//
// BoomScrollLayer::pageNumberForPosition from 0x10012bd70 to 0x10012be48 (216 bytes)
//
// 4 xrefs:
// > BoomScrollLayer::updateDots @ 0x10012bac0
// > BoomScrollLayer::moveToPageEnded @ 0x10012bfe4
// > BoomScrollLayer::ccTouchMoved @ 0x10012c718
// > BoomScrollLayer::ccTouchEnded @ 0x10012c914
//
// 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
//
// local variable allocation has failed, the output may be wrong!
int __fastcall BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)
{
float v3; // s8
float v4; // s0
int v5; // w20
__int64 v6; // x8
__int64 v7; // x8
v3 = -*(float *)((__int64 (__fastcall *)(ExtendedLayer *, __n128, __n128))a1->m_extendedLayer->getPosition)(
a1->m_extendedLayer,
*(__n128 *)&a2.x,
*(__n128 *)&a2.y);
v4 = v3 / (float)(*(float *)((__int64 (__fastcall *)(BoomScrollLayer *))a1->getContentSize)(a1) - a1->m_pageOffset);
v5 = vcvtps_s32_f32(v4) - ((float)((float)(int)ceilf(v4) - v4) >= 0.5);
if ( !a1->m_looped )
{
v5 &= ~(v5 >> 31);
v6 = 472;
if ( a1->m_dynamic )
v6 = 440;
if ( (int)(sub_10024A36C(*(BoomScrollLayer_vtbl **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v6))
- 1) <= v5 )
{
v7 = 472;
if ( a1->m_dynamic )
v7 = 440;
return sub_10024A36C(*(BoomScrollLayer_vtbl **)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v7))
- 1;
}
}
return v5;
}