//
// BoomScrollLayer::getPage from 0x100155690 to 0x100155700 (112 bytes)
//
// 12 xrefs:
// > BoomScrollLayer::repositionPagesLooped @ 0x100154f88
// > BoomScrollLayer::repositionPagesLooped @ 0x100154fec
// > BoomScrollLayer::repositionPagesLooped @ 0x100155048
// > BoomScrollLayer::repositionPagesLooped @ 0x1001550ec
// > BoomScrollLayer::repositionPagesLooped @ 0x100155100
// > BoomScrollLayer::repositionPagesLooped @ 0x100155114
// > BoomScrollLayer::repositionPagesLooped @ 0x100155194
// > BoomScrollLayer::repositionPagesLooped @ 0x1001551a4
// > BoomScrollLayer::repositionPagesLooped @ 0x1001551b4
// > sub_100482C7C @ 0x100482c8c
// > sub_100482C98 @ 0x100482ca8
// > LevelSelectLayer::onPlay @ 0x1004842cc
//
// 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::getPage(__int64 a1, __int64 a2)
{
int v2; // w19
int v4; // w8
__int64 v5; // x0
unsigned int v6; // w0
int v7; // w9
unsigned int v8; // w9
unsigned int v9; // w10
int v10; // w9
unsigned int v11; // w9
v2 = a2;
v4 = *(unsigned __int8 *)(a1 + 456);
v5 = *(_QWORD *)(a1 + 480);
if ( v4 == 1 )
{
v6 = sub_1002E757C(v5);
if ( v2 )
v7 = -1;
else
v7 = 0;
v8 = v7 - v2;
if ( v6 <= 1 )
v9 = 1;
else
v9 = v6;
v10 = v8 / v9;
if ( v2 )
++v10;
v11 = v2 + v6 * v10;
if ( v2 <= 0 )
a2 = v11;
else
a2 = (unsigned int)(v2 % (int)v6);
v5 = *(_QWORD *)(a1 + 480);
}
return sub_1002E75A0(v5, a2);
}