//
// OptionsScrollLayer::init from 0xb8843c to 0xb88bc8 (1932 bytes)
//
// 2 xrefs:
// > OptionsScrollLayer::create @ 0xb88db8
// > ??> @ 0xe6b18
//
// 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 13:02:32 +0000
//
__int64 __fastcall OptionsScrollLayer::init(
__int64 a1,
cocos2d::CCObject *a2,
char a3,
__int64 a4,
cocos2d::CCObject *a5)
{
unsigned __int8 v9; // w0
unsigned int v10; // w23
cocos2d::CCDirector *v11; // x0
unsigned int *v12; // x1
unsigned __int64 v13; // x26
__int64 v14; // x0
__int64 v15; // x27
unsigned __int64 *v16; // x25
signed __int64 v17; // x20
unsigned __int64 *v18; // x22
cocos2d::CCDirector *v19; // x0
__int64 v20; // x25
void (__fastcall *v21)(__int64, __int64 *); // x26
__int64 (__fastcall *v22)(__int64, __int64 *); // x26
cocos2d::CCMenu *v23; // x0
__int64 v24; // x0
__int64 v25; // x0
__int64 v26; // x25
cocos2d::CCNode *v27; // x27
void (__fastcall *v28)(__int64, __int64 *); // x26
float v29; // s9
float v30; // s8
__int64 v31; // x25
void (__fastcall *v32)(__int64, __int64 *); // x26
__int64 v33; // x0
void (__fastcall *v34)(__int64, __int64 *); // x2
__int64 v35; // x25
void (__fastcall *v36)(__int64, __int64 *); // x26
const char *v37; // x4
CCTextInputNode *v38; // x0
__int64 v39; // x0
__int64 v40; // x24
void (__fastcall *v41)(__int64, __int64 *); // x25
const char *v42; // x1
__int64 v43; // x24
__int64 v44; // x0
__int64 v45; // x24
cocos2d::CCNode *v46; // x26
void (__fastcall *v47)(__int64, __int64 *); // x25
const char *v48; // x1
__int64 v49; // x24
__int64 v50; // x24
cocos2d::CCNode *v51; // x26
void (__fastcall *v52)(__int64, __int64 *); // x25
__int64 v53; // x1
int v54; // w0
__int64 v55; // x2
cocos2d::CCString *v56; // x0
const char *CString; // x0
size_t v58; // x0
const char *v59; // x2
cocos2d::CCLabelBMFont *v60; // x0
__int64 v61; // x22
void (__fastcall *v62)(__int64, __int64 *); // x24
cocos2d::CCObject *v65; // [xsp+98h] [xbp+98h]
int v66; // [xsp+A0h] [xbp+A0h]
__int64 v67; // [xsp+A8h] [xbp+A8h] BYREF
_BYTE v68[8]; // [xsp+B0h] [xbp+B0h] BYREF
__int64 (__fastcall *v69)(__int64, __int64); // [xsp+B8h] [xbp+B8h] BYREF
__int64 v70[2]; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v71[2]; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCLabelBMFont *v72; // [xsp+E0h] [xbp+E0h]
v9 = FLAlertLayer::init((FLAlertLayer *)a1, 150);
v10 = v9;
if ( v9 )
{
v11 = (cocos2d::CCDirector *)(&dword_0 + 1);
*(_BYTE *)(a1 + 688) = a3;
*(_BYTE *)(a1 + 596) = 1;
*(_QWORD *)(a1 + 752) = a5;
if ( a5 )
v11 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(a5);
if ( a2 )
{
*(_QWORD *)(a1 + 672) = a2;
cocos2d::CCObject::retain(a2);
v11 = (cocos2d::CCDirector *)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 672));
if ( (unsigned int)v11 > 1 )
{
v12 = *(unsigned int **)(*(_QWORD *)(a1 + 672) + 56LL);
v13 = *((_QWORD *)v12 + 2);
v14 = 8LL * *v12;
v15 = v14 >> 3;
v69 = sub_B83574;
v16 = (unsigned __int64 *)(v13 + v14);
if ( v14 >> 3 > 128 )
{
v17 = v14 >> 3;
while ( 1 )
{
v18 = (unsigned __int64 *)operator new(8 * v17, (const std::nothrow_t *)&std::nothrow);
if ( v18 )
break;
v17 >>= 1;
if ( v17 <= 0 )
{
v17 = 0;
break;
}
}
}
else
{
v17 = 0;
v18 = nullptr;
}
v11 = (cocos2d::CCDirector *)std::__stable_sort(
v13,
v16,
(unsigned __int8 (__fastcall **)(unsigned __int64, unsigned __int64, __int64))&v69,
v15,
v18,
v17);
if ( v18 )
operator delete(v18);
}
}
v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize(&v67, v19);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v70, 0.0, 0.0, 80.0, 80.0);
v20 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v70);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 912LL))(v20, 0xFFFFFFFFLL);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v70, 440.0, 290.0);
v21(v20, v70);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v20,
0xFFFFFFFFLL);
v22 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v70, *(float *)&v67 * 0.5, *((float *)&v67 + 1) * 0.5);
v23 = (cocos2d::CCMenu *)v22(v20, v70);
v24 = cocos2d::CCMenu::create(v23);
*(_QWORD *)(a1 + 552) = v24;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v24, 10);
*(_DWORD *)(a1 + 640) = -1;
v25 = cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_closeBtn_001.png",
(const char *)0xFFFFFFFFLL);
v26 = CCMenuItemSpriteExtra::create(v25, 0, a1, (__int64)OptionsScrollLayer::onClose, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v26);
CCMenuItemSpriteExtra::setSizeMult(v26, 1.6);
v27 = *(cocos2d::CCNode **)(a1 + 552);
v28 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v68,
(float)((float)(*(float *)&v67 * 0.5) + -220.0) + 10.0,
(float)((float)(*((float *)&v67 + 1) * 0.5) + 145.0) - 10.0);
cocos2d::CCNode::convertToNodeSpace(v70, v27, (const cocos2d::CCPoint *)v68);
v28(v26, v70);
v29 = (float)(*(float *)&v67 * 0.5) + -170.0;
v30 = (float)((float)(*((float *)&v67 + 1) * 0.5) + 145.0) - 24.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v70, 0.0, 0.0, 40.0, 40.0);
v31 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v70);
*(_QWORD *)(a1 + 704) = v31;
v32 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v31 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v70, 155.0, 22.0);
v32(v31, v70);
v33 = *(_QWORD *)(a1 + 704);
v34 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v33 + 960LL);
LOWORD(v70[0]) = 13405;
BYTE2(v70[0]) = 31;
v34(v33, v70);
v35 = *(_QWORD *)(a1 + 704);
v36 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v35 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v70, v29 + 77.5, v30);
v36(v35, v70);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 704),
11);
v38 = (CCTextInputNode *)(a4 + 1);
if ( (*(_BYTE *)a4 & 1) != 0 )
v38 = *(CCTextInputNode **)(a4 + 16);
v39 = CCTextInputNode::create(v38, 145.0, 22.0, "Thonburi", (const char *)&dword_14, "bigFont.fnt", v37);
*(_QWORD *)(a1 + 696) = v39;
LOWORD(v66) = -21896;
BYTE2(v66) = -16;
CCTextInputNode::setLabelPlaceholderColor(v39, v66);
CCTextInputNode::setLabelPlaceholderScale(*(CCTextInputNode **)(a1 + 696), 0.45);
CCTextInputNode::setMaxLabelScale(*(CCTextInputNode **)(a1 + 696), 0.45);
CCTextInputNode::setMaxLabelWidth(*(CCTextInputNode **)(a1 + 696), 135.0);
*(_QWORD *)(*(_QWORD *)(a1 + 696) + 584LL) = a1 + 544;
*(_DWORD *)(*(_QWORD *)(a1 + 696) + 592LL) = 30;
v40 = *(_QWORD *)(a1 + 696);
v41 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v40 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v70, v29 + 77.5, v30 + 1.0);
v41(v40, v70);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 696),
12);
v43 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_longBtn07_001.png", v42);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v43 + 160LL))(v43, 0.45);
v44 = CCMenuItemSpriteExtra::create(v43, 0, a1, (__int64)OptionsScrollLayer::onClearSearchText, 0);
*(_QWORD *)(a1 + 712) = v44;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v44);
v45 = *(_QWORD *)(a1 + 712);
v46 = *(cocos2d::CCNode **)(a1 + 552);
v47 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v45 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v68, (float)(v29 + 155.0) + 14.0, v30);
cocos2d::CCNode::convertToNodeSpace(v70, v46, (const cocos2d::CCPoint *)v68);
v47(v45, v70);
v49 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_trashBtn_001.png", v48);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v49 + 160LL))(v49, 0.7);
v50 = CCMenuItemSpriteExtra::create(v49, 0, a1, (__int64)OptionsScrollLayer::onClearAll, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v50);
v51 = *(cocos2d::CCNode **)(a1 + 552);
v52 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v50 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v68, (float)((float)(*(float *)&v67 * 0.5) + 220.0) - 24.0, v30);
cocos2d::CCNode::convertToNodeSpace(v70, v51, (const cocos2d::CCPoint *)v68);
v52(v50, v70);
v53 = *(_QWORD *)(a1 + 752);
if ( v53 )
{
v54 = *(unsigned __int8 *)(v53 + 104);
v55 = v53 + 104;
if ( (v54 & 1) != 0 )
{
if ( *(_QWORD *)(v53 + 112) )
{
v56 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"(Active search: %s)",
*(const char **)(v53 + 120),
v55);
goto LABEL_16;
}
}
else if ( v54 >> 1 )
{
v56 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"(Active search: %s)",
(const char *)(v53 + 105),
v55);
LABEL_16:
CString = (const char *)cocos2d::CCString::getCString(v56);
v71[0] = 0;
v65 = (cocos2d::CCObject *)CString;
v71[1] = 0;
v72 = nullptr;
v58 = strlen(CString);
std::string::__init(v71, v65, v58);
v60 = (cocos2d::CCLabelBMFont *)((char *)v71 + 1);
if ( (v71[0] & 1) != 0 )
v60 = v72;
v61 = cocos2d::CCLabelBMFont::create(v60, "chatFont.fnt", v59);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v61 + 1024LL))(v61, 4294967240LL);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v61 + 1072LL))(v61, &unk_11940B8);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v61 + 160LL))(v61, 0.5);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v61,
10);
v62 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v61 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v70,
*(float *)&v67 * 0.5,
(float)((float)(*((float *)&v67 + 1) * 0.5) + -145.0) + 14.0);
v62(v61, v70);
if ( (v71[0] & 1) != 0 )
{
operator delete(v72);
OptionsScrollLayer::setupList((OptionsScrollLayer *)a1, *(cocos2d::CCArray **)(a1 + 672));
return v10;
}
}
}
OptionsScrollLayer::setupList((OptionsScrollLayer *)a1, *(cocos2d::CCArray **)(a1 + 672));
}
return v10;
}