//
// SetFolderPopup::init from 0xa2ab24 to 0xa2adf4 (720 bytes)
//
// 2 xrefs:
// > SetFolderPopup::create @ 0xa2afb4
// > ??> @ 0x76eb8
//
// 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:59:44 +0000
//
__int64 __fastcall SetFolderPopup::init(__int64 a1, int a2, char a3, char *a4)
{
char v7; // w0
cocos2d::CCDirector *v8; // x0
__int64 v9; // x1
unsigned int v10; // w22
cocos2d::CCDirector *v11; // x0
cocos2d::CCDirector *v12; // x0
const char *v13; // x2
__int64 v14; // x0
__int64 v15; // x23
void (__fastcall *v16)(__int64, __int64 *); // x25
const char *v17; // x1
__int64 v18; // x23
__int64 v19; // x23
cocos2d::CCNode *v20; // x25
void (__fastcall *v21)(__int64, __int64 *); // x24
char *v23; // [xsp+0h] [xbp-10h]
__int64 v24; // [xsp+80h] [xbp+70h] BYREF
_BYTE v25[8]; // [xsp+88h] [xbp+78h] BYREF
__int64 v26; // [xsp+90h] [xbp+80h] BYREF
cocos2d::CCDirector *v27; // [xsp+98h] [xbp+88h] BYREF
__int64 v28; // [xsp+A0h] [xbp+90h]
void *v29; // [xsp+A8h] [xbp+98h]
__int64 v30[2]; // [xsp+B0h] [xbp+A0h] BYREF
void *v31; // [xsp+C0h] [xbp+B0h]
v27 = nullptr;
v7 = *a4;
v28 = 0;
v29 = nullptr;
if ( (v7 & 1) != 0 )
{
std::string::__init((__int64 *)&v27, *((void **)a4 + 2), *((_QWORD *)a4 + 1));
}
else
{
v8 = *(cocos2d::CCDirector **)a4;
v9 = *((_QWORD *)a4 + 1);
v29 = *((void **)a4 + 2);
v27 = v8;
v28 = v9;
}
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
std::string::__init(v30, "OK", 2u);
LOBYTE(v23) = 0;
v10 = (unsigned __int8)SetIDPopup::init(a1, a2, 0, 999, (__int64)&v27, (__int64)v30, 1u, 0, 60.0, v23, 0);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
v11 = (cocos2d::CCDirector *)(unsigned __int8)v27;
if ( ((unsigned __int8)v27 & 1) != 0 )
operator delete(v29);
if ( v10 )
{
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize(&v24, v12);
*(_BYTE *)(a1 + 712) = a3;
v14 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)&byte_11E1A70, "bigFont.fnt", v13);
*(_QWORD *)(a1 + 720) = v14;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v14 + 160LL))(v14, 0.4);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 720),
1);
v15 = *(_QWORD *)(a1 + 720);
v16 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v26,
*(float *)&v24 * 0.5,
(float)((float)(*((float *)&v24 + 1) * 0.5) + 35.0) + 60.0);
v16(v15, &v26);
v18 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_optionsBtn_001.png", v17);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v18 + 160LL))(v18, 0.5);
v19 = CCMenuItemSpriteExtra::create(v18, 0, a1, (__int64)SetFolderPopup::onSetFolderName, 0);
CCMenuItemSpriteExtra::setSizeMult(v19, 1.1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v19);
v20 = *(cocos2d::CCNode **)(a1 + 552);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v25,
(float)(*(float *)&v24 * 0.5) + 90.0,
(float)((float)(*((float *)&v24 + 1) * 0.5) + 20.0) + 60.0);
cocos2d::CCNode::convertToNodeSpace(&v26, v20, (const cocos2d::CCPoint *)v25);
v21(v19, &v26);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1360LL))(a1);
}
return v10;
}