//
// DeathHistogram::setProgression from 0x767378 to 0x7677be (1094 bytes)
//
// 1 xrefs:
// > DeathTrackerPopup::init @ 0x776874
//
// 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
//
void __fastcall DeathHistogram::setProgression(int a1, int **a2, int *a3, _DWORD *a4)
{
int v6; // r6
int *v7; // r0
int v8; // s20
int v9; // r0
const char *v10; // r2
int v11; // r5
void (__fastcall *v12)(int, time_t *); // r2
void (__fastcall *v13)(int, time_t *); // r8
ScrollableContentLayer *v14; // r0
float v15; // r1
int *v16; // r10
int v17; // r7
float v18; // s16
int v19; // r3
int v20; // t1
int v21; // r10
int v22; // r7
int v23; // r8
int v24; // r5
int v25; // r1
const char *v26; // r7
float v27; // s17
int v28; // r0
cocos2d::CCString *v29; // r0
cocos2d::CCLabelBMFont *CString; // r0
const char *v31; // r2
int v32; // r7
void (__fastcall *v33)(int, time_t *); // r10
int v34; // r1
int v35; // r0
struct tm *v36; // r11
const char *v37; // r2
cocos2d::CCLabelBMFont *v38; // r0
cocos2d::CCString *v39; // r0
char *v40; // r0
int v41; // r7
void (__fastcall *v42)(int, time_t *); // r3
void (__fastcall *v43)(int, time_t *); // r11
int v44; // r5
float v45; // r1
const char *v48; // [sp+34h] [bp-38h]
float v49[2]; // [sp+38h] [bp-34h] BYREF
time_t v50[2]; // [sp+40h] [bp-2Ch] BYREF
int v51; // [sp+48h] [bp-24h] BYREF
int v52; // [sp+4Ch] [bp-20h]
cocos2d::CCLabelBMFont *v53; // [sp+50h] [bp-1Ch]
char v54[16]; // [sp+54h] [bp-18h] BYREF
v6 = *(_DWORD *)(*(_DWORD *)(a1 + 272) + 320);
(*(void (__fastcall **)(int))(*(_DWORD *)v6 + 288))(v6);
v7 = a2[1];
v8 = v7 - *a2;
if ( !v8 )
{
cocos2d::CCDrawNode::clear(*(cocos2d::CCDrawNode **)(a1 + 276));
(*(void (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 280) + 288))(*(_DWORD *)(a1 + 280));
v9 = cocos2d::CCRect::operator=(a1 + 304, &unk_D2E050);
cocos2d::CCRect::operator=(a1 + 288, v9);
v11 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"No sessions yet.", "chatFont.fnt", v10);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v11 + 80))(v11, 1058642330);
v12 = *(void (__fastcall **)(int, time_t *))(*(_DWORD *)v11 + 536);
LOWORD(v50[0]) = -26986;
BYTE2(v50[0]) = -106;
v12(v11, v50);
v13 = *(void (__fastcall **)(int, time_t *))(*(_DWORD *)v11 + 92);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v49, (const cocos2d::CCSize *)(*(_DWORD *)(a1 + 272) + 324));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, v49[0] * 0.5, *(float *)(a1 + 268) * 0.5);
v13(v11, v50);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 228))(v6, v11);
ScrollableContentLayer::setContentHeight(*(ScrollableContentLayer **)(a1 + 272), *(float *)(a1 + 264));
v14 = *(ScrollableContentLayer **)(a1 + 272);
v15 = 0.0;
goto LABEL_41;
}
v16 = *a2;
v17 = 0;
v18 = (float)(*(float *)(a1 + 268) - 32.0) - 36.0;
if ( v18 < 10.0 )
v18 = 10.0;
while ( v16 != v7 )
{
v20 = *v16++;
v19 = v20;
if ( v17 < v20 )
v17 = v19;
}
if ( v17 > 99 )
{
LABEL_13:
v23 = 100;
}
else
{
v21 = 0;
v22 = v17 + ((v17 + 3) >> 2);
while ( 1 )
{
v23 = dword_BF0A40[v21];
if ( v23 >= v22 )
break;
if ( ++v21 == 10 )
goto LABEL_13;
}
}
v24 = 0;
DeathHistogram::rebuildAxis(
(cocos2d::CCDrawNode **)a1,
(cocos2d::CCLabelBMFont *)"BEST %",
v23,
32.0,
v18,
(cocos2d::CCLabelBMFont *)"SESSIONS");
while ( v24 < v8 )
{
v25 = (*a2)[v24];
if ( v25 > 99 )
v26 = (const char *)&dword_64;
else
v26 = (const char *)(v25 & ~(v25 >> 31));
v27 = (float)((float)((float)(int)v26 / (float)v23) * v18) - 4.0;
if ( v27 < 3.0 )
v27 = 3.0;
v28 = sub_7662A8();
LOWORD(v48) = v28;
BYTE2(v48) = BYTE2(v28);
sub_7665FC(v6, v48);
v29 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i%%", v26);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v29);
v32 = cocos2d::CCLabelBMFont::create(CString, "bigFont.fnt", v31);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v32 + 80))(v32, 1048911544);
v33 = *(void (__fastcall **)(int, time_t *))(*(_DWORD *)v32 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, (float)((float)v24 * 31.0) + 15.5, (float)(v27 + 35.0) + 8.0);
v33(v32, v50);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 228))(v6, v32);
v51 = 0;
v52 = 0;
v34 = *a3;
v35 = a3[1];
v53 = nullptr;
if ( v24 < (v35 - v34) >> 2 && *(int *)(v34 + 4 * v24) > 0 )
{
v50[0] = *(_DWORD *)(v34 + 4 * v24);
v36 = localtime(v50);
memset(v54, 0, sizeof(v54));
if ( v36 )
strftime(v54, 0x10u, "%m/%d", v36);
std::string::assign(&v51, v54);
}
v37 = (const char *)((unsigned __int8)v51 << 31);
if ( (v51 & 1) != 0 )
{
if ( v52 )
goto LABEL_28;
}
else if ( (unsigned __int8)v51 >> 1 )
{
goto LABEL_30;
}
if ( v24 < (a4[1] - *a4) >> 2 )
v39 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
*(const char **)(*a4 + 4 * v24),
v37);
else
v39 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)(v24 + 1),
v37);
v40 = (char *)cocos2d::CCString::getCString(v39);
std::string::assign(&v51, v40);
if ( (v51 & 1) != 0 )
{
LABEL_28:
v38 = v53;
goto LABEL_36;
}
LABEL_30:
v38 = (cocos2d::CCLabelBMFont *)((char *)&v51 + 1);
LABEL_36:
v41 = cocos2d::CCLabelBMFont::create(v38, "chatFont.fnt", v37);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v41 + 80))(v41, 1055286886);
v42 = *(void (__fastcall **)(int, time_t *))(*(_DWORD *)v41 + 536);
LOWORD(v50[0]) = -14081;
BYTE2(v50[0]) = 120;
v42(v41, v50);
v43 = *(void (__fastcall **)(int, time_t *))(*(_DWORD *)v41 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, (float)((float)v24 * 31.0) + 15.5, 24.0);
v43(v41, v50);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 228))(v6, v41);
++v24;
std::string::~string((int)&v51);
}
v44 = *(_DWORD *)(a1 + 272);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v49, (const cocos2d::CCSize *)(v44 + 324));
if ( (float)((float)((float)v8 * 31.0) + 10.0) >= v49[0] )
{
v45 = (float)((float)v8 * 31.0) + 10.0;
}
else
{
v44 = *(_DWORD *)(a1 + 272);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v50, (const cocos2d::CCSize *)(v44 + 324));
v45 = *(float *)v50;
}
ScrollableContentLayer::setContentHeight((ScrollableContentLayer *)v44, v45);
v14 = *(ScrollableContentLayer **)(a1 + 272);
v15 = (float)((float)v8 * 31.0) + 10.0;
LABEL_41:
ScrollableContentLayer::scrollTo(v14, v15);
}