//
// SoundPackDescPopup::init from 0xccfb50 to 0xcd037c (2092 bytes)
//
// 2 xrefs:
// > SoundPackDescPopup::create @ 0xcd0608
// > ??> @ 0xa2718
//
// 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:06:26 +0000
//
__int64 __fastcall SoundPackDescPopup::init(__int64 a1, unsigned __int8 *a2, __int64 a3, __int64 a4)
{
unsigned __int8 v8; // w0
unsigned int v9; // w25
__int64 *v10; // x0
cocos2d::CCDirector *v11; // x0
float v12; // s8
float v13; // s9
const char *v14; // x1
__int64 v15; // x21
__int64 v16; // x21
cocos2d::CCNode *v17; // x28
void (__fastcall *v18)(__int64, __int64 *); // x27
__int64 v19; // x21
void (__fastcall *v20)(__int64, __int64 *); // x27
void (__fastcall *v21)(__int64, __int64 *); // x2
void (__fastcall *v22)(__int64, __int64 *); // x27
__int64 v23; // x0
__int64 v24; // x21
void (__fastcall *v25)(__int64, __int64 *); // x27
__int64 *v26; // x0
__int64 v27; // x21
EmoteSprite *v28; // x0
CCTextInputNode *v29; // x21
int v30; // w0
float v31; // s14
TextArea *v32; // x21
__int64 v33; // x1
void (__fastcall *v34)(TextArea *, __int64 *); // x27
void (__fastcall *v35)(TextArea *, __int64 *); // x27
const char *v36; // x6
int v37; // w1
_QWORD *v38; // x21
const char *v39; // x1
size_t v40; // x0
__int64 v41; // x0
__int64 v42; // x21
cocos2d::CCNode *v43; // x27
void (__fastcall *v44)(__int64, __int64 *); // x26
float v45; // s8
const char *v46; // x2
__int64 v47; // x21
void (__fastcall *v48)(__int64, __int64 *); // x26
void (__fastcall *v49)(__int64, __int64 *); // x26
__int64 v50; // x26
void (__fastcall *v51)(__int64, __int64 *); // x27
__int64 v52; // x0
__int64 v53; // x26
__int64 v54; // x0
cocos2d::CCNode *v55; // x27
__int64 (__fastcall *v56)(__int64); // x1
void (__fastcall *v57)(__int64, __int64 *); // x21
float *v58; // x0
cocos2d::CCSprite *v59; // x21
long double v60; // q1
__int64 v61; // x23
cocos2d::CCNode *v62; // x21
void (__fastcall *v63)(__int64, __int64 *); // x19
char *v65; // [xsp+A8h] [xbp+A8h]
int v66; // [xsp+B8h] [xbp+B8h]
__int64 v67; // [xsp+C0h] [xbp+C0h] BYREF
_BYTE v68[8]; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v69[2]; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v70; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v71; // [xsp+E8h] [xbp+E8h]
void *v72; // [xsp+F0h] [xbp+F0h]
v8 = SetupTriggerPopup::init((SetupTriggerPopup *)a1, nullptr, nullptr, 340.0, 190.0, 1u, 0.0);
v9 = v8;
if ( !v8 )
return v9;
v10 = (__int64 *)(a1 + 1048);
*(_QWORD *)(a1 + 1024) = a4;
if ( a1 + 1048 != a3 )
{
if ( (*(_BYTE *)a3 & 1) != 0 )
v10 = std::string::assign(v10, *(const void **)(a3 + 16), *(_QWORD *)(a3 + 8));
else
v10 = std::string::assign(v10, (const void *)(a3 + 1), *(_BYTE *)a3 >> 1);
}
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v10);
cocos2d::CCDirector::getWinSize(&v67, v11);
v70 = 0;
v12 = *((float *)&v67 + 1) * 0.5;
v71 = 0;
v13 = *(float *)&v67 * 0.5;
v72 = nullptr;
std::string::__init(&v70, "Description", 0xBu);
SetupTriggerPopup::addTitle(a1, (__int64)&v70);
if ( (v70 & 1) != 0 )
operator delete(v72);
v15 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v14);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 160LL))(v15, 0.8);
v16 = CCMenuItemSpriteExtra::create(v15, 0, a1, 1368, 1);
CCMenuItemSpriteExtra::setSizeMult(v16, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v16);
v17 = *(cocos2d::CCNode **)(a1 + 552);
v18 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v68, (float)(v13 - 170.0) + 8.0, (float)(v12 + 95.0) - 12.0);
cocos2d::CCNode::convertToNodeSpace(v69, v17, (const cocos2d::CCPoint *)v68);
v18(v16, v69);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v69, 0.0, 0.0, 40.0, 40.0);
v19 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v69);
v20 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v69, 300.0, 92.0);
v20(v19, v69);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 960LL);
LOWORD(v69[0]) = 13405;
BYTE2(v69[0]) = 31;
v21(v19, v69);
v22 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v19 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, v13, v12 + 8.0);
v22(v19, v69);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v19, 0);
*(_DWORD *)(a1 + 1040) = 1133248512;
v23 = CCTextInputNode::create(
(CCTextInputNode *)"Describe this sound pack",
288.0,
82.0,
"Thonburi",
(const char *)&off_18,
nullptr,
(const char *)0x438C0000);
*(_QWORD *)(a1 + 1032) = v23;
*(_BYTE *)(v23 + 608) = 0;
v24 = *(_QWORD *)(a1 + 1032);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v24 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, v13, v12 + 8.0);
v25(v24, v69);
v26 = CCTextInputNode::setUnicodeText(*(__int64 **)(a1 + 1032), 1);
v27 = *(_QWORD *)(a1 + 1032);
v28 = (EmoteSprite *)(17 * (unsigned int)EmoteSprite::maxEmotesComment((EmoteSprite *)v26) + 140);
*(_DWORD *)(v27 + 592) = (_DWORD)v28;
v29 = *(CCTextInputNode **)(a1 + 1032);
v30 = EmoteSprite::maxEmotesComment(v28);
CCTextInputNode::setParseEmotes(v29, v30);
LOBYTE(v66) = -61;
*(_QWORD *)(*(_QWORD *)(a1 + 1032) + 584LL) = a1 + 544;
*(_WORD *)((char *)&v66 + 1) = 16748;
CCTextInputNode::setLabelPlaceholderColor(*(_QWORD *)(a1 + 1032), v66);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 1032),
5);
v70 = 0;
v71 = 0;
v72 = nullptr;
std::string::__init(&v70, &byte_11B8890, 0);
v31 = *(float *)(a1 + 1040);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, 0.0, 0.5);
v32 = (TextArea *)TextArea::create((char *)&v70, "chatFont.fnt", (const cocos2d::CCPoint *)v69, 1, 0, 1.0, v31, 20.0);
if ( (v70 & 1) != 0 )
operator delete(v72);
v33 = *(_QWORD *)v32;
*((_BYTE *)v32 + 597) = 1;
v34 = *(void (__fastcall **)(TextArea *, __int64 *))(v33 + 296);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, 0.0, 0.5);
v34(v32, v69);
CCTextInputNode::addTextArea(*(CCTextInputNode **)(a1 + 1032), v32);
v35 = *(void (__fastcall **)(TextArea *, __int64 *))(*(_QWORD *)v32 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, (float)-*(float *)(a1 + 1040) * 0.5, 0.0);
v35(v32, v69);
v37 = *a2;
if ( (v37 & 1) != 0 )
{
if ( *((_QWORD *)a2 + 1) )
{
v38 = *(_QWORD **)(a1 + 1032);
v39 = *((const char **)a2 + 2);
LABEL_12:
v65 = (char *)v39;
v70 = 0;
v71 = 0;
v72 = nullptr;
v40 = strlen(v39);
std::string::__init(&v70, v65, v40);
CCTextInputNode::setString(v38, (char *)&v70);
if ( (v70 & 1) != 0 )
operator delete(v72);
}
}
else if ( v37 >> 1 )
{
v38 = *(_QWORD **)(a1 + 1032);
v39 = (const char *)(a2 + 1);
goto LABEL_12;
}
v41 = ButtonSprite::create(
(ButtonSprite *)"Save",
(const char *)&dword_44 + 2,
0,
1,
0.6,
"bigFont.fnt",
"GJ_button_01.png",
v36,
28.0);
v42 = CCMenuItemSpriteExtra::create(v41, 0, a1, (__int64)SoundPackDescPopup::onSave, 0);
CCMenuItemSpriteExtra::setSizeMult(v42, 1.1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v42);
v43 = *(cocos2d::CCNode **)(a1 + 552);
v44 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v42 + 184LL);
v45 = (float)(v12 - 95.0) + 24.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v68, v13, v45);
cocos2d::CCNode::convertToNodeSpace(v69, v43, (const cocos2d::CCPoint *)v68);
v44(v42, v69);
v47 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Icon:", "goldFont.fnt", v46);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v47 + 160LL))(v47, 0.5);
v48 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, 0.0, 0.5);
v48(v47, v69);
v49 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, (float)(v13 - 170.0) + 22.0, v45);
v49(v47, v69);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v47, 1);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v69, 0.0, 0.0, 40.0, 40.0);
v50 = cocos2d::extension::CCScale9Sprite::create("GJ_button_04.png", v69);
v51 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v50 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v69, 32.0, 32.0);
v51(v50, v69);
*(_QWORD *)(a1 + 1072) = v50;
v52 = CCMenuItemSpriteExtra::create(v50, 0, a1, (__int64)SoundPackDescPopup::onPickIcon, 0);
*(_QWORD *)(a1 + 1080) = v52;
CCMenuItemSpriteExtra::setSizeMult(v52, 1.2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 456LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 1080));
v53 = *(_QWORD *)(a1 + 1080);
v54 = v47;
v55 = *(cocos2d::CCNode **)(a1 + 552);
v56 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v47 + 328LL);
v57 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v53 + 184LL);
v58 = (float *)v56(v54);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v68,
(float)((float)((float)(v13 - 170.0) + 22.0) + (float)(*v58 * 0.5)) + 24.0,
v45);
cocos2d::CCNode::convertToNodeSpace(v69, v55, (const cocos2d::CCPoint *)v68);
v57(v53, v69);
SoundPackDescPopup::refreshIconSlot((SoundPackDescPopup *)a1);
v70 = 0;
v71 = 0;
v72 = nullptr;
std::string::__init(&v70, "easy", 4u);
v59 = EmoteSprite::createWithName((char *)&v70);
if ( (v70 & 1) != 0 )
operator delete(v72);
LODWORD(v60) = 0;
EmoteSprite::fitToHeight(v59, 18.0, v60);
v61 = CCMenuItemSpriteExtra::create((__int64)v59, 0, a1, (__int64)SoundPackDescPopup::onEmotes, 0);
CCMenuItemSpriteExtra::setSizeMult(v61, 1.4);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v61);
v62 = *(cocos2d::CCNode **)(a1 + 552);
v63 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v61 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v68, (float)(v13 + 170.0) - 30.0, v45);
cocos2d::CCNode::convertToNodeSpace(v69, v62, (const cocos2d::CCPoint *)v68);
v63(v61, v69);
return v9;
}