//
// BoomScrollLayer::pageNumberForPosition from 0x1001557d8 to 0x1001558b0 (216 bytes)
//
// 4 xrefs:
// > BoomScrollLayer::updateDots @ 0x100155500
// > BoomScrollLayer::moveToPageEnded @ 0x100155ab8
// > BoomScrollLayer::ccTouchMoved @ 0x1001561e8
// > BoomScrollLayer::ccTouchEnded @ 0x1001563e0
//
// 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 10:59:41 +0000
//
__int64 __fastcall BoomScrollLayer::pageNumberForPosition(__int64 a1)
{
float v2; // s8
float v3; // s0
__int64 v4; // x20
__int64 v5; // x8
__int64 v6; // x8
v2 = -*(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 504) + 192LL))(*(_QWORD *)(a1 + 504));
v3 = v2 / (float)(*(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1) - *(float *)(a1 + 592));
v4 = vcvtps_s32_f32(v3) - ((float)((float)(int)ceilf(v3) - v3) >= 0.5);
if ( (*(_BYTE *)(a1 + 436) & 1) == 0 )
{
v4 = (unsigned int)v4 & ~((int)v4 >> 31);
v5 = 480;
if ( *(_BYTE *)(a1 + 456) )
v5 = 448;
if ( (int)(sub_1002E757C(*(_QWORD *)(a1 + v5)) - 1) <= (int)v4 )
{
v6 = 480;
if ( *(_BYTE *)(a1 + 456) )
v6 = 448;
return (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + v6)) - 1;
}
}
return v4;
}