//
// DeathHistogram::setData from 0x767a8c to 0x767de2 (854 bytes)
//
// 1 xrefs:
// > DeathTrackerPopup::refreshView @ 0x774fe2
//
// 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:08 +0000
//
char **__fastcall DeathHistogram::setData(int a1, int **a2, int a3, int a4, char a5, char a6)
{
float v6; // s12
int v11; // r3
cocos2d::CCNode *v12; // r6
int *v13; // r2
int v14; // r9
int v15; // r1
int v16; // t1
float v17; // s17
char *v18; // r1
int v19; // r4
const char *v20; // r8
GameManager *v21; // r0
ScrollableContentLayer *v22; // r0
float v23; // r1
float v24; // s15
GameManager *v25; // r0
int *v26; // lr
int v27; // r2
int v28; // r6
float v29; // r1
int v30; // r4
int v31; // r0
int v32; // r3
int v33; // r7
int v34; // r7
float v36; // s16
int v37; // r0
cocos2d::CCString *v38; // r0
cocos2d::CCLabelBMFont *CString; // r0
const char *v40; // r2
int v41; // r8
void (__fastcall *v42)(int, float *); // r3
float v43; // [sp+Ch] [bp-40h]
void (__fastcall *v44)(int, float *); // [sp+10h] [bp-3Ch]
const char *v45; // [sp+24h] [bp-28h]
float v46[2]; // [sp+28h] [bp-24h] BYREF
float v47[2]; // [sp+30h] [bp-1Ch] BYREF
char *v48[3]; // [sp+38h] [bp-14h] BYREF
*(_DWORD *)(a1 + 284) = a3;
v11 = *(_DWORD *)(a1 + 272);
v12 = *(cocos2d::CCNode **)(v11 + 320);
v43 = *(float *)(v11 + 336);
(*(void (__fastcall **)(cocos2d::CCNode *))(*(_DWORD *)v12 + 288))(v12);
if ( a4 )
{
v14 = 100;
}
else
{
v13 = *a2;
v14 = 1;
while ( v13 != a2[1] )
{
v16 = *v13++;
v15 = v16;
if ( v14 < v16 )
v14 = v15;
}
}
v17 = (float)(*(float *)(a1 + 268) - 32.0) - 36.0;
if ( v17 < 10.0 )
v17 = 10.0;
if ( a4 )
v18 = "RATE %";
else
v18 = "DEATHS";
v19 = 0;
DeathHistogram::rebuildAxis(
(cocos2d::CCDrawNode **)a1,
(cocos2d::CCLabelBMFont *)v18,
v14,
32.0,
v17,
(cocos2d::CCLabelBMFont *)"PROGRESS (%)");
memset(v48, 0, sizeof(v48));
do
{
if ( v19 >= a2[1] - *a2 )
break;
v20 = (const char *)(*a2)[v19];
if ( (int)v20 > 0 )
{
v36 = (float)((float)((float)(int)v20 / (float)v14) * v17) - 4.0;
if ( v36 < 3.0 )
v36 = 3.0;
if ( v19 == 100 )
{
LOWORD(v45) = -5351;
BYTE2(v45) = 45;
}
else
{
v37 = sub_7662A8();
LOWORD(v45) = v37;
BYTE2(v45) = BYTE2(v37);
}
sub_7665FC((int)v12, v45);
DtLabelPlacer::place(
(DtLabelPlacer *)v48,
v12,
v20,
(float)((float)((float)v19 * 18.0) + 3.0) + 9.0,
(float)(v36 + 35.0) + 8.0);
v38 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v19);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v38);
v41 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt", v40);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v41 + 80))(v41, 1056796836);
v42 = *(void (__fastcall **)(int, float *))(*(_DWORD *)v41 + 536);
LOWORD(v47[0]) = -14081;
BYTE2(v47[0]) = 120;
v42(v41, v47);
v44 = *(void (__fastcall **)(int, float *))(*(_DWORD *)v41 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, (float)((float)((float)v19 * 18.0) + 3.0) + 9.0, 25.0);
v44(v41, v47);
(*(void (__fastcall **)(cocos2d::CCNode *, int))(*(_DWORD *)v12 + 228))(v12, v41);
}
else
{
sub_7663D4((int)v12, (const char *)v19);
}
++v19;
}
while ( v19 != 101 );
ScrollableContentLayer::setContentHeight(*(ScrollableContentLayer **)(a1 + 272), 1831.0);
if ( !a5 )
{
if ( a6 && a3 > 0 )
{
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v46, (const cocos2d::CCSize *)(*(_DWORD *)(a1 + 272) + 324));
v22 = *(ScrollableContentLayer **)(a1 + 272);
v24 = (float)((float)((float)((float)a3 + 0.5) * 18.0) + 3.0) - (float)(v46[0] * 0.5);
}
else
{
v25 = (GameManager *)GameManager::sharedState(v21);
if ( GameManager::getGameVariable(v25, "0199") )
{
v22 = *(ScrollableContentLayer **)(a1 + 272);
v23 = 0.0;
goto LABEL_45;
}
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v47, (const cocos2d::CCSize *)(*(_DWORD *)(a1 + 272) + 324));
v26 = *a2;
v27 = 0;
v28 = -1;
v29 = 0.0;
v30 = 0;
v31 = a2[1] - *a2;
v32 = (int)(float)(v47[0] / 18.0);
if ( v32 < 1 )
v32 = 1;
do
{
if ( v27 >= v31 )
v33 = 0;
else
v33 = v26[v27];
v30 += v33;
if ( v27 >= v32 )
{
if ( v27 - v32 >= v31 )
v34 = 0;
else
v34 = v26[v27 - v32];
v30 -= v34;
}
if ( v27 >= v32 - 1 && v30 > v28 )
{
LODWORD(v29) = 1 - v32 + v27;
v28 = v30;
}
++v27;
}
while ( v27 != 101 );
v22 = *(ScrollableContentLayer **)(a1 + 272);
if ( v28 <= 0 )
{
v24 = 0.0;
}
else
{
v24 = v29;
v6 = 0.5;
}
if ( v28 > 0 )
v24 = (float)((float)((float)((float)SLODWORD(v24) + (float)((float)v32 * v6)) * 18.0) + 3.0)
- (float)(v47[0] * v6);
}
v23 = v24;
goto LABEL_45;
}
v22 = *(ScrollableContentLayer **)(a1 + 272);
v23 = v43;
LABEL_45:
ScrollableContentLayer::scrollTo(v22, v23);
return std::__vector_base::~__vector_base(v48);
}