//
// SFXBrowser::onToggleSearch from 0xb92b40 to 0xb92de8 (680 bytes)
//
// 3 xrefs:
// > ??> @ 0x91d98
// > sub_B947C8 @ 0xb956ec
// > ??> @ 0x1543e78
//
// This function is hookable on this platform (idp: arm, 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 13:02:39 +0000
//
__int64 __fastcall SFXBrowser::onToggleSearch(SFXBrowser *this, cocos2d::CCObject *a2)
{
__int64 v3; // x1
cocos2d::CCSpriteFrameCache **v4; // x20
void (__fastcall *v5)(cocos2d::CCSpriteFrameCache **, __int64); // x21
cocos2d::CCSpriteFrameCache *v6; // x0
const char *v7; // x1
__int64 v8; // x0
__int64 v9; // x0
unsigned int *v10; // x0
__int64 *v11; // x20
__int64 *v12; // x21
__int64 v13; // x0
_QWORD *v14; // x21
const char *v15; // x1
size_t v16; // x0
__int64 v18; // x0
_QWORD *v19; // x23
char *v20; // [xsp+48h] [xbp+48h]
__int64 v21; // [xsp+50h] [xbp+50h] BYREF
__int64 v22; // [xsp+58h] [xbp+58h]
void *v23; // [xsp+60h] [xbp+60h]
if ( *((_QWORD *)this + 89) )
{
v3 = *((_QWORD *)this + 104);
*((_BYTE *)this + 872) ^= 1u;
v4 = (cocos2d::CCSpriteFrameCache **)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 1072LL))(v3);
v5 = *((void (__fastcall **)(cocos2d::CCSpriteFrameCache **, __int64))*v4 + 145);
v6 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(*v4);
if ( *((_BYTE *)this + 872) )
v7 = "gj_findBtnOff_001.png";
else
v7 = "gj_findBtn_001.png";
v8 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v6, v7);
v5(v4, v8);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 106) + 344LL))(
*((_QWORD *)this + 106),
*((unsigned __int8 *)this + 872));
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 105) + 344LL))(
*((_QWORD *)this + 105),
*((unsigned __int8 *)this + 872));
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 105) + 1000LL))(
*((_QWORD *)this + 105),
*((unsigned __int8 *)this + 872));
v9 = *((_QWORD *)this + 108);
if ( v9 )
{
v10 = *(unsigned int **)(v9 + 56);
if ( *v10 )
{
v11 = *((__int64 **)v10 + 2);
v12 = &v11[*v10 - 1];
if ( v11 <= v12 )
{
while ( 1 )
{
v18 = *v11;
if ( !*v11 )
break;
++v11;
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v18 + 344LL))(v18, *((unsigned __int8 *)this + 872));
if ( v12 < v11 )
{
if ( *((_BYTE *)this + 872) )
goto LABEL_8;
goto LABEL_17;
}
}
}
}
}
if ( *((_BYTE *)this + 872) )
{
LABEL_8:
v13 = *((_QWORD *)this + 89);
v14 = *((_QWORD **)this + 105);
v15 = (const char *)(v13 + 105);
if ( (*(_BYTE *)(v13 + 104) & 1) != 0 )
v15 = *(const char **)(v13 + 120);
v20 = (char *)v15;
v21 = 0;
v22 = 0;
v23 = nullptr;
v16 = strlen(v15);
std::string::__init(&v21, v20, v16);
CCTextInputNode::setString(v14, (char *)&v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 105) + 1160LL))(*((_QWORD *)this + 105), 1);
SFXBrowser::setupList(this, *((cocos2d::CCArray ***)this + 89));
}
else
{
LABEL_17:
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 105) + 1160LL))(*((_QWORD *)this + 105), 0);
v19 = *((_QWORD **)this + 105);
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(&v21, &byte_11B8890, 0);
CCTextInputNode::setString(v19, (char *)&v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
std::string::assign((__int64 *)(*((_QWORD *)this + 89) + 104LL), &byte_11B8890);
*(_DWORD *)(*((_QWORD *)this + 89) + 96LL) = 0;
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 89) + 80LL))(
*((_QWORD *)this + 89),
*((unsigned int *)this + 278));
SFXBrowser::setupList(this, *((cocos2d::CCArray ***)this + 89));
}
}
return _stack_chk_guard;
}