//
// SetupAudioTriggerPopup::addProxVolControls from 0x1405da8f0 to 0x1405db974 (4228 bytes)
//
// 3 xrefs:
// > SetupSFXPopup::init @ 0x1405dd4b5
// > SetupSFXEditPopup::init @ 0x1405df7eb
// > ??> @ 0x14092ec1c
//
// 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=6
__int64 __fastcall SetupAudioTriggerPopup::addProxVolControls(__int64 a1, unsigned int a2)
{
__int64 v4; // rax
__int64 v5; // rsi
__int64 v6; // rdi
__int64 v7; // rax
void **v8; // rbx
float *v9; // rax
void *v10; // rcx
__int64 v11; // rax
void *v12; // rcx
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // rcx
cocos2d::CCObject *v23; // rax
int v24; // r12d
cocos2d::CCArray *PageContainer; // r13
int i; // esi
char *v27; // rdx
void **v28; // rcx
struct cocos2d::CCSprite *v29; // r15
cocos2d::CCObject *v30; // rbx
__int64 v31; // r9
const char *v32; // rax
cocos2d::CCObject *v33; // rdi
__int64 v34; // rbx
float v35; // xmm6_4
float *v36; // rax
__int64 v37; // rax
__int64 v38; // rbx
__int64 v39; // r15
int v40; // eax
__int64 v41; // rax
__int64 v42; // rax
void *v43; // rcx
__int64 v44; // r8
__int64 v46; // [rsp+38h] [rbp-D0h]
_BYTE v47[8]; // [rsp+88h] [rbp-80h] BYREF
void **v48; // [rsp+90h] [rbp-78h] BYREF
void *v49; // [rsp+98h] [rbp-70h] BYREF
_BYTE v50[8]; // [rsp+A0h] [rbp-68h] BYREF
float v51; // [rsp+A8h] [rbp-60h] BYREF
float v52; // [rsp+ACh] [rbp-5Ch]
_BYTE v53[8]; // [rsp+B0h] [rbp-58h] BYREF
_BYTE v54[8]; // [rsp+B8h] [rbp-50h] BYREF
_BYTE v55[8]; // [rsp+C0h] [rbp-48h] BYREF
void *Block[2]; // [rsp+C8h] [rbp-40h] BYREF
__int64 v57; // [rsp+D8h] [rbp-30h]
unsigned __int64 v58; // [rsp+E0h] [rbp-28h]
v4 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v4, &v51);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v53, v51 * 0.5, v52 * 0.5);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, v51 * 0.5, (float)(v52 * 0.5) + 42.0);
v57 = 11;
v58 = 15;
Block[0] = (void *)0x44492070756F7247LL;
Block[1] = (void *)3813664;
v5 = a1 + 544;
v6 = a1 + 544;
if ( !a1 )
v6 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -80.0, 80.0);
cocos2d::CCPoint::operator+(v53, v47, v7);
if ( a1 && v6 )
{
v8 = (void **)operator new(0x210u);
v48 = v8;
cocos2d::CCNode::CCNode((cocos2d::CCNode *)v8);
*v8 = &IDNameInput::`vftable';
v8[40] = &IDNameInput::`vftable';
v8[41] = &IDNameInput::`vftable';
v8[42] = &IDNameInput::`vftable';
v8[43] = nullptr;
v8[44] = nullptr;
v8[45] = nullptr;
v8[46] = nullptr;
v8[47] = nullptr;
v8[48] = nullptr;
v8[49] = nullptr;
v8[50] = nullptr;
v8[51] = nullptr;
v8[52] = nullptr;
v8[53] = nullptr;
v8[54] = nullptr;
v8[55] = nullptr;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v8 + 56));
*((_DWORD *)v8 + 114) = 1116471296;
*((_DWORD *)v8 + 115) = 1065353216;
*((_OWORD *)v8 + 29) = 0;
v8[60] = nullptr;
v8[61] = (void *)15;
*((_BYTE *)v8 + 464) = 0;
v8[62] = nullptr;
v8[63] = nullptr;
v8[64] = nullptr;
*((_BYTE *)v8 + 520) = 0;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v8);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v48, (const struct cocos2d::CCPoint *)v47);
IDNameInput::initCore((__int64)v8, a1, v6, 1, 0x33u, (__int64)Block, v9, 0.64999998, 6, 0, a2, 0);
}
if ( v58 > 0xF )
{
v10 = Block[0];
if ( v58 + 1 >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
v57 = 11;
v58 = 15;
Block[0] = (void *)0x44492070756F7247LL;
Block[1] = (void *)3813920;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v48, 80.0, 80.0);
cocos2d::CCPoint::operator+(v53, v47, v11);
if ( !a1 )
v5 = 0;
IDNameInput::create(a1, v5, 1, 71, (__int64)Block, (const struct cocos2d::CCPoint *)v47, 1059481190, 6, 9, a2, 0);
if ( v58 > 0xF )
{
v12 = Block[0];
if ( v58 + 1 >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
v48 = Block;
Block[1] = nullptr;
v57 = 8;
v58 = 15;
Block[0] = (void *)0x3A7261654E6C6F56LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -91.0, -0.0);
cocos2d::CCPoint::operator+(v50, v47, v13);
SetupTriggerPopup::createValueControlAdvanced(
a1,
421,
(unsigned int)Block,
(unsigned int)v47,
1059481190,
0,
1,
6,
0,
0,
1065353216,
a2,
0,
1,
2,
0);
v48 = Block;
Block[1] = nullptr;
v57 = 8;
v58 = 15;
Block[0] = (void *)0x3A747369446E694DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, 91.0, -0.0);
cocos2d::CCPoint::operator+(v50, v47, v14);
SetupTriggerPopup::createValueControlAdvanced(
a1,
424,
(unsigned int)Block,
(unsigned int)v47,
1059481190,
0,
2,
6,
0,
0,
1120403456,
a2,
0,
1,
0,
0);
v48 = Block;
Block[1] = nullptr;
v57 = 7;
v58 = 15;
Block[0] = (void *)0x3A64654D6C6F56LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -91.0, -30.0);
cocos2d::CCPoint::operator+(v50, v47, v15);
SetupTriggerPopup::createValueControlAdvanced(
a1,
422,
(unsigned int)Block,
(unsigned int)v47,
1059481190,
0,
1,
6,
0,
0,
1065353216,
a2,
0,
1,
2,
0);
v48 = Block;
*(_OWORD *)Block = 0;
v57 = 6;
v58 = 15;
strcpy((char *)Block, "Dist2:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, 91.0, -30.0);
cocos2d::CCPoint::operator+(v50, v47, v16);
SetupTriggerPopup::createValueControlAdvanced(
a1,
425,
(unsigned int)Block,
(unsigned int)v47,
1059481190,
0,
2,
6,
0,
0,
1120403456,
a2,
0,
1,
0,
0);
v48 = Block;
Block[1] = nullptr;
v57 = 7;
v58 = 15;
Block[0] = (void *)0x3A7261466C6F56LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -91.0, -60.0);
cocos2d::CCPoint::operator+(v50, v47, v17);
SetupTriggerPopup::createValueControlAdvanced(
a1,
423,
(unsigned int)Block,
(unsigned int)v47,
1059481190,
0,
1,
6,
0,
0,
1065353216,
a2,
0,
1,
2,
0);
v48 = Block;
*(_OWORD *)Block = 0;
v57 = 6;
v58 = 15;
strcpy((char *)Block, "Dist3:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, 91.0, -60.0);
cocos2d::CCPoint::operator+(v50, v47, v18);
SetupTriggerPopup::createValueControlAdvanced(
a1,
426,
(unsigned int)Block,
(unsigned int)v47,
1059481190,
0,
2,
6,
0,
0,
1120403456,
a2,
0,
1,
0,
0);
v48 = Block;
*(_OWORD *)Block = 0;
v57 = 2;
v58 = 15;
strcpy((char *)Block, "P1");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -170.0, -95.0);
cocos2d::CCPoint::operator+(v50, v47, v19);
SetupTriggerPopup::createToggleValueControl(a1, 138, (unsigned int)Block, (unsigned int)v47, 0, a2, 0, 1065353216);
v48 = Block;
*(_OWORD *)Block = 0;
v57 = 2;
v58 = 15;
strcpy((char *)Block, "P2");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -110.0, -95.0);
cocos2d::CCPoint::operator+(v50, v47, v20);
SetupTriggerPopup::createToggleValueControl(a1, 200, (unsigned int)Block, (unsigned int)v47, 0, a2, 0, 1065353216);
v48 = Block;
*(_OWORD *)Block = 0;
v57 = 3;
v58 = 15;
LODWORD(Block[0]) = 7168323;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, -50.0, -95.0);
cocos2d::CCPoint::operator+(v50, v47, v21);
SetupTriggerPopup::createToggleValueControl(a1, 428, (unsigned int)Block, (unsigned int)v47, 0, a2, 0, 1065353216);
v23 = (cocos2d::CCObject *)cocos2d::CCArray::create(v22);
*(_QWORD *)(a1 + 1000) = v23;
cocos2d::CCObject::retain(v23);
v24 = (int)(*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 458);
PageContainer = (cocos2d::CCArray *)SetupTriggerPopup::getPageContainer(a1, a2);
for ( i = 0; i < 7; ++i )
{
*(_OWORD *)Block = 0;
v57 = 0;
v58 = 15;
LOBYTE(Block[0]) = 0;
switch ( i )
{
case 0:
v27 = (char *)sub_14003D460(0x20u);
v57 = 26;
v58 = 31;
strcpy(v27, "edit_areaModeBtn04_001.png");
Block[0] = v27;
break;
case 1:
case 4:
v27 = (char *)sub_14003D460(0x20u);
v57 = 26;
v58 = 31;
strcpy(v27, "edit_areaModeBtn01_001.png");
Block[0] = v27;
break;
case 2:
case 3:
case 5:
case 6:
v27 = (char *)sub_14003D460(0x20u);
v57 = 26;
v58 = 31;
strcpy(v27, "edit_areaModeBtn03_001.png");
Block[0] = v27;
break;
default:
v27 = (char *)Block[0];
break;
}
v28 = Block;
if ( v58 > 0xF )
v28 = (void **)v27;
v29 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v28);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v29 + 352LL))(v29);
v48 = (void **)operator new(0x2C8u);
v30 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v48);
if ( v30 )
{
v32 = "GJ_button_04.png";
if ( v24 == i )
v32 = "GJ_button_02.png";
if ( ButtonSprite::init((__int64 *)v30, (__int64)v29, 32, v31, 32.0, 1065353216, v46, v32, 1, 0) )
{
cocos2d::CCObject::autorelease(v30);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v30 + 8LL))(v30, 1);
v30 = nullptr;
}
}
v49 = operator new(0x208u);
v33 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::CCMenuItemSpriteExtra((__int64)v49);
if ( v33 )
{
if ( CCMenuItemSpriteExtra::init(
(__int64 *)v33,
(__int64 *)v30,
0,
a1,
(__int64)SetupAudioTriggerPopup::onProxMode) )
{
cocos2d::CCObject::autorelease(v33);
goto LABEL_37;
}
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v33 + 8LL))(v33, 1);
}
v33 = nullptr;
LABEL_37:
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v33 + 64LL))(v33, (unsigned int)i);
cocos2d::CCArray::addObject(PageContainer, v33);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 1000), v33);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v29 + 160LL))(v29);
v34 = *(_QWORD *)v29;
v35 = *(float *)((*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v33 + 320LL))(v33) + 4) * 0.5;
v36 = (float *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v33 + 320LL))(v33);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, *v36 * 0.5, v35);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v34 + 184))(v29, v37);
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v33 + 160LL))(v33);
*((_DWORD *)v33 + 101) = 1058642330;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v33);
v38 = *(_QWORD *)v33;
v39 = *(_QWORD *)(a1 + 552);
v40 = -30;
if ( i < 4 )
v40 = 0;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v54,
(float)((float)(i % 4) * 30.000002) + (float)((float)(v51 * 0.5) + 60.0),
(float)v40 + (float)((float)(v52 * 0.5) - 54.0));
cocos2d::CCNode::convertToNodeSpace(v39, v55, v41);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v38 + 184))(v33, v42);
if ( v58 > 0xF )
{
v43 = Block[0];
if ( v58 + 1 >= 0x1000 )
{
v43 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v43 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v43);
}
}
if ( (*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 428) == 0.0 )
v44 = 0;
else
LOBYTE(v44) = 1;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 428, v44);
return SetupAudioTriggerPopup::updateSpecialGroup(a1);
}