//
// ListButtonBar::init from 0x6c8ff0 to 0x6c9420 (1072 bytes)
//
// 2 xrefs:
// > ListButtonBar::create @ 0x6c94e8
// > ??> @ 0xd1290
//
// 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 12:51:22 +0000
//
__int64 __fastcall ListButtonBar::init(
_QWORD *a1,
cocos2d::CCArray *a2,
const cocos2d::CCPoint *a3,
int a4,
int a5,
unsigned int a6,
float a7,
float a8,
float a9,
float a10)
{
unsigned int v18; // w19
unsigned int v19; // w26
cocos2d::CCDirector *v20; // x0
cocos2d::CCArray *WinSize; // x0
cocos2d::CCObject *v22; // x0
cocos2d::CCArray *v23; // x0
cocos2d::CCArray *v24; // x20
cocos2d::CCObject *v25; // x0
cocos2d::CCObject *v26; // x21
cocos2d::CCArray *v27; // x22
_BOOL4 v28; // w23
cocos2d::CCArray *v29; // x0
unsigned int v30; // w19
unsigned int v31; // w1
cocos2d::CCArray *v32; // x22
cocos2d::CCObject *v33; // x0
cocos2d::CCArray *v34; // x19
unsigned __int8 v35; // w2
__int64 v36; // x0
cocos2d::CCDirector *v37; // x0
cocos2d::CCArray **v38; // x19
float v39; // s8
cocos2d::CCDirector *v40; // x0
float v41; // s0
cocos2d::CCMenu *v42; // x0
cocos2d::CCArray *v44; // x0
cocos2d::CCObject *v45; // x22
cocos2d::CCNode *v46; // x19
cocos2d::CCString *v47; // x0
cocos2d::CCSprite *CString; // x24
const char *v49; // x1
__int64 v50; // x20
__int64 v51; // x23
void (__fastcall *v52)(__int64, __int64 *); // x26
const char *v53; // x1
cocos2d::CCSprite *v54; // x23
__int64 v55; // x23
void (__fastcall *v56)(__int64, __int64 *); // x24
__int64 v59; // [xsp+98h] [xbp+98h] BYREF
_BYTE v60[8]; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v61; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v62; // [xsp+B0h] [xbp+B0h] BYREF
v18 = 0;
v19 = 0;
v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
WinSize = (cocos2d::CCArray *)cocos2d::CCDirector::getWinSize(&v59, v20);
v22 = (cocos2d::CCObject *)cocos2d::CCArray::create(WinSize);
a1[41] = v22;
v23 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v22);
v24 = (cocos2d::CCArray *)cocos2d::CCArray::create(v23);
v25 = (cocos2d::CCObject *)cocos2d::CCArray::create(v24);
cocos2d::CCArray::addObject(v24, v25);
if ( (unsigned int)cocos2d::CCArray::count(a2) )
{
do
{
v26 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(a2, v18);
v27 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v24, v19);
v28 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v26 + 64LL))(v26) == -1;
v29 = (cocos2d::CCArray *)cocos2d::CCArray::count(v27);
if ( (unsigned int)v29 >= a4 * a5 || v28 )
{
v44 = (cocos2d::CCArray *)cocos2d::CCArray::create(v29);
v45 = v44;
if ( !v28 )
cocos2d::CCArray::addObject(v44, v26);
++v19;
++v18;
cocos2d::CCArray::addObject(v24, v45);
}
else
{
++v18;
cocos2d::CCArray::addObject(v27, v26);
}
}
while ( v18 < (unsigned int)cocos2d::CCArray::count(a2) );
}
v30 = 0;
while ( v30 < (unsigned int)cocos2d::CCArray::count(v24) )
{
v31 = v30++;
v32 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v24, v31);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v62, a3);
v33 = ListButtonPage::create(v32, (const cocos2d::CCPoint *)&v62, a4, a5, a7, a8, a9);
cocos2d::CCArray::addObject((cocos2d::CCArray *)a1[41], v33);
}
v34 = (cocos2d::CCArray *)a1[41];
v35 = (unsigned int)cocos2d::CCArray::count(v34) > 1;
v36 = BoomScrollLayer::create(v34, nullptr, v35);
a1[40] = v36;
v37 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(_QWORD *, __int64))(*a1 + 456LL))(a1, v36);
v38 = (cocos2d::CCArray **)a1[40];
v39 = *(float *)&v59 * 0.5;
v40 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v37);
cocos2d::CCDirector::getScreenBottom(v40);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v62, v39, v41 + 6.0);
BoomScrollLayer::setPagesIndicatorPosition(v38, (__int64)&v62);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)a1[40] + 1000LL))(a1[40], 0);
v42 = (cocos2d::CCMenu *)cocos2d::CCArray::count((cocos2d::CCArray *)a1[41]);
if ( (unsigned int)v42 > 1 )
{
v46 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v42);
(*(void (__fastcall **)(_QWORD *, cocos2d::CCNode *))(*a1 + 456LL))(a1, v46);
v47 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"GJ_arrow_%02d_001.png",
(const char *)a6);
CString = (cocos2d::CCSprite *)cocos2d::CCString::getCString(v47);
v50 = cocos2d::CCSprite::createWithSpriteFrameName(CString, v49);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v50 + 160LL))(v50, 0.8);
v51 = CCMenuItemSpriteExtra::create(v50, 0, (__int64)a1, (__int64)ListButtonBar::onLeft, 0);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)v46 + 456LL))(v46, v51);
CCMenuItemSpriteExtra::setSizeMult(v51, 2.2);
v52 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v51 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v60, -a10, 0.0);
cocos2d::CCPoint::operator+(&v61, a3);
cocos2d::CCNode::convertToNodeSpace(&v62, v46, (const cocos2d::CCPoint *)&v61);
v52(v51, &v62);
v54 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(CString, v53);
(*(void (__fastcall **)(cocos2d::CCSprite *, float))(*(_QWORD *)v54 + 160LL))(v54, 0.8);
cocos2d::CCSprite::setFlipX(v54, 1);
v55 = CCMenuItemSpriteExtra::create((__int64)v54, 0, (__int64)a1, (__int64)ListButtonBar::onRight, 0);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64))(*(_QWORD *)v46 + 456LL))(v46, v55);
v56 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v55 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v60, a10, 0.0);
cocos2d::CCPoint::operator+(&v61, a3);
cocos2d::CCNode::convertToNodeSpace(&v62, v46, (const cocos2d::CCPoint *)&v61);
v56(v55, &v62);
CCMenuItemSpriteExtra::setSizeMult(v55, 2.2);
}
else
{
*(_BYTE *)(a1[40] + 569LL) = 0;
}
return 1;
}