//
// DeathHistogram::rebuildAxis from 0x140111610 to 0x140111dcb (1979 bytes)
//
// 5 xrefs:
// > DeathHistogram::setData @ 0x140111f7b
// > DeathHistogram::setSurvival @ 0x140112788
// > DeathHistogram::setAttemptLine @ 0x140113049
// > DeathHistogram::setProgression @ 0x140114539
// > ??> @ 0x140915e24
//
// This function is hookable on this platform (idp: pc, 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:26:50 +0000
//
__int64 __fastcall DeathHistogram::rebuildAxis(__int64 a1, const char *a2, int a3, float a4, float a5, const char *a6)
{
cocos2d::CCDrawNode *v7; // rcx
float v10; // xmm10_4
struct cocos2d::CCLabelBMFont *v11; // rdi
void (__fastcall **v12)(__int64, __int16 *); // rdx
__int64 v13; // rbx
__int64 v14; // rax
float v15; // xmm6_4
double v16; // xmm0_8
float v17; // xmm9_4
struct cocos2d::CCSprite *v18; // rsi
void (__fastcall **v19)(__int64, __int16 *); // rax
__int64 v20; // rdx
__int64 v21; // rbx
__int64 v22; // rax
struct cocos2d::CCSprite *v23; // rdi
void (__fastcall **v24)(__int64, __int16 *); // rax
__int64 v25; // rdx
__int64 v26; // rbx
__int64 v27; // rax
double v28; // xmm0_8
float v29; // xmm6_4
double v30; // xmm0_8
__int64 v31; // rax
double v32; // xmm0_8
float v33; // xmm6_4
__int64 v34; // rax
struct cocos2d::CCLabelBMFont *v35; // rdi
__int64 v36; // rbx
__int64 v37; // rax
void (__fastcall **v38)(__int64, __int16 *); // rax
__int64 v39; // rbx
__int64 v40; // rax
float v41; // xmm8_4
cocos2d::CCDrawNode *v42; // rdi
float v43; // xmm6_4
const struct cocos2d::CCPoint *v44; // rax
const struct cocos2d::CCPoint *v45; // rbx
const struct cocos2d::CCPoint *v46; // rax
__int64 result; // rax
int v48; // esi
unsigned __int64 v49; // rcx
int v50; // r14d
float v51; // xmm7_4
cocos2d::CCDrawNode *v52; // rdi
const struct cocos2d::CCPoint *v53; // rax
const struct cocos2d::CCPoint *v54; // rbx
const struct cocos2d::CCPoint *v55; // rax
cocos2d::CCString *v56; // rax
float i; // xmm6_4
cocos2d::CCDrawNode *v58; // rdi
const struct cocos2d::CCPoint *v59; // rax
const struct cocos2d::CCPoint *v60; // rbx
const struct cocos2d::CCPoint *v61; // rax
int v62; // ecx
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v64; // rdi
__int64 v65; // rbx
__int64 v66; // rax
void (__fastcall **v67)(__int64, __int16 *); // rax
__int64 v68; // rbx
__int64 v69; // rax
__int16 v70; // [rsp+38h] [rbp-D0h] BYREF
char v71; // [rsp+3Ah] [rbp-CEh]
int v72; // [rsp+3Ch] [rbp-CCh] BYREF
float v73; // [rsp+44h] [rbp-C4h]
float v74; // [rsp+48h] [rbp-C0h]
_BYTE v75[8]; // [rsp+4Ch] [rbp-BCh] BYREF
_BYTE v76[16]; // [rsp+54h] [rbp-B4h] BYREF
_BYTE v77[8]; // [rsp+64h] [rbp-A4h] BYREF
_BYTE v78[8]; // [rsp+6Ch] [rbp-9Ch] BYREF
_BYTE v79[4]; // [rsp+74h] [rbp-94h] BYREF
_QWORD v80[3]; // [rsp+78h] [rbp-90h] BYREF
__m128i si128; // [rsp+90h] [rbp-78h] BYREF
v7 = *(cocos2d::CCDrawNode **)(a1 + 336);
v73 = a4;
v74 = a5;
cocos2d::CCDrawNode::clear(v7);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 344) + 568LL))(*(_QWORD *)(a1 + 344));
v10 = (float)((float)(*(float *)(a1 + 320) - 22.0) * 0.5) + 22.0;
v11 = cocos2d::CCLabelBMFont::create(a6, (const char *)&qword_140704F78);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v11 + 160LL))(v11);
v70 = -14081;
v12 = *((void (__fastcall ***)(__int64, __int16 *))v11 + 46);
v71 = 120;
(*v12)((__int64)v11 + 368, &v70);
v13 = *(_QWORD *)v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, v10, 12.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v13 + 184))(v11, v14);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 344) + 464LL))(
*(_QWORD *)(a1 + 344),
v11);
v15 = *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v11 + 320LL))(v11);
v16 = (*(double (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v11 + 168LL))(v11);
v17 = (float)(*(float *)&v16 * v15) * 0.5;
v18 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v18 + 120LL))(v18);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v18 + 136LL))(v18);
v19 = *((void (__fastcall ***)(__int64, __int16 *))v18 + 40);
v70 = -14081;
v71 = 120;
(*v19)((__int64)v18 + 320, &v70);
LOBYTE(v20) = 100;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v18 + 40) + 40LL))((__int64)v18 + 320, v20);
v21 = *(_QWORD *)v18;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, (float)(v10 - v17) - 16.0, 12.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v21 + 184))(v18, v22);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 344) + 464LL))(
*(_QWORD *)(a1 + 344),
v18);
v23 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v23 + 120LL))(v23);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v23 + 136LL))(v23);
v24 = *((void (__fastcall ***)(__int64, __int16 *))v23 + 40);
v70 = -14081;
v71 = 120;
(*v24)((__int64)v23 + 320, &v70);
LOBYTE(v25) = 100;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v23 + 40) + 40LL))((__int64)v23 + 320, v25);
v26 = *(_QWORD *)v23;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, (float)(v10 + v17) + 16.0, 12.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v26 + 184))(v23, v27);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 344) + 464LL))(
*(_QWORD *)(a1 + 344),
v23);
v28 = (*(double (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v18 + 232LL))(v18);
v29 = *(float *)&v28 - 10.0;
v30 = (*(double (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v18 + 216LL))(v18);
v31 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v76, *(float *)&v30 - 10.0, v29, 20.0, 20.0);
cocos2d::CCRect::operator=(a1 + 356, v31);
v32 = (*(double (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v23 + 232LL))(v23);
v33 = *(float *)&v32 - 10.0;
*(float *)&v32 = (*(float (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v23 + 216LL))(v23);
v34 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v76, *(float *)&v32 - 10.0, v33, 20.0, 20.0);
cocos2d::CCRect::operator=(a1 + 372, v34);
v35 = cocos2d::CCLabelBMFont::create(a2, (const char *)&qword_140704F78);
v36 = *(_QWORD *)v35;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v36 + 288))(v35, v37);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v35 + 160LL))(v35);
v70 = -14081;
v38 = *((void (__fastcall ***)(__int64, __int16 *))v35 + 46);
v71 = 120;
(*v38)((__int64)v35 + 368, &v70);
v39 = *(_QWORD *)v35;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, 12.0, (float)(a5 + a4) + 19.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v39 + 184))(v35, v40);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 344) + 464LL))(
*(_QWORD *)(a1 + 344),
v35);
v41 = *(float *)(a1 + 320) - 4.0;
v42 = *(cocos2d::CCDrawNode **)(a1 + 336);
si128 = _mm_load_si128((const __m128i *)&xmmword_140836920);
*(__m128i *)&v80[1] = _mm_load_si128((const __m128i *)&xmmword_140836940);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, 22.0, (float)(a5 + a4) + 6.0);
v43 = v73;
v45 = v44;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, 22.0, v73);
cocos2d::CCDrawNode::drawSegment(v42, v46, v45, 0.5, (const struct cocos2d::_ccColor4F *)&v80[1]);
result = (unsigned int)(a3 / 4);
if ( (int)result < 1 )
result = 1;
v48 = 0;
v49 = 0;
while ( 1 )
{
v50 = *(_DWORD *)((char *)&unk_14072FAF8 + v49);
if ( v50 >= (int)result )
break;
v49 += 4LL;
if ( v49 >= 0x34 )
{
v50 = 10000;
break;
}
}
if ( a3 >= 0 )
{
do
{
v51 = (float)((float)((float)v48 / (float)a3) * v74) + v43;
if ( v48 )
{
for ( i = 25.0; v41 > i; i = i + 5.0 )
{
v58 = *(cocos2d::CCDrawNode **)(a1 + 336);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77, fminf(i + 2.0, v41), v51);
v60 = v59;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v78, i, v51);
cocos2d::CCDrawNode::drawSegment(v58, v61, v60, 0.5, (const struct cocos2d::_ccColor4F *)&si128);
}
if ( v48 >= 1000 )
{
v62 = v48 / 1000;
if ( v48 == 1000 * (v48 / 1000) )
v56 = cocos2d::CCString::createWithFormat("%ik", v62);
else
v56 = cocos2d::CCString::createWithFormat("%i.%ik", v62, v48 % 1000 / 100);
}
else
{
v56 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v48);
}
}
else
{
v52 = *(cocos2d::CCDrawNode **)(a1 + 336);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v41, v51);
v54 = v53;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v72, 22.0, v51);
cocos2d::CCDrawNode::drawSegment(v52, v55, v54, 0.5, (const struct cocos2d::_ccColor4F *)&v80[1]);
v56 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, 0);
}
CString = cocos2d::CCString::getCString(v56);
v64 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt");
v65 = *(_QWORD *)v64;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79, 1.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v65 + 288))(v64, v66);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v64 + 160LL))(v64);
v70 = -14081;
v67 = *((void (__fastcall ***)(__int64, __int16 *))v64 + 46);
v71 = 120;
(*v67)((__int64)v64 + 368, &v70);
v68 = *(_QWORD *)v64;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, 18.0, v51);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v68 + 184))(v64, v69);
result = (*(__int64 (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 344) + 464LL))(
*(_QWORD *)(a1 + 344),
v64);
v43 = v73;
v48 += v50;
}
while ( v48 <= a3 );
}
return result;
}