//
// DeathTrackerPopup::dtScrollKey from 0x772188 to 0x772280 (248 bytes)
//
// 3 xrefs:
// > DeathTrackerPopup::onClose @ 0x77233a
// > DeathTrackerPopup::refreshView @ 0x77500a
// > DeathTrackerPopup::onToggleGlobal @ 0x7754bc
//
// 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
//
DeathTrackerPopup *__fastcall DeathTrackerPopup::dtScrollKey(DeathTrackerPopup *this, int a2)
{
int v3; // r4
int v4; // r1
unsigned int v5; // r1
size_t v6; // r3
size_t v7; // r9
char *v8; // r5
char *v9; // r4
unsigned int v10; // r0
size_t v11; // r1
void *v12; // r2
unsigned int v14; // [sp+10h] [bp-14h] BYREF
size_t v15; // [sp+14h] [bp-10h]
void *v16; // [sp+18h] [bp-Ch]
v3 = *(_DWORD *)(a2 + 528);
if ( v3 )
v4 = *(_DWORD *)(v3 + 268) - *(_DWORD *)(v3 + 272);
else
v4 = 0;
GameToolbox::intToString((GameToolbox *)&v14, v4);
v6 = (unsigned __int8)v14;
if ( (v14 & 1) != 0 )
v5 = v14;
else
v6 = (int)(unsigned __int8)v14 >> 1;
if ( (v14 & 1) != 0 )
v6 = v15;
else
v5 = 10;
v7 = v6 + 7;
if ( (v14 & 1) != 0 )
v5 = (v5 & 0xFFFFFFFE) - 1;
if ( v5 - v6 <= 6 )
{
std::string::__grow_by_and_replace((int)&v14, v5, v7 - v5, v6, 0, 0, 7u, "dtdist_");
}
else
{
if ( (v14 & 1) != 0 )
v8 = (char *)v16;
else
v8 = (char *)&v14 + 1;
if ( v6 )
{
v9 = "dtdist_";
if ( v8 <= "dtdist_" && &v8[v6] > "dtdist_" )
v9 = "";
memmove(v8 + 7, v8, v6);
}
else
{
v9 = "dtdist_";
}
*(_DWORD *)v8 = *(_DWORD *)v9;
*((_WORD *)v8 + 2) = *((_WORD *)v9 + 2);
v8[6] = v9[6];
if ( (v14 & 1) != 0 )
v15 = v7;
else
LOBYTE(v14) = 2 * v7;
v8[v7] = 0;
}
v10 = v14;
v11 = v15;
v12 = v16;
v14 = 0;
v15 = 0;
v16 = nullptr;
*(_DWORD *)this = v10;
*((_DWORD *)this + 1) = v11;
*((_DWORD *)this + 2) = v12;
std::string::~string((int)&v14);
return this;
}