//
// AccountReviewPopup::applySelected from 0xc4f2bc to 0xc4f3dc (288 bytes)
//
// 8 xrefs:
// > AccountReviewPopup::onSelectAll @ 0xc4f450
// > AccountReviewPopup::onToggleRow @ 0xc4f55c
// > AccountReviewPopup::onToggleRow @ 0xc4f578
// > AccountReviewPopup::onToggleRow @ 0xc4f594
// > AccountReviewPopup::FLAlert_Clicked @ 0xc4f7f0
// > AccountReviewPopup::FLAlert_Clicked @ 0xc4f8b0
// > AccountReviewPopup::FLAlert_Clicked @ 0xc4f968
// > ??> @ 0xf57d0
//
// 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:05:07 +0000
//
__int64 __fastcall AccountReviewPopup::applySelected(__int64 this, int a2, unsigned __int8 a3)
{
int v3; // w21
__int64 v4; // x3
unsigned __int8 *v5; // x4
_QWORD *v6; // x19
__int64 *v7; // x22
__int64 *v8; // x0
__int64 *v9; // x20
__int64 *v10; // x2
_QWORD *v11; // x0
int v12; // [xsp+3Ch] [xbp+3Ch] BYREF
v12 = a2;
v3 = a3;
if ( (a2 & 0x80000000) == 0 )
{
v4 = *(_QWORD *)(this + 1320);
if ( a2 < (int)((*(_QWORD *)(this + 1328) - v4) >> 3) )
{
v5 = *(unsigned __int8 **)(v4 + 8LL * a2);
if ( v5 )
{
v6 = (_QWORD *)this;
if ( a3 )
{
std::__tree::__emplace_unique_key_args((__int64 **)(this + 1344), &v12, &v12);
v5 = *(unsigned __int8 **)(v6[165] + 8LL * v12);
}
else
{
v7 = *(__int64 **)(this + 1352);
v8 = (__int64 *)(this + 1352);
if ( v7 )
{
v9 = v6 + 169;
v10 = (__int64 *)v6[169];
do
{
while ( a2 <= *((_DWORD *)v10 + 7) )
{
v9 = v10;
v10 = (__int64 *)*v10;
if ( !v10 )
goto LABEL_13;
}
v10 = (__int64 *)v10[1];
}
while ( v10 );
LABEL_13:
if ( v8 != v9 && a2 >= *((_DWORD *)v9 + 7) )
{
v11 = std::__tree_next *>(v9);
if ( (__int64 *)v6[168] == v9 )
v6[168] = v11;
--v6[170];
std::__tree_remove *>(v7, v9);
operator delete(v9);
v5 = *(unsigned __int8 **)(v6[165] + 8LL * v12);
}
}
}
this = v5[392];
if ( (_DWORD)this != v3 )
return CCMenuItemToggler::toggle((CCMenuItemToggler *)v5, v3);
}
}
}
return this;
}