//
// ListButtonBar::init from 0x1003dd270 to 0x1003dd6a8 (1080 bytes)
//
// 1 xrefs:
// > ListButtonBar::create @ 0x1003dd23e
//
// 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:44 +0000
//
char __fastcall ListButtonBar::init(
__int64 a1,
__int64 a2,
unsigned __int64 *a3,
unsigned int a4,
unsigned int a5,
unsigned int a6,
float a7,
float a8,
float a9,
__m128 a10)
{
__int64 v11; // r13
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rdi
__int64 v15; // rbx
__int64 v16; // rax
unsigned int v17; // r12d
__int64 v18; // rdi
__int64 v19; // rsi
__int64 v20; // r13
__int64 v21; // r15
__int64 v22; // rbx
int v23; // r14d
unsigned int v24; // eax
__int64 v25; // rax
__int64 v26; // rbx
int v27; // eax
_QWORD *v28; // r12
unsigned int v29; // r13d
unsigned int v30; // r15d
__int64 v31; // r14
unsigned int v32; // ebx
__int64 v33; // rax
unsigned int v34; // r14d
unsigned int v35; // r13d
_QWORD *v36; // r15
__int64 v37; // r12
__int64 v38; // rdi
__int64 v39; // rax
__int64 v40; // rbx
unsigned int v41; // eax
void *v42; // rax
void *v43; // rsi
__int64 v44; // rbx
__int64 v45; // rax
double v46; // xmm0_8
float v47; // xmm1_4
double v48; // xmm0_8
__int64 v49; // r15
__int64 v50; // rsi
__int64 v51; // rax
__int64 CString; // rbx
char *v53; // r14
void *v54; // r14
double v55; // xmm0_8
unsigned __int8 *v56; // rbx
void *v57; // rbx
float v59; // [rsp+0h] [rbp-A0h]
float v60; // [rsp+10h] [rbp-90h] BYREF
double v61; // [rsp+18h] [rbp-88h] BYREF
unsigned __int64 v62; // [rsp+20h] [rbp-80h] BYREF
__int64 v63; // [rsp+28h] [rbp-78h]
__int64 v64; // [rsp+30h] [rbp-70h]
_QWORD *v65; // [rsp+38h] [rbp-68h]
float v66; // [rsp+44h] [rbp-5Ch]
float v67; // [rsp+48h] [rbp-58h]
float v68; // [rsp+4Ch] [rbp-54h]
unsigned int v69; // [rsp+50h] [rbp-50h]
unsigned int v70; // [rsp+54h] [rbp-4Ch]
unsigned __int64 *v71; // [rsp+58h] [rbp-48h]
__int64 v72; // [rsp+64h] [rbp-3Ch] BYREF
unsigned int v73; // [rsp+6Ch] [rbp-34h]
unsigned int v74; // [rsp+70h] [rbp-30h]
float v75; // [rsp+74h] [rbp-2Ch]
v70 = a6;
v66 = a9;
v67 = a8;
v68 = a7;
v74 = a4;
v71 = a3;
v11 = a2;
v12 = cocos2d::CCDirector::sharedDirector(a1, a2);
cocos2d::CCDirector::getWinSize(&v60, v12);
v13 = sub_1007FE900(&v60);
v65 = (_QWORD *)a1;
*(_QWORD *)(a1 + 328) = v13;
v14 = v13;
cocos2d::CCObject::retain(v13);
v15 = sub_1007FE900(v14);
v16 = sub_1007FE900(v14);
sub_1007FEBF0(v15, v16);
if ( (unsigned int)sub_1007FEF90(a2) )
{
v69 = v74 * a5;
v75 = 0.0;
v17 = 0;
v73 = a5;
v63 = a2;
do
{
v20 = sub_1007FEFE0(v11, v17);
v21 = v15;
v22 = sub_1007FEFE0(v15, LODWORD(v75));
v23 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 64LL))(v20);
v24 = sub_1007FEF90(v22);
if ( v24 >= v69 || v23 == -1 )
{
v25 = sub_1007FE900(v22);
v26 = v25;
if ( v23 != -1 )
sub_1007FEBF0(v25, v20);
++LODWORD(v75);
v18 = v21;
v19 = v26;
}
else
{
v18 = v22;
v19 = v20;
}
sub_1007FEBF0(v18, v19);
a5 = v73;
++v17;
v11 = v63;
v15 = v21;
}
while ( v17 < (unsigned int)sub_1007FEF90(v63) );
}
v27 = sub_1007FEF90(v15);
v28 = v65;
v29 = v74;
if ( v27 )
{
v30 = a5;
v31 = v15;
v32 = 0;
v64 = v31;
do
{
v33 = sub_1007FEFE0(v31, v32);
v34 = v29;
v35 = v30;
v36 = v28;
v37 = v33;
sub_1002782D0(&v72, v71);
v38 = v37;
v28 = v36;
v30 = v35;
v29 = v34;
v31 = v64;
v39 = ListButtonPage::create(v38, &v72, v29, v30, v68, v67, v66);
sub_1007FEBF0(v28[41], v39);
++v32;
}
while ( v32 < (unsigned int)sub_1007FEF90(v31) );
}
v40 = v28[41];
v41 = sub_1007FEF90(v40);
v42 = BoomScrollLayer::create_1(v40, 0, v41 >= 2);
v28[40] = v42;
v43 = v42;
(*(void (__fastcall **)(_QWORD *, void *))(*v28 + 456LL))(v28, v42);
v44 = v28[40];
v75 = v60 * 0.5;
v45 = cocos2d::CCDirector::sharedDirector(v28, v43);
v46 = sub_100479750(v45);
v47 = *(float *)&v46 + 6.0;
*(_QWORD *)&v48 = LODWORD(v75);
sub_100278250((float *)&v72, v75, v47);
BoomScrollLayer::setPagesIndicatorPosition(v44, &v72);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)v28[40] + 1000LL))(v28[40], 0);
if ( (unsigned int)sub_1007FEF90(v28[41]) <= 1 )
{
*(_BYTE *)(v28[40] + 569LL) = 0;
}
else
{
v49 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(_QWORD *, __int64))(*v28 + 456LL))(v28, v49);
v50 = v70;
v51 = sub_10088E820("GJ_arrow_%02d_001.png", a10.i8[0]);
CString = cocos2d::CCString::getCString(v51);
v53 = cocos2d::CCSprite::createWithSpriteFrameName(CString, v48);
(*(void (__fastcall **)(char *, __int64, float))(*(_QWORD *)v53 + 160LL))(v53, v50, 0.80000001);
v54 = CCMenuItemSpriteExtra::create((__int64)v53, 0, (__int64)v28, (__int64)ListButtonBar::onLeft, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v49 + 456LL))(v49, v54);
CCMenuItemSpriteExtra::setSizeMult((__int64)v54, 1.5);
sub_100278250((float *)&v62, -v59, 0.0);
sub_100278350(&v61, v71, &v62);
cocos2d::CCNode::convertToNodeSpace((double *)&v72, v49, (unsigned int *)&v61);
v55 = (*(double (__fastcall **)(void *, __int64 *))(*(_QWORD *)v54 + 184LL))(v54, &v72);
v56 = (unsigned __int8 *)cocos2d::CCSprite::createWithSpriteFrameName(CString, v55);
(*(void (__fastcall **)(unsigned __int8 *, float))(*(_QWORD *)v56 + 160LL))(v56, 0.80000001);
cocos2d::CCSprite::setFlipX(v56, 1u);
v57 = CCMenuItemSpriteExtra::create((__int64)v56, 0, (__int64)v65, (__int64)ListButtonBar::onRight, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v49 + 456LL))(v49, v57);
sub_100278250((float *)&v62, v59, 0.0);
sub_100278350(&v61, v71, &v62);
cocos2d::CCNode::convertToNodeSpace((double *)&v72, v49, (unsigned int *)&v61);
(*(void (__fastcall **)(void *, __int64 *))(*(_QWORD *)v57 + 184LL))(v57, &v72);
CCMenuItemSpriteExtra::setSizeMult((__int64)v57, 1.5);
}
return 1;
}