//
// BoomScrollLayer::pageNumberForPosition from 0x56d57c to 0x56d640 (196 bytes)
//
// 5 xrefs:
// > BoomScrollLayer::updateDots @ 0x56d75c
// > BoomScrollLayer::moveToPageEnded @ 0x56d950
// > BoomScrollLayer::ccTouchEnded @ 0x56e260
// > BoomScrollLayer::ccTouchMoved @ 0x56e82c
// > ??> @ 0xb8ea8
//
// 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 BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)
{
float v3; // s8
float v4; // s0
int v5; // w19
v3 = *(float *)((__int64 (__fastcall *)(ExtendedLayer *, long double, long double))a1->m_extendedLayer->getPosition)(
a1->m_extendedLayer,
*(long double *)&a2.x,
*(long double *)&a2.y);
v4 = (float)-v3 / (float)(a1->getContentSize(a1)->width - a1->m_pageOffset);
v5 = vcvtps_s32_f32(v4);
if ( (float)((float)v5 - v4) >= 0.5 )
--v5;
if ( a1->m_looped )
return v5;
if ( v5 < 0 )
v5 = 0;
if ( v5 < BoomScrollLayer::getTotalPages(a1) - 1 )
return v5;
else
return BoomScrollLayer::getTotalPages(a1) - 1;
}