//
// SetupAudioLineGuidePopup::init from 0x140606940 to 0x140607071 (1841 bytes)
//
// 2 xrefs:
// > EditorUI::editObject @ 0x1401bbd35
// > ??> @ 0x14092f9a8
//
// 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:35:12 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupAudioLineGuidePopup::init(__int64 a1, int a2, int a3, int a4)
{
int v5; // ebx
char result; // al
__int64 v7; // rcx
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
int v12; // eax
struct cocos2d::CCLabelBMFont *v13; // r14
int v14; // ecx
int v15; // ecx
int v16; // ecx
int v17; // ecx
const char *v18; // rcx
cocos2d::CCObject *v19; // rdi
__int64 v20; // rax
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // [rsp+80h] [rbp-88h]
__int64 v26; // [rsp+80h] [rbp-88h]
__int128 *v27; // [rsp+88h] [rbp-80h] BYREF
__int128 v28; // [rsp+90h] [rbp-78h] BYREF
__int64 v29; // [rsp+A0h] [rbp-68h]
__int64 v30; // [rsp+A8h] [rbp-60h]
float v31; // [rsp+B0h] [rbp-58h] BYREF
float v32; // [rsp+B4h] [rbp-54h]
__int128 *v33; // [rsp+B8h] [rbp-50h] BYREF
__int128 *v34; // [rsp+C0h] [rbp-48h] BYREF
char v35[8]; // [rsp+C8h] [rbp-40h] BYREF
char v36[8]; // [rsp+D0h] [rbp-38h] BYREF
__int128 v37; // [rsp+D8h] [rbp-30h] BYREF
__int64 v38; // [rsp+E8h] [rbp-20h]
unsigned __int64 v39; // [rsp+F0h] [rbp-18h]
v5 = 1;
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1132068864, 1, 0);
if ( result )
{
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
*(_BYTE *)(a1 + 888) = 1;
*((_QWORD *)&v28 + 1) = 101;
v29 = 9;
v30 = 15;
*(_QWORD *)&v28 = 0x64697547204D5042LL;
SetupTriggerPopup::addTitle(a1, &v28);
v28 = 0;
v29 = 2;
v30 = 15;
strcpy((char *)&v28, "OK");
SetupTriggerPopup::addCloseButton(a1, &v28);
v27 = &v28;
v28 = 0;
v29 = 0;
v30 = 0;
*(_QWORD *)&v28 = sub_14003D460(0xD0u);
v29 = 195;
v30 = 207;
strcpy(
(char *)v28,
"Creates lines in the editor to help synchronize to music.\n"
"BPM is beats per minute. The position is based on speed.\n"
"BPB is beats per bar. This adds more lines to each beat.");
v37 = 0;
v38 = 4;
v39 = 15;
strcpy((char *)&v37, "Help");
SetupTriggerPopup::addHelpButton(a1, &v37, &v28);
v8 = cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8, &v31);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, v31 * 0.5, v32 * 0.5);
v33 = &v28;
v28 = 0;
v29 = 3;
v30 = 15;
LOWORD(v28) = *(_WORD *)"BPM";
WORD1(v28) = (unsigned __int8)aBpm[2];
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, -80.0, 60.0);
cocos2d::CCPoint::operator+(v35, &v27, v9);
SetupTriggerPopup::createValueControlAdvanced(
a1,
498,
(unsigned int)&v28,
(unsigned int)&v27,
1061997773,
0,
3,
10,
0,
1065353216,
1128792064,
0,
0,
0,
0,
0,
v27);
v34 = &v28;
v28 = 0;
v29 = 3;
v30 = 15;
LODWORD(v28) = 4345922;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33, 80.0, 60.0);
cocos2d::CCPoint::operator+(v35, &v27, v10);
LOBYTE(v25) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
501,
(unsigned int)&v28,
(unsigned int)&v27,
1061997773,
0,
3,
10,
0,
1065353216,
1092616192,
0,
0,
0,
0,
v25);
v34 = &v37;
v38 = 8;
v39 = 15;
v37 = 0x6E6F697461727544uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v33, 0.0, -10.0);
cocos2d::CCPoint::operator+(v35, &v27, v11);
LOBYTE(v26) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
10,
(unsigned int)&v37,
(unsigned int)&v27,
1061997773,
0,
3,
10,
0,
1065353216,
1123024896,
0,
0,
0,
0,
v26);
v34 = &v28;
HIWORD(v28) = 0;
v29 = 7;
v30 = 15;
qmemcpy(&v28, "Disabl", 6);
*(_QWORD *)((char *)&v28 + 6) = (unsigned __int8)aDisable[6];
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v33,
(float)((float)(*(float *)(a1 + 732) * 0.5) + (float)(v31 * 0.5)) - 35.0,
(float)((float)(v32 * 0.5) - (float)(*(float *)(a1 + 736) * 0.5)) + 25.0);
SetupTriggerPopup::createToggleValueControl(a1, 500, (unsigned int)&v28, v12, 1, 0, 0, 1065353216);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v36,
(float)((float)(v31 * 0.5) - (float)(*(float *)(a1 + 732) * 0.5)) + 40.0,
(float)((float)(v32 * 0.5) - (float)(*(float *)(a1 + 736) * 0.5)) + 70.0);
v13 = cocos2d::CCLabelBMFont::create((const char *)&dword_1407751A8, "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v13 + 160LL))(v13);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v13);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, char *))(*(_QWORD *)v13 + 184LL))(v13, v36);
v14 = (int)(*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 499);
if ( v14 )
{
v15 = v14 - 1;
if ( v15 )
{
v16 = v15 - 1;
if ( v16 )
{
v17 = v16 - 1;
if ( v17 )
{
if ( v17 == 1 )
v5 = 4;
}
else
{
v5 = 3;
}
}
else
{
v5 = 2;
}
}
else
{
v5 = 0;
}
}
SelectSettingLayer::frameForItem((__int64)&v37, 2u, v5);
v18 = (const char *)&v37;
if ( v39 > 0xF )
v18 = (const char *)v37;
*(_QWORD *)(a1 + 1008) = cocos2d::CCSprite::createWithSpriteFrameName(v18);
sub_14003D310((__int64)&v37);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1008) + 160LL))(*(_QWORD *)(a1 + 1008));
v19 = CCMenuItemSpriteExtra::create(*(_QWORD *)(a1 + 1008), 0, a1, (__int64)SetupAudioLineGuidePopup::onSpeed);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v34, 0.0, -34.0);
v21 = v20;
v22 = (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v13 + 200LL))(v13);
cocos2d::CCPoint::operator+(v22, &v27, v21);
v23 = *(_QWORD *)v19;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v33, &v27);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v23 + 184))(v19, v24);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}