//
// sub_7663D4 from 0x7663d4 to 0x7665d6 (514 bytes)
//
// 3 xrefs:
// > DeathHistogram::setData @ 0x767b8e
// > DeathHistogram::setSurvival @ 0x767f38
// > DeathHistogram::setSurvival @ 0x7681aa
//
// 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:07 +0000
//
int __fastcall sub_7663D4(int a1, const char *a2)
{
float v2; // s0
float v3; // s1
int v6; // r4
void (__fastcall *v7)(int, _BYTE *); // r9
void (__fastcall *v8)(int, _DWORD); // r9
float *v9; // r0
void (__fastcall *v10)(int, _DWORD); // r9
int v11; // r0
const char *v12; // r1
int v13; // r4
void (__fastcall *v14)(int, _BYTE *); // r11
void (__fastcall *v15)(int, _DWORD); // r11
float *v16; // r0
void (__fastcall *v17)(int, _DWORD); // r11
int v18; // r0
void (__fastcall *v19)(int, _BYTE *); // r3
void (__fastcall *v20)(int, _BYTE *); // r11
int result; // r0
cocos2d::CCString *v22; // r0
cocos2d::CCLabelBMFont *CString; // r0
const char *v24; // r2
int v25; // r4
void (__fastcall *v26)(int, _BYTE *); // r9
void (__fastcall *v27)(int, _BYTE *); // [sp+4h] [bp-18h]
_BYTE v28[8]; // [sp+Ch] [bp-10h] BYREF
v6 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", a2);
v7 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v6 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 0.5, 0.0);
v7(v6, v28);
v8 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v6 + 64);
v9 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v6 + 164))(v6);
v8(v6, (float)(v3 - 2.0) / *v9);
v10 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v6 + 72);
v11 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 164))(v6);
v10(v6, 8.0 / *(float *)(v11 + 4));
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v6 + 480))(v6, &unk_BF09F8);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 456))(v6, 110);
v27 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v6 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v2, 33.5);
v27(v6, v28);
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 228))(a1, v6);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"whiteSquare60_001.png", v12);
v14 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 0.5, 0.0);
v14(v13, v28);
v15 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v13 + 64);
v16 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v13 + 164))(v13);
v15(v13, (float)(v3 - 5.0) / *v16);
v17 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v13 + 72);
v18 = (*(int (__fastcall **)(int))(*(_DWORD *)v13 + 164))(v13);
v17(v13, 5.0 / *(float *)(v18 + 4));
v19 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 480);
qmemcpy(v28, "S0", 2);
v28[2] = 23;
v19(v13, v28);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 456))(v13, 130);
v20 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v2, 35.0);
v20(v13, v28);
result = (*(int (__fastcall **)(int, int))(*(_DWORD *)a1 + 228))(a1, v13);
if ( (int)a2 > 0 )
{
result = (int)a2 / 5;
if ( !((int)a2 % 5) )
{
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", a2);
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v22);
v25 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt", v24);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 80))(v25, 1056796836);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v25 + 536))(v25, &unk_BF09F8);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 512))(v25, 200);
v26 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v25 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, v2, 25.0);
v26(v25, v28);
return (*(int (__fastcall **)(int, int))(*(_DWORD *)a1 + 228))(a1, v25);
}
}
return result;
}