//
// BoomScrollLayer::getRelativePageForNum from 0x1001558b0 to 0x100155918 (104 bytes)
//
// 7 xrefs:
// > BoomScrollLayer::repositionPagesLooped @ 0x100154f3c
// > BoomScrollLayer::repositionPagesLooped @ 0x100154f50
// > BoomScrollLayer::repositionPagesLooped @ 0x100154f64
// > BoomScrollLayer::updateDots @ 0x10015551c
// > EditButtonBar::onDotClicked @ 0x1004a3808
// > EditButtonBar::updateDotState @ 0x1004a389c
// > EditButtonBar::getPage @ 0x1004a39d8
//
// 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::getRelativePageForNum(__int64 a1, int a2)
{
__int64 v3; // x8
unsigned int v4; // w0
int v5; // w9
unsigned int v6; // w9
unsigned int v7; // w10
int v8; // w9
unsigned int v9; // w9
v3 = 480;
if ( *(_BYTE *)(a1 + 456) )
v3 = 448;
v4 = sub_1002E757C(*(_QWORD *)(a1 + v3));
if ( a2 )
v5 = -1;
else
v5 = 0;
v6 = v5 - a2;
if ( v4 <= 1 )
v7 = 1;
else
v7 = v4;
v8 = v6 / v7;
if ( a2 )
++v8;
v9 = a2 + v4 * v8;
if ( a2 <= 0 )
return v9;
else
return (unsigned int)(a2 % (int)v4);
}