//
// BoomScrollLayer::setupDynamicScrolling from 0x3c1858 to 0x3c19c2 (362 bytes)
//
// 1 xrefs:
// > BoomScrollLayer::init @ 0x3c2484
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:46:31 +0000
//
unsigned int __fastcall BoomScrollLayer::setupDynamicScrolling(int a1, cocos2d::CCObject *this, int a3, int a4)
{
cocos2d::CCObject *v6; // r0
cocos2d::CCArray *v7; // r0
int Object; // r9
void (__fastcall *v9)(int, cocos2d::CCObject **); // r10
int v10; // r9
void (__fastcall *v11)(int, cocos2d::CCObject **); // r10
int v12; // r9
void (__fastcall *v13)(int, cocos2d::CCObject **); // r10
void (__fastcall ***v14)(_DWORD, int, int, int, int, cocos2d::CCObject *, int, int); // r5
void (__fastcall *v15)(_DWORD, int, int, int, int, cocos2d::CCObject *, int, int); // r9
int v16; // r10
int v17; // r0
int v18; // r3
void (__fastcall ***v19)(_DWORD, int, int); // r5
void (__fastcall *v20)(_DWORD, int, int); // r9
int v21; // r10
int v22; // r0
void (__fastcall ***v23)(_DWORD, int, int); // r5
void (__fastcall *v24)(_DWORD, int, int); // r9
int v25; // r10
int v26; // r0
unsigned int result; // r0
unsigned int v28; // r5
int v29; // r5
cocos2d::CCObject *v31; // [sp+4h] [bp-Ch] BYREF
int v32; // [sp+8h] [bp-8h]
int v33; // [sp+Ch] [bp-4h]
v31 = this;
v32 = a3;
v33 = a4;
*(_DWORD *)(a1 + 340) = a3;
v6 = *(cocos2d::CCObject **)(a1 + 344);
if ( v6 )
cocos2d::CCObject::release(v6);
*(_DWORD *)(a1 + 344) = this;
cocos2d::CCObject::retain(this);
v7 = *(cocos2d::CCArray **)(a1 + 364);
*(_BYTE *)(a1 + 348) = 1;
Object = cocos2d::CCArray::lastObject(v7);
v9 = *(void (__fastcall **)(int, cocos2d::CCObject **))(*(_DWORD *)Object + 92);
BoomScrollLayer::getRelativePosForPage((BoomScrollLayer *)&v31, (float *)a1, -1);
v9(Object, &v31);
v10 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 364), 0);
v11 = *(void (__fastcall **)(int, cocos2d::CCObject **))(*(_DWORD *)v10 + 92);
BoomScrollLayer::getRelativePosForPage((BoomScrollLayer *)&v31, (float *)a1, 0);
v11(v10, &v31);
v12 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 364), 1u);
v13 = *(void (__fastcall **)(int, cocos2d::CCObject **))(*(_DWORD *)v12 + 92);
BoomScrollLayer::getRelativePosForPage((BoomScrollLayer *)&v31, (float *)a1, 1);
v13(v12, &v31);
v14 = *(void (__fastcall ****)(_DWORD, int, int, int, int, cocos2d::CCObject *, int, int))(a1 + 340);
v15 = **v14;
v16 = cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(a1 + 364));
v17 = cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(a1 + 344));
v15(v14, v16, v17, v18, a1, v31, v32, v33);
v19 = *(void (__fastcall ****)(_DWORD, int, int))(a1 + 340);
v20 = **v19;
v21 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 364), 0);
v22 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 344), 0);
v20(v19, v21, v22);
v23 = *(void (__fastcall ****)(_DWORD, int, int))(a1 + 340);
v24 = **v23;
v25 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 364), 1u);
v26 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 344), 1u);
v24(v23, v25, v26);
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 344));
if ( result <= 2 )
{
*(_BYTE *)(a1 + 348) = 0;
*(_BYTE *)(a1 + 336) = 0;
while ( 1 )
{
v28 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 364));
result = cocos2d::CCArray::count(this);
if ( v28 <= result )
break;
v29 = cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(a1 + 364));
cocos2d::CCArray::removeLastObject(*(cocos2d::CCArray **)(a1 + 364), 1);
(*(void (__fastcall **)(int))(*(_DWORD *)v29 + 268))(v29);
}
}
return result;
}