//
// SecretRewardsLayer::scrollLayerMoved from 0x100385338 to 0x1003854f8 (448 bytes)
//
// 2 xrefs:
// > sub_1003854F8 @ 0x1003854fc
// > ??> @ 0x10093dd18
//
// 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 11:03:32 +0000
//
__int64 __fastcall SecretRewardsLayer::scrollLayerMoved(__int64 result, float *a2)
{
__int64 v2; // x29
__int64 v3; // x30
__int64 v4; // d8
__int64 v5; // d9
__int64 v7; // x19
__int64 v8; // x0
int TotalPages; // w0
int v10; // w20
float i; // s8
unsigned __int64 v12; // x1
float v13; // s0
unsigned int v14; // w9
unsigned __int64 v15; // x0
float v16; // s0
float v17; // s0
float v18; // s1
_BOOL4 v19; // w8
_BOOL4 v20; // w9
__int64 v21; // x0
_BOOL8 v22; // x20
__int16 v23; // [xsp+4h] [xbp-4Ch] BYREF
char v24; // [xsp+6h] [xbp-4Ah]
_QWORD v25[9]; // [xsp+8h] [xbp-48h] BYREF
if ( *(_BYTE *)(result + 584) == 1 )
{
v25[1] = v5;
v25[2] = v4;
v25[7] = v2;
v25[8] = v3;
v7 = result;
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8, v25);
TotalPages = BoomScrollLayer::getTotalPages(*(_QWORD *)(v7 + 544));
v10 = TotalPages;
for ( i = (float)-*a2 / *(float *)v25; i < 0.0; i = i + (float)TotalPages )
;
v12 = 4915270;
v13 = (float)(int)floorf(i);
v14 = (int)vcvtms_s32_f32(i) % TotalPages;
v15 = 4915270;
if ( v14 - 1 <= 2 )
v15 = *(_QWORD *)&a222[8 * v14 - 8];
v16 = i - v13;
if ( v14 + 1 == v10 )
v14 = -1;
if ( v14 <= 2 )
v12 = *(_QWORD *)&a222[8 * v14];
v17 = (float)(v16 / 0.66667) + -0.2;
v18 = 1.0;
v19 = v17 >= 1.0;
v20 = v17 > 0.0 || v17 >= 1.0;
if ( v17 <= 0.0 )
v19 = 1;
if ( !v20 )
v18 = 0.0;
if ( v19 )
v17 = v18;
v21 = GameToolbox::multipliedColorValue(v15, v12, v17);
v23 = v21;
v24 = BYTE2(v21);
(*(void (__fastcall **)(_QWORD, __int16 *))(**(_QWORD **)(v7 + 560) + 960LL))(*(_QWORD *)(v7 + 560), &v23);
v22 = *(_BYTE *)(v7 + 584) == 1 && (int)llroundf(i) % v10 == 3;
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v7 + 472) + 344LL))(
*(_QWORD *)(v7 + 472),
(unsigned int)v22 ^ 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v7 + 488) + 344LL))(
*(_QWORD *)(v7 + 488),
(unsigned int)v22 ^ 1);
(*(void (__fastcall **)(_QWORD, _BOOL8))(**(_QWORD **)(v7 + 480) + 344LL))(*(_QWORD *)(v7 + 480), v22);
return (*(__int64 (__fastcall **)(_QWORD, _BOOL8))(**(_QWORD **)(v7 + 496) + 344LL))(*(_QWORD *)(v7 + 496), v22);
}
return result;
}