//
// SFXFolderPickerPopup::onPickFolder from 0xc3d710 to 0xc3d93c (556 bytes)
//
// 3 xrefs:
// > ??> @ 0x572c8
// > SFXFolderPickerPopup::rebuildList @ 0xc3c190
// > ??> @ 0x1541fa8
//
// 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:04:55 +0000
//
__int64 __fastcall SFXFolderPickerPopup::onPickFolder(SFXFolderPickerPopup *this, cocos2d::CCObject *a2)
{
int v3; // w19
char *v4; // x20
__int64 *v5; // x23
__int64 v6; // x0
_QWORD *v7; // x0
__int64 v9; // x0
int v10; // w0
__int64 v11; // x0
__int64 v12; // x1
__int64 *v13; // x1
char *v15; // [xsp+50h] [xbp+50h]
if ( !a2 )
return _stack_chk_guard;
v3 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
if ( v3 <= 0 )
return _stack_chk_guard;
cocos2d::CCObject::retain(a2);
cocos2d::CCObject::autorelease(a2);
if ( *((_DWORD *)this + 168) != 2 )
{
*((_DWORD *)this + 182) = v3;
return SFXFolderPickerPopup::refreshList(this);
}
if ( v3 != 1 )
{
v4 = *((char **)this + 89);
if ( v4 )
{
v5 = (__int64 *)((char *)this + 712);
v6 = *((_QWORD *)this + 89);
do
{
while ( v3 <= *(_DWORD *)(v6 + 28) )
{
v5 = (__int64 *)v6;
v6 = *(_QWORD *)v6;
if ( !v6 )
goto LABEL_9;
}
v6 = *(_QWORD *)(v6 + 8);
}
while ( v6 );
LABEL_9:
if ( (__int64 *)((char *)this + 712) == v5 || v3 < *((_DWORD *)v5 + 7) )
{
while ( 1 )
{
v10 = *((_DWORD *)v4 + 7);
if ( v3 >= v10 )
{
if ( v3 <= v10 )
return SFXFolderPickerPopup::refreshList(this);
v9 = *((_QWORD *)v4 + 1);
if ( !v9 )
{
v15 = v4;
v4 += 8;
goto LABEL_23;
}
}
else
{
v9 = *(_QWORD *)v4;
if ( !*(_QWORD *)v4 )
{
v15 = v4;
goto LABEL_23;
}
}
v4 = (char *)v9;
}
}
v7 = std::__tree_next *>(v5);
if ( *((__int64 **)this + 88) == v5 )
*((_QWORD *)this + 88) = v7;
--*((_QWORD *)this + 90);
std::__tree_remove *>((__int64 *)v4, v5);
operator delete(v5);
}
else
{
v15 = (char *)this + 712;
v4 = (char *)this + 712;
LABEL_23:
v11 = operator new(0x20u);
*(_DWORD *)(v11 + 28) = v3;
*(_QWORD *)v11 = 0;
*(_QWORD *)(v11 + 8) = 0;
*(_QWORD *)(v11 + 16) = v15;
*(_QWORD *)v4 = v11;
v12 = **((_QWORD **)this + 88);
if ( v12 )
{
*((_QWORD *)this + 88) = v12;
v13 = *(__int64 **)v4;
}
else
{
v13 = (__int64 *)v11;
}
std::__tree_balance_after_insert *>(*((__int64 **)this + 89), v13);
++*((_QWORD *)this + 90);
}
return SFXFolderPickerPopup::refreshList(this);
}
return SFXFolderPickerPopup::onSelectAll(this, nullptr);
}