//
// sub_C981E8 from 0xc981e8 to 0xc98574 (908 bytes)
//
// 4 xrefs:
// > DeathHistogram::setProgression @ 0xc996e4
// > DeathHistogram::setSurvival @ 0xc9a020
// > DeathHistogram::setSurvival @ 0xc9a54c
// > DeathHistogram::setData @ 0xc9ad60
//
// This function is hookable on this platform (idp: arm, 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 13:05:54 +0000
//
__int64 __fastcall sub_C981E8(__int64 a1, __int64 a2, float a3, float a4, float a5)
{
__int64 v9; // x19
void (__fastcall *v10)(__int64, _BYTE *); // x24
void (__fastcall *v11)(__int64, float); // x24
float *v12; // x0
void (__fastcall *v13)(__int64, float); // x24
__int64 v14; // x0
void (__fastcall *v15)(__int64, _BYTE *); // x24
const char *v16; // x1
__int64 v17; // x19
void (__fastcall *v18)(__int64, _BYTE *); // x23
void (__fastcall *v19)(__int64, float); // x23
float *v20; // x0
void (__fastcall *v21)(__int64, float); // x23
__int64 v22; // x0
void (__fastcall *v23)(__int64, _BYTE *); // x23
const char *v24; // x1
float *v25; // x19
void (__fastcall *v26)(float *, _BYTE *); // x23
float v27; // s0
void (__fastcall *v28)(float *, _BYTE *); // x8
void (__fastcall *v29)(float *, _BYTE *); // x23
__int64 v31; // [xsp+68h] [xbp+68h] BYREF
_BYTE v32[8]; // [xsp+70h] [xbp+70h] BYREF
v31 = a2;
v9 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", _stack_chk_guard);
v10 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, 0.5, 0.0);
v10(v9, v32);
v11 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v9 + 128LL);
v12 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 328LL))(v9);
v11(v9, (float)(a4 + 4.0) / *v12);
v13 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v9 + 144LL);
v14 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 328LL))(v9);
v13(v9, (float)(a5 + 4.0) / *(float *)(v14 + 4));
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v9 + 960LL))(v9, &unk_11A1C70);
v15 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v9 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, a3, 33.0);
v15(v9, v32);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v9);
v17 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", v16);
v18 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v17 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, 0.5, 0.0);
v18(v17, v32);
v19 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v17 + 128LL);
v20 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v17 + 328LL))(v17);
v19(v17, a4 / *v20);
v21 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v17 + 144LL);
v22 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v17 + 328LL))(v17);
v21(v17, a5 / *(float *)(v22 + 4));
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 960LL))(v17, &v31);
v23 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, a3, 35.0);
v23(v17, v32);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v17);
v25 = (float *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"gradientBar.png", v24);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v25 + 360LL))(v25, -90.0);
v26 = *(void (__fastcall **)(float *, _BYTE *))(*(_QWORD *)v25 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, 1.0, 0.5);
v26(v25, v32);
(*(void (__fastcall **)(float *, __int64))(*(_QWORD *)v25 + 912LL))(v25, 4294967240LL);
(*(void (__fastcall **)(float *, __int64))(*(_QWORD *)v25 + 1080LL))(v25, 0x100000302LL);
v27 = a5 * 0.6;
if ( (float)(a5 * 0.6) > 50.0 )
goto LABEL_4;
if ( v27 <= 10.0 )
{
v27 = 10.0;
goto LABEL_5;
}
if ( v27 > 50.0 )
LABEL_4:
v27 = 50.0;
LABEL_5:
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v25 + 128LL))(v25, v27 / v25[108]);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v25 + 144LL))(v25, a4 / v25[109]);
v28 = *(void (__fastcall **)(float *, _BYTE *))(*(_QWORD *)v25 + 960LL);
v32[1] = BYTE1(v31) + (235 - BYTE1(v31)) / 2;
v32[0] = v31 + ((255 - (unsigned __int8)v31) >> 1);
v32[2] = BYTE2(v31) + (120 - BYTE2(v31)) / 2;
v28(v25, v32);
v29 = *(void (__fastcall **)(float *, _BYTE *))(*(_QWORD *)v25 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v32, a3, a5 + 35.0);
v29(v25, v32);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)a1 + 456LL))(a1, v25);
return _stack_chk_guard;
}