//
// SetupReverbPopup::init from 0x1405dbc60 to 0x1405dc23b (1499 bytes)
//
// 2 xrefs:
// > SetupSFXPopup::onPlusButton @ 0x1405de747
// > ??> @ 0x14092ec64
//
// 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:34:59 +0000
//
// Hidden C++ exception states: #wind=2
char __fastcall SetupReverbPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
struct cocos2d::CCLabelBMFont *v9; // rax
__int64 v10; // rax
cocos2d::CCSprite *v11; // rbx
cocos2d::CCObject *v12; // rdi
__int64 v13; // rax
__int64 v14; // rbx
__int64 v15; // rax
__int64 v16; // rbx
__int64 v17; // rax
struct cocos2d::CCSprite *v18; // rax
cocos2d::CCObject *v19; // rdi
__int64 v20; // rax
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rbx
__int64 v24; // rax
struct cocos2d::CCSprite *v25; // rax
cocos2d::CCObject *v26; // rdi
__int64 v27; // rax
__int64 v28; // rbx
__int64 v29; // rax
float v30[2]; // [rsp+48h] [rbp-39h] BYREF
__int128 *v31; // [rsp+50h] [rbp-31h] BYREF
__int128 *v32; // [rsp+58h] [rbp-29h] BYREF
_BYTE v33[8]; // [rsp+60h] [rbp-21h] BYREF
__int128 v34; // [rsp+68h] [rbp-19h] BYREF
__int64 v35; // [rsp+78h] [rbp-9h]
__int64 v36; // [rsp+80h] [rbp-1h]
__int128 v37; // [rsp+88h] [rbp+7h] BYREF
__int64 v38; // [rsp+98h] [rbp+17h]
__int64 v39; // [rsp+A0h] [rbp+1Fh]
char v40; // [rsp+100h] [rbp+7Fh] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1124859904, 2, 0);
if ( result )
{
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v34 = 0;
v36 = 0;
*(_QWORD *)&v34 = sub_14003D460(0x20u);
v35 = 18;
v36 = 31;
strcpy((char *)v34, "Edit Global Reverb");
SetupTriggerPopup::addTitle(a1, &v34);
v34 = 0;
v35 = 2;
v36 = 15;
strcpy((char *)&v34, "OK");
SetupTriggerPopup::addCloseButton(a1, &v34);
v31 = &v34;
v34 = 0;
v35 = 0;
v36 = 0;
*(_QWORD *)&v34 = sub_14003D460(0xC0u);
v35 = 183;
v36 = 191;
strcpy(
(char *)v34,
"Lets you change the Reverb settings.\n"
"The sound engine has one global reverb channel. This means that two sounds with different reverb settings cannot b"
"e played simultaneously.");
v37 = 0;
v38 = 4;
v39 = 15;
strcpy((char *)&v37, "Help");
SetupTriggerPopup::addHelpButton(a1, &v37, &v34);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, v30[0] * 0.5, v30[1] * 0.5);
v32 = &v34;
v34 = 0;
v35 = 6;
v36 = 15;
strcpy((char *)&v34, "Enable");
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v33,
(float)(*(float *)(a1 + 732) * 0.5) - 78.0,
24.0 - (float)(*(float *)(a1 + 736) * 0.5));
cocos2d::CCPoint::operator+(&v40, &v31, v8);
SetupTriggerPopup::createToggleValueControl(a1, 503, (unsigned int)&v34, (unsigned int)&v31, 0, 0, 0, 1065353216);
v9 = cocos2d::CCLabelBMFont::create("Reverb", "goldFont.fnt");
*(_QWORD *)(a1 + 1000) = v9;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v9,
1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 0.0, 5.0);
cocos2d::CCPoint::operator+(&v40, &v31, v10);
(*(void (__fastcall **)(_QWORD, __int128 **))(**(_QWORD **)(a1 + 1000) + 184LL))(*(_QWORD *)(a1 + 1000), &v31);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v11, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v11 + 160LL))(v11);
v12 = CCMenuItemSpriteExtra::create((int)v11, 0, a1, (__int64)SetupReverbPopup::onReverb);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, 100.0, 0.0);
v14 = v13;
v15 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1000) + 200LL))(*(_QWORD *)(a1 + 1000));
cocos2d::CCPoint::operator+(v15, &v31, v14);
v16 = *(_QWORD *)v12;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v32, &v31);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v16 + 184))(v12, v17);
*((_DWORD *)v12 + 93) = 1068708659;
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v12 + 64LL))(v12, 1);
v18 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
LODWORD(v16) = (_DWORD)v18;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v18 + 160LL))(v18);
v19 = CCMenuItemSpriteExtra::create(v16, 0, a1, (__int64)SetupReverbPopup::onReverb);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, -100.0, 0.0);
v21 = v20;
v22 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1000) + 200LL))(*(_QWORD *)(a1 + 1000));
cocos2d::CCPoint::operator+(v22, &v31, v21);
v23 = *(_QWORD *)v19;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v32, &v31);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v23 + 184))(v19, v24);
*((_DWORD *)v19 + 93) = 1068708659;
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v19 + 64LL))(v19, 0);
SetupReverbPopup::updateReverbLabel(a1);
v25 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playMusicBtn_001.png");
LODWORD(v23) = (_DWORD)v25;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v25 + 160LL))(v25);
v26 = CCMenuItemSpriteExtra::create(v23, 0, a1, (__int64)SetupReverbPopup::onPlay);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v26);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v33,
(float)(*(float *)(a1 + 732) * 0.5) - 24.0,
(float)(*(float *)(a1 + 736) * 0.5) - 24.0);
cocos2d::CCPoint::operator+(&v40, &v31, v27);
v28 = *(_QWORD *)v26;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v32, &v31);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v28 + 184))(v26, v29);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}