//
// SFXBrowser::onImportSetup from 0x14061cf40 to 0x14061d3fe (1214 bytes)
//
// 2 xrefs:
// > SFXBrowser::init @ 0x140618078
// > ??> @ 0x1409302c0
//
// 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:21 +0000
//
// Hidden C++ exception states: #wind=10
__int64 __fastcall SFXBrowser::onImportSetup(__int64 a1)
{
__int64 v2; // rdx
__int64 result; // rax
__int128 v4; // xmm0
char *v5; // r14
void *v6; // rcx
char *v7; // r12
__int64 v8; // rcx
__int64 v9; // rax
_QWORD *v10; // rax
char *v11; // rsi
__int64 v12; // rdi
__int64 v13; // rbx
__int64 v14; // rax
__int64 v15; // rax
__int128 *v16; // [rsp+50h] [rbp-B0h] BYREF
_DWORD *v17; // [rsp+58h] [rbp-A8h] BYREF
__int128 *v18; // [rsp+60h] [rbp-A0h] BYREF
_DWORD v19[4]; // [rsp+68h] [rbp-98h] BYREF
__int64 v20; // [rsp+78h] [rbp-88h]
__int64 v21; // [rsp+80h] [rbp-80h]
__int128 v22; // [rsp+88h] [rbp-78h] BYREF
__int64 v23; // [rsp+98h] [rbp-68h]
__int64 v24; // [rsp+A0h] [rbp-60h]
__int128 v25; // [rsp+A8h] [rbp-58h] BYREF
__int64 v26; // [rsp+B8h] [rbp-48h]
__int64 v27; // [rsp+C0h] [rbp-40h]
__int128 v28; // [rsp+C8h] [rbp-38h]
__int64 v29; // [rsp+D8h] [rbp-28h]
__int64 v30; // [rsp+E0h] [rbp-20h]
__int128 v31; // [rsp+E8h] [rbp-18h] BYREF
__int64 v32; // [rsp+F8h] [rbp-8h]
__int64 v33; // [rsp+100h] [rbp+0h]
__int128 *v34; // [rsp+108h] [rbp+8h]
_BYTE v35[32]; // [rsp+110h] [rbp+10h] BYREF
void *Block[2]; // [rsp+130h] [rbp+30h] BYREF
__int64 v37; // [rsp+140h] [rbp+40h]
unsigned __int64 v38; // [rsp+148h] [rbp+48h]
__int128 v39; // [rsp+150h] [rbp+50h]
__int64 v40; // [rsp+160h] [rbp+60h]
__int64 v41; // [rsp+168h] [rbp+68h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v16 = (__int128 *)operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
result = *(_QWORD *)(v2 + 568);
if ( result && *(_QWORD *)(result + 3528) )
{
*(_DWORD *)(a1 + 1036) = 0;
*(_BYTE *)(a1 + 952) = 1;
v16 = &v22;
v34 = &v25;
v17 = v19;
v4 = 0;
v22 = 0;
v23 = 6;
v24 = 15;
strcpy((char *)&v22, "Import");
v26 = 10;
v27 = 15;
*(_QWORD *)&v4 = 0x532074726F706D49LL;
v25 = v4;
WORD4(v25) = 22598;
BYTE10(v25) = 0;
v19[3] = 0;
v20 = 11;
v21 = 15;
strcpy((char *)v19, "Folder Name");
sub_14003F4F0((__int64)v35, *(_QWORD *)(*(_QWORD *)(v2 + 568) + 2168LL) + 344LL);
v5 = SetTextPopup::create((__int64)v35, (__int64)v19, 30, (__int64)&v25, (__int64)&v22, 0, 0, 1, 1, 0);
*(_OWORD *)Block = 0;
v37 = 0;
v38 = 0;
Block[0] = sub_14003D460(0x20u);
v37 = 18;
v38 = 31;
strcpy((char *)Block[0], "Custom folder name");
SetTextPopup::addInfoLabel((__int64)v5, (const char *)Block);
if ( v38 > 0xF )
{
v6 = Block[0];
if ( v38 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
v39 = 0;
v7 = (char *)sub_14003D460(0x60u);
*(_QWORD *)&v39 = v7;
v40 = 90;
v41 = 95;
strcpy(v7, "Copies this level's SFX folders and names into a new folder. Existing entries are skipped.");
*((_QWORD *)&v28 + 1) = 22598;
v29 = 10;
v30 = 15;
*(_QWORD *)&v28 = 0x532074726F706D49LL;
v9 = cocos2d::CCDirector::sharedDirector(v8);
cocos2d::CCDirector::getWinSize(v9, &v16);
v18 = &v31;
v31 = 0;
v32 = 0;
v33 = 0;
v10 = sub_14003D460(0x60u);
*(_QWORD *)&v31 = v10;
v32 = 90;
v33 = 95;
*(_OWORD *)v10 = *(_OWORD *)v7;
*((_OWORD *)v10 + 1) = *((_OWORD *)v7 + 1);
*((_OWORD *)v10 + 2) = *((_OWORD *)v7 + 2);
*((_OWORD *)v10 + 3) = *((_OWORD *)v7 + 3);
*((_OWORD *)v10 + 4) = *((_OWORD *)v7 + 4);
v10[10] = *((_QWORD *)v7 + 10);
*((_WORD *)v10 + 44) = *((_WORD *)v7 + 44);
*((_BYTE *)v10 + 90) = v7[90];
v37 = 10;
v38 = 15;
*(_OWORD *)Block = v28;
v11 = InfoAlertButton::create((__int64)Block, (__int64)&v31);
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)v5 + 69) + 464LL))(*((_QWORD *)v5 + 69), v11);
v12 = *(_QWORD *)v11;
v13 = *((_QWORD *)v5 + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v18,
(float)((float)(*(float *)&v16 * 0.5) + 150.0) - 18.0,
(float)((float)((float)(*((float *)v5 + 172) * 0.5) + (float)(*((float *)&v16 + 1) * 0.5)) - 18.0)
+ *((float *)v5 + 171));
cocos2d::CCNode::convertToNodeSpace(v13, &v17, v14);
(*(void (__fastcall **)(char *, __int64))(v12 + 184))(v11, v15);
j_j_free(v7);
*((_QWORD *)v5 + 94) = a1 + 688;
return (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v5 + 1064LL))(v5);
}
return result;
}