//
// FRequestProfilePage::onToggleAllObjects from 0x14013e570 to 0x14013e64e (222 bytes)
//
// 2 xrefs:
// > FRequestProfilePage::init @ 0x14013e0d8
// > ??> @ 0x1406ca1b8
//
// 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
//
// Hidden C++ exception states: #wind=1
void FRequestProfilePage::onToggleAllObjects(FRequestProfilePage *a1, cocos2d::CCObject *a2)
{
std::string *p_m_key; // rdi
GameLevelManager *v4; // rcx
cocos2d::CCArray *StoredOnlineLevels; // rax
cocos2d::CCArray *v6; // rdi
cocos2d::ccArray *data; // rax
__int64 num; // rcx
cocos2d::CCObject **arr; // rax
unsigned __int64 i; // r8
void *v11; // [rsp+30h] [rbp+8h]
a1->m_toggledAll = !a1->m_toggledAll;
p_m_key = &a1->m_key;
if ( a1->m_key.m_data.m_capacity > 0xF )
p_m_key = (std::string *)p_m_key->m_data.m_bigStorage;
v4 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v11 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280(v11);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v4 = (GameLevelManager *)qword_1406C2EC0;
}
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v4, p_m_key->m_data.m_smallStorage._Elems);
v6 = StoredOnlineLevels;
if ( StoredOnlineLevels && cocos2d::CCArray::count(StoredOnlineLevels) )
{
data = v6->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = (unsigned __int64)&arr[num - 1]; (unsigned __int64)arr <= i; ++arr )
{
if ( !*arr )
break;
BYTE1((*arr)[13].m_uIndexInArray) = a1->m_toggledAll;
}
}
CustomListView::reloadAll((CustomListView *)a1->m_listLayer->m_list);
}
}