//
// ListButtonBar::init from 0x140077dd0 to 0x1400782e0 (1296 bytes)
//
// 2 xrefs:
// > ListButtonBar::create @ 0x140077d7e
// > ??> @ 0x140911c6c
//
// 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 11:25:52 +0000
//
// Hidden C++ exception states: #wind=2
char __fastcall ListButtonBar::init(
void *a1,
cocos2d::CCArray *a2,
const struct cocos2d::CCPoint *a3,
int a4,
int a5,
int a6,
int a7,
int a8,
float a9,
int a10)
{
int v10; // ebp
void *v12; // r12
__int64 v13; // rax
__int64 v14; // rcx
cocos2d::CCObject *v15; // rax
__int64 v16; // rcx
cocos2d::CCArray *v17; // rsi
__int64 v18; // rcx
struct cocos2d::CCObject *v19; // rax
unsigned int v20; // r15d
int v21; // r14d
unsigned int v22; // edi
unsigned int v23; // r12d
struct cocos2d::CCObject *v24; // rbx
cocos2d::CCArray *v25; // rbp
int v26; // r14d
__int64 v27; // rcx
struct cocos2d::CCObject *v28; // rdx
cocos2d::CCArray *v29; // rcx
cocos2d::CCArray *v30; // rax
struct cocos2d::CCObject *v31; // rbp
unsigned int v32; // edi
unsigned int v33; // eax
const struct cocos2d::CCPoint *v34; // r15
int v35; // xmm6_4
int v36; // xmm7_4
int v37; // xmm8_4
unsigned int v38; // ebx
int v39; // eax
struct cocos2d::CCObject *v40; // rax
unsigned int v41; // eax
__int64 v42; // rdx
char *v43; // rax
cocos2d::CCDirector *v44; // rax
float v45; // xmm0_4
__int64 v46; // rbx
__int64 v47; // rax
__int64 v48; // rsi
cocos2d::CCString *v49; // rax
const char *CString; // rbp
__int64 *v51; // rbx
cocos2d::CCObject *v52; // rdi
float v53; // xmm7_4
__int64 v54; // rax
__int64 v55; // rbx
__int64 v56; // rax
cocos2d::CCSprite *v57; // rbx
__int64 v58; // rdi
__int64 v59; // rax
__int64 v60; // rbx
__int64 v61; // rax
float v63; // [rsp+40h] [rbp-88h] BYREF
char v64[8]; // [rsp+48h] [rbp-80h] BYREF
_BYTE v65[32]; // [rsp+50h] [rbp-78h] BYREF
void *v66; // [rsp+D0h] [rbp+8h] BYREF
const struct cocos2d::CCPoint *v67; // [rsp+E0h] [rbp+18h]
int v68; // [rsp+E8h] [rbp+20h]
v68 = a4;
v67 = a3;
v66 = a1;
v10 = a4;
v12 = a1;
v13 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v13, &v63);
v15 = (cocos2d::CCObject *)cocos2d::CCArray::create(v14);
*((_QWORD *)v12 + 41) = v15;
cocos2d::CCObject::retain(v15);
v17 = (cocos2d::CCArray *)cocos2d::CCArray::create(v16);
v19 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v18);
cocos2d::CCArray::addObject(v17, v19);
v20 = 0;
v21 = a5;
a10 = a5 * v10;
v22 = 0;
if ( cocos2d::CCArray::count(a2) )
{
v23 = a10;
do
{
v24 = cocos2d::CCArray::objectAtIndex(a2, v22);
v25 = cocos2d::CCArray::objectAtIndex(v17, v20);
v26 = (*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v24 + 56LL))(v24);
if ( cocos2d::CCArray::count(v25) >= v23 || v26 == -1 )
{
v30 = (cocos2d::CCArray *)cocos2d::CCArray::create(v27);
v31 = v30;
if ( v26 != -1 )
cocos2d::CCArray::addObject(v30, v24);
++v20;
v28 = v31;
v29 = v17;
}
else
{
v28 = v24;
v29 = v25;
}
cocos2d::CCArray::addObject(v29, v28);
++v22;
}
while ( v22 < cocos2d::CCArray::count(a2) );
v12 = v66;
v10 = v68;
v21 = a5;
}
v32 = 0;
v33 = cocos2d::CCArray::count(v17);
v34 = v67;
if ( v33 )
{
v35 = a8;
v36 = a7;
v37 = a6;
do
{
v38 = (unsigned int)cocos2d::CCArray::objectAtIndex(v17, v32);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v66, v34);
v40 = (struct cocos2d::CCObject *)ListButtonPage::create(v38, v39, v10, v21, v37, v36, v35);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)v12 + 41), v40);
++v32;
}
while ( v32 < cocos2d::CCArray::count(v17) );
}
v41 = cocos2d::CCArray::count(*((cocos2d::CCArray **)v12 + 41));
v43 = BoomScrollLayer::create(*((_QWORD *)v12 + 41), v42, v41 >= 2, 0, 0);
*((_QWORD *)v12 + 40) = v43;
(*(void (__fastcall **)(void *, char *))(*(_QWORD *)v12 + 464LL))(v12, v43);
v44 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector();
v45 = cocos2d::CCDirector::getScreenBottom(v44) + 6.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v66, v63 * 0.5, v45);
v46 = *((_QWORD *)v12 + 40);
cocos2d::CCPoint::operator=(v46 + 572, v47);
BoomScrollLayer::updateDots(v46);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)v12 + 40) + 920LL))(*((_QWORD *)v12 + 40), 0);
if ( cocos2d::CCArray::count(*((cocos2d::CCArray **)v12 + 41)) <= 1 )
{
*(_BYTE *)(*((_QWORD *)v12 + 40) + 569LL) = 0;
return 1;
}
v48 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v12 + 464LL))(v12, v48);
v49 = cocos2d::CCString::createWithFormat("GJ_arrow_%02d_001.png", 1);
CString = cocos2d::CCString::getCString(v49);
v51 = (__int64 *)cocos2d::CCSprite::createWithSpriteFrameName(CString);
(*(void (__fastcall **)(__int64 *))(*v51 + 160))(v51);
v66 = operator new(0x208u);
v52 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v66);
if ( v52 )
{
if ( CCMenuItemSpriteExtra::init((__int64 *)v52, v51, 0, (__int64)v12, (__int64)ListButtonBar::onLeft) )
{
cocos2d::CCObject::autorelease(v52);
goto LABEL_20;
}
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v52 + 8LL))(v52, 1);
}
v52 = nullptr;
LABEL_20:
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v48 + 464LL))(v48, v52);
*((_DWORD *)v52 + 93) = 1069547520;
v53 = a9;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, -a9, 0.0);
cocos2d::CCPoint::operator+(v34, &v66, v54);
v55 = *(_QWORD *)v52;
cocos2d::CCNode::convertToNodeSpace(v48, v65, &v66);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v55 + 184))(v52, v56);
v57 = cocos2d::CCSprite::createWithSpriteFrameName(CString);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v57 + 160LL))(v57);
cocos2d::CCSprite::setFlipX(v57, 1);
v66 = operator new(0x208u);
v58 = CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v66);
if ( !v58 )
{
LABEL_24:
v58 = 0;
goto LABEL_25;
}
if ( !CCMenuItemSpriteExtra::init((__int64 *)v58, (__int64 *)v57, 0, (__int64)v12, (__int64)ListButtonBar::onRight) )
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v58 + 8LL))(v58, 1);
goto LABEL_24;
}
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v58);
LABEL_25:
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v48 + 464LL))(v48, v58);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, v53, 0.0);
cocos2d::CCPoint::operator+(v34, &v66, v59);
v60 = *(_QWORD *)v58;
cocos2d::CCNode::convertToNodeSpace(v48, v64, &v66);
(*(void (__fastcall **)(__int64, __int64))(v60 + 184))(v58, v61);
*(_DWORD *)(v58 + 372) = 1069547520;
return 1;
}