//
// DeathTrackerPopup::countsForScope from 0x771a4c to 0x771c26 (474 bytes)
//
// 1 xrefs:
// > DeathTrackerPopup::refreshView @ 0x77471a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:16 +0000
//
int __fastcall DeathTrackerPopup::countsForScope(int a1, void **a2, int a3, int a4)
{
int result; // r0
int v7; // r5
_BOOL4 v8; // r1
_BOOL4 v9; // r5
int v10; // r2
unsigned int v11; // r1
char *v12; // r3
unsigned int v13; // lr
int v14; // r0
int v15; // r2
unsigned int v16; // r1
char *v17; // r3
unsigned int v18; // r0
int v19; // lr
int v20; // r6
unsigned int i; // r3
unsigned int v22; // r2
int j; // r5
unsigned int v24; // r3
char *v25; // [sp+0h] [bp-10h] BYREF
void **v26; // [sp+4h] [bp-Ch]
int v27; // [sp+8h] [bp-8h]
int v28; // [sp+Ch] [bp-4h]
v26 = a2;
v27 = a3;
v28 = a4;
v25 = nullptr;
std::vector::assign(a2, 0x65u, (int *)&v25);
result = *(_DWORD *)(a1 + 528);
if ( result )
{
v7 = *(_DWORD *)(a1 + 572);
if ( v7 )
v8 = v7 == 2;
else
v8 = 1;
v9 = (unsigned int)(v7 - 1) <= 1;
if ( *(_BYTE *)(a1 + 564) )
{
if ( v8 )
{
v25 = nullptr;
v26 = nullptr;
v27 = 0;
GJGameLevel::dtExpandOrder((unsigned __int8 *)(result + 1192), (int)&v25);
v10 = 0;
v11 = 0;
while ( 1 )
{
v12 = v25;
v11 += 2;
if ( v11 > ((char *)v26 - v25) >> 2 )
break;
v13 = *(_DWORD *)&v25[v10];
if ( v13 <= 0x63 )
v12 = &v25[v10];
v10 += 8;
if ( v13 <= 0x63 )
*((_DWORD *)*a2 + v13) += *((_DWORD *)v12 + 1);
}
*((_DWORD *)*a2 + 100) += *(_DWORD *)(*(_DWORD *)(a1 + 528) + 1256);
result = (int)std::__vector_base::~__vector_base(&v25);
}
if ( v9 )
{
v14 = *(_DWORD *)(a1 + 528);
v25 = nullptr;
v26 = nullptr;
v27 = 0;
GJGameLevel::dtExpandOrder((unsigned __int8 *)(v14 + 1204), (int)&v25);
v15 = 4;
v16 = 0;
while ( 1 )
{
v17 = v25;
v16 += 3;
if ( v16 > ((char *)v26 - v25) >> 2 )
break;
v18 = *(_DWORD *)&v25[v15];
if ( v18 <= 0x63 )
v17 = &v25[v15];
v15 += 12;
if ( v18 <= 0x63 )
*((_DWORD *)*a2 + v18) += *((_DWORD *)v17 + 1);
}
return (int)std::__vector_base::~__vector_base(&v25);
}
}
else
{
result = *(_DWORD *)(a1 + 568);
if ( result >= 0 )
{
v19 = *(_DWORD *)(a1 + 580);
if ( result < 954437177 * ((*(_DWORD *)(a1 + 584) - v19) >> 2) )
{
v20 = v19 + 36 * result;
if ( v8 )
{
v25 = nullptr;
v26 = nullptr;
v27 = 0;
GJGameLevel::dtExpandOrder((unsigned __int8 *)(v20 + 4), (int)&v25);
for ( i = 0; i < ((char *)v26 - v25) >> 2; ++i )
{
v22 = *(_DWORD *)&v25[4 * i];
if ( v22 <= 0x64 )
++*((_DWORD *)*a2 + v22);
}
result = (int)std::__vector_base::~__vector_base(&v25);
}
if ( v9 )
{
v25 = nullptr;
v26 = nullptr;
v27 = 0;
GJGameLevel::dtExpandOrder((unsigned __int8 *)(v20 + 16), (int)&v25);
for ( j = 0; j + 2 <= (unsigned int)(((char *)v26 - v25) >> 2); j += 2 )
{
v24 = *(_DWORD *)&v25[4 * j + 4];
if ( v24 <= 0x63 )
++*((_DWORD *)*a2 + v24);
}
return (int)std::__vector_base::~__vector_base(&v25);
}
}
}
}
}
return result;
}