//
// BoomScrollLayer::pageNumberForPosition from 0x3c1582 to 0x3c160a (136 bytes)
//
// 4 xrefs:
// > BoomScrollLayer::updateDots @ 0x3c16b6
// > BoomScrollLayer::moveToPageEnded @ 0x3c17f0
// > BoomScrollLayer::ccTouchEnded @ 0x3c1e4e
// > BoomScrollLayer::ccTouchMoved @ 0x3c21fa
//
// 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:46:31 +0000
//
int __fastcall BoomScrollLayer::pageNumberForPosition(int a1)
{
float v2; // s17
float v3; // s16
int v4; // r4
v2 = *(float *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 384) + 96))(*(_DWORD *)(a1 + 384));
v3 = (float)-v2 / (float)(*(float *)(*(int (__fastcall **)(int))(*(_DWORD *)a1 + 164))(a1) - *(float *)(a1 + 464));
v4 = (int)ceilf(v3);
if ( (float)((float)v4 - v3) >= 0.5 )
--v4;
if ( !*(_BYTE *)(a1 + 336) )
{
v4 &= ~(v4 >> 31);
if ( BoomScrollLayer::getTotalPages((cocos2d::CCArray **)a1) - 1 <= v4 )
return BoomScrollLayer::getTotalPages((cocos2d::CCArray **)a1) - 1;
}
return v4;
}