//
// BoomScrollLayer::getPage from 0x10038f450 to 0x10038f4c1 (113 bytes)
//
// 4 xrefs:
// > LevelSelectLayer::onInfo @ 0x1004202b1
// > LevelSelectLayer::onDeathTracker @ 0x1004202d3
// > LevelSelectLayer::keyDown @ 0x100422242
// > LevelSelectLayer::onPlay @ 0x10042235b
//
// This function is hookable on this platform (idp: pc, 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 12:29:13 +0000
//
__int64 __fastcall BoomScrollLayer::getPage(__int64 a1, int a2)
{
__int64 v3; // rdi
int v4; // ecx
unsigned __int64 v5; // rsi
v3 = *(_QWORD *)(a1 + 480);
if ( *(_BYTE *)(a1 + 456) != 1 )
return sub_1007FEFE0(v3, (unsigned int)a2);
v4 = sub_1007FEF90(v3);
if ( a2 <= 0 )
v5 = a2 + v4 * ((a2 != 0) + ((unsigned __int64)-__SPAIR64__(a2, a2) >> 32) / ((unsigned int)(v4 == 0) + v4));
else
v5 = (unsigned int)(a2 % v4);
return sub_1007FEFE0(*(_QWORD *)(a1 + 480), v5);
}