//
// sub_7665FC from 0x7665fc to 0x766894 (664 bytes)
//
// 4 xrefs:
// > DeathHistogram::setProgression @ 0x7675a8
// > DeathHistogram::setData @ 0x767d4c
// > DeathHistogram::setSurvival @ 0x767fc0
// > DeathHistogram::setSurvival @ 0x7682a6
//
// 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
//
int __fastcall sub_7665FC(int a1, const char *a2)
{
float v2; // s0
float v3; // s1
float v4; // s2
int v6; // r4
void (__fastcall *v7)(int, _BYTE *); // r6
void (__fastcall *v8)(int, _DWORD); // r6
float *v9; // r0
void (__fastcall *v10)(int, _DWORD); // r6
int v11; // r0
void (__fastcall *v12)(int, _BYTE *); // r11
const char *v13; // r1
int v14; // r4
void (__fastcall *v15)(int, _BYTE *); // r10
void (__fastcall *v16)(int, _DWORD); // r10
float *v17; // r0
void (__fastcall *v18)(int, _DWORD); // r10
int v19; // r0
void (__fastcall *v20)(int, _BYTE *); // r10
const char *v21; // r1
float *v22; // r4
void (__fastcall *v23)(float *, _BYTE *); // r10
int v24; // r3
float v25; // s15
void (__fastcall *v26)(float *, _BYTE *); // r6
void (__fastcall *v27)(float *, _BYTE *); // r6
_DWORD v29[4]; // [sp+4h] [bp-20h] BYREF
_BYTE v30[8]; // [sp+14h] [bp-10h] BYREF
v29[0] = a2;
v6 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", a2);
v7 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v6 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, 0.5, 0.0);
v7(v6, v30);
v8 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v6 + 64);
v9 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v6 + 164))(v6);
v8(v6, (float)(v3 + 4.0) / *v9);
v10 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v6 + 72);
v11 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 164))(v6);
v10(v6, (float)(v4 + 4.0) / *(float *)(v11 + 4));
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v6 + 480))(v6, &unk_BF09F8);
v12 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v6 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v2, 33.0);
v12(v6, v30);
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 228))(a1, v6);
v14 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", v13);
v15 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v14 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, 0.5, 0.0);
v15(v14, v30);
v16 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v14 + 64);
v17 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v14 + 164))(v14);
v16(v14, v3 / *v17);
v18 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v14 + 72);
v19 = (*(int (__fastcall **)(int))(*(_DWORD *)v14 + 164))(v14);
v18(v14, v4 / *(float *)(v19 + 4));
(*(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v14 + 480))(v14, v29);
v20 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v14 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v2, 35.0);
v20(v14, v30);
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 228))(a1, v14);
v22 = (float *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"gradientBar.png", v21);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v22 + 180))(v22, -1028390912);
v23 = *(void (__fastcall **)(float *, _BYTE *))(*(_DWORD *)v22 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, 1.0, 0.5);
v23(v22, v30);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v22 + 456))(v22, 200);
v24 = *(_DWORD *)v22;
v29[2] = 770;
v29[3] = 1;
(*(void (__fastcall **)(float *, int, int))(v24 + 540))(v22, 770, 1);
v25 = v4 * 0.6;
if ( (float)(v4 * 0.6) > 50.0 )
{
v25 = 50.0;
}
else if ( v25 <= 10.0 )
{
v25 = 10.0;
}
else if ( v25 > 50.0 )
{
v25 = 50.0;
}
(*(void (__fastcall **)(float *, _DWORD))(*(_DWORD *)v22 + 64))(v22, v25 / v22[86]);
(*(void (__fastcall **)(float *, _DWORD))(*(_DWORD *)v22 + 72))(v22, v3 / v22[87]);
v26 = *(void (__fastcall **)(float *, _BYTE *))(*(_DWORD *)v22 + 480);
v30[0] = LOBYTE(v29[0]) + ((255 - LOBYTE(v29[0])) >> 1);
v30[1] = BYTE1(v29[0]) + (235 - BYTE1(v29[0])) / 2;
v30[2] = BYTE2(v29[0]) + (120 - BYTE2(v29[0])) / 2;
v26(v22, v30);
v27 = *(void (__fastcall **)(float *, _BYTE *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v2, v4 + 35.0);
v27(v22, v30);
return (*(int (__fastcall **)(int, float *))(*(_DWORD *)a1 + 228))(a1, v22);
}