//
// SearchSFXPopup::init from 0x100440ed0 to 0x100441135 (613 bytes)
//
// 1 xrefs:
// > SearchSFXPopup::create @ 0x100440b15
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall SearchSFXPopup::init(__int64 a1, std::string *a2, double a3)
{
unsigned int v3; // r14d
GameManager *v4; // rax
bool GameVariable; // r12
__int64 v6; // r15
float v8; // [rsp+40h] [rbp-D0h] BYREF
float v9; // [rsp+48h] [rbp-C8h] BYREF
__int64 v10; // [rsp+50h] [rbp-C0h]
char v11; // [rsp+58h] [rbp-B8h] BYREF
_BYTE v12[23]; // [rsp+59h] [rbp-B7h] BYREF
std::string v13; // [rsp+70h] [rbp-A0h] BYREF
float v14[4]; // [rsp+90h] [rbp-80h] BYREF
char v15; // [rsp+A0h] [rbp-70h] BYREF
char v16[15]; // [rsp+A1h] [rbp-6Fh] BYREF
void *v17; // [rsp+B0h] [rbp-60h]
char v18; // [rsp+B8h] [rbp-58h] BYREF
char v19[15]; // [rsp+B9h] [rbp-57h] BYREF
void *__p; // [rsp+C8h] [rbp-48h]
char v21; // [rsp+D0h] [rbp-40h] BYREF
void *v22[7]; // [rsp+D1h] [rbp-3Fh] BYREF
if ( (*(_BYTE *)&a2->__r_.__value_.__s.0 & 1) != 0 )
sub_100006B70(&v13, a2->__r_.__value_.__l.__data_, a2->__r_.__value_.__l.__size_, a3);
else
v13 = *a2;
v15 = 12;
strcpy(v16, "Search");
v11 = 16;
strcpy(v12, "Find SFX");
v18 = 4;
strcpy(v19, "OK");
v3 = SetTextPopup::init(a1, &v13, (__int64)&v15, 20, (__int64)&v11, (__int64)&v18, 60.0, 1);
if ( (v18 & 1) != 0 )
{
operator delete(__p);
if ( (v11 & 1) == 0 )
{
LABEL_6:
if ( (v15 & 1) == 0 )
goto LABEL_7;
goto LABEL_12;
}
}
else if ( (v11 & 1) == 0 )
{
goto LABEL_6;
}
operator delete(*(void **)&v12[15]);
if ( (v15 & 1) == 0 )
{
LABEL_7:
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_8;
LABEL_13:
operator delete(v13.__r_.__value_.__l.__data_);
if ( !(_BYTE)v3 )
return v3;
goto LABEL_14;
}
LABEL_12:
operator delete(v17);
if ( (*(_BYTE *)&v13.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_13;
LABEL_8:
if ( !(_BYTE)v3 )
return v3;
LABEL_14:
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v14);
v21 = 22;
strcpy((char *)v22, "Folder\nName");
v4 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v4, "0147");
v10 = *(_QWORD *)(a1 + 544);
sub_10028CBE0(&v9, (float)(v14[0] * 0.5) + -124.0, (float)(0.5 * v14[1]) + 10.0);
v6 = *(_QWORD *)(a1 + 576);
sub_10028CBE0(&v8, 8.0, 0.0);
GameToolbox::createToggleButton(
(unsigned int)&v21,
(unsigned int)SearchSFXPopup::onSearchFolders,
0,
GameVariable,
v10,
(unsigned int)&v9,
a1,
v6,
(__int64)&v8,
(__int64)"bigFont.fnt",
0,
0,
0);
if ( (v21 & 1) != 0 )
operator delete(*(void **)((char *)&v22[1] + 7));
return v3;
}