//
// BoomScrollLayer::pageNumberForPosition from 0x1003a61a0 to 0x1003a6270 (208 bytes)
//
// 0 xrefs:
//
// 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 __fastcall BoomScrollLayer::pageNumberForPosition(BoomScrollLayer *a1, cocos2d::CCPoint a2)
{
__m128 v2; // xmm1
__m128 v3; // xmm0
int v4; // r14d
v2 = _mm_xor_ps(
(__m128)*(unsigned int *)((__int64 (__fastcall *)(ExtendedLayer *, double))a1->m_extendedLayer->getPosition)(
a1->m_extendedLayer,
*(double *)&a2),
(__m128)xmmword_1008150B0);
v2.f32[0] = v2.f32[0]
/ (float)(*(float *)((__int64 (__fastcall *)(BoomScrollLayer *))a1->getContentSize)(a1) - a1->m_pageOffset);
v3 = _mm_round_ss((__m128)0LL, v2, 10);
v4 = ((float)(_mm_cvtepi32_ps(_mm_cvttps_epi32(v3)).f32[0] - v2.f32[0]) < 0.5) + (int)v3.f32[0] - 1;
if ( !a1->m_looped )
{
if ( v4 <= 0 )
v4 = 0;
if ( (int)(sub_100720070(*((_QWORD *)&a1->m_dynamicObjects + 4 * !a1->m_dynamic)) - 1) <= v4 )
return sub_100720070(*((_QWORD *)&a1->m_dynamicObjects + 4 * !a1->m_dynamic)) - 1;
}
return v4;
}