//
// sub_10051078C from 0x10051078c to 0x100510874 (232 bytes)
//
// 1 xrefs:
// > InvitesPopup::threadUpdateFinished @ 0x1005108c8
//
// 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 11:07:02 +0000
//
__int64 __fastcall sub_10051078C(__int64 a1, int a2)
{
__int64 result; // x0
__int64 v5; // x21
signed int v6; // w20
int v7; // w21
result = *(_QWORD *)(a1 + 792);
if ( result )
{
if ( (int)sub_1002E757C(result) >= 1 )
{
v5 = 0;
while ( *(_DWORD *)(sub_1002E75A0(*(_QWORD *)(a1 + 792), v5) + 56) != a2 )
{
v5 = (unsigned int)(v5 + 1);
if ( (int)v5 >= (int)sub_1002E757C(*(_QWORD *)(a1 + 792)) )
goto LABEL_9;
}
sub_1002E7664(*(_QWORD *)(a1 + 792), v5, 1);
}
LABEL_9:
if ( (int)sub_1002E757C(*(_QWORD *)(a1 + 792)) < 1 )
{
v7 = 0;
}
else
{
v6 = 0;
v7 = 0;
do
v7 += *(unsigned __int8 *)(sub_1002E75A0(*(_QWORD *)(a1 + 792), v6++) + 273) ^ 1;
while ( v6 < (int)sub_1002E757C(*(_QWORD *)(a1 + 792)) );
}
*(_DWORD *)(GameLevelManager::sharedState() + 476) = v7;
return InvitesPopup::buildRows(a1);
}
return result;
}