//
// GJRateLevelListLayer::starSumForBottom from 0x951f4c to 0x9520cc (384 bytes)
//
// 2 xrefs:
// > GJRateLevelListLayer::updateStarSumLabel @ 0x9520e4
// > ??> @ 0x7f048
//
// 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 12:57:23 +0000
//
__int64 __fastcall GJRateLevelListLayer::starSumForBottom(GJRateLevelListLayer *this, int a2)
{
int v2; // w4
int v3; // w3
int v4; // w2
int v5; // w2
int v6; // w1
int v7; // w5
int v8; // w1
int v9; // w5
int v10; // w1
int v11; // w5
int v12; // w1
int v13; // w5
int v14; // w1
int v15; // w5
int v16; // w1
int v17; // w5
int v18; // w1
int v19; // w0
int v20; // w1
int v21; // w1
v2 = *((_DWORD *)this + 278);
v3 = *((_DWORD *)this + 277);
v4 = v2 + vaddvq_s32(vaddq_s32(*(int32x4_t *)((char *)this + 1092), *(int32x4_t *)((char *)this + 1076))) + v3;
if ( a2 > v4 || v4 <= 0 )
return 0xFFFFFFFFLL;
if ( a2 <= 0 )
return 0;
v5 = *((_DWORD *)this + 269);
if ( a2 <= v5 )
v5 = a2;
v6 = a2 - v5;
if ( v6 > 0 )
{
v7 = *((_DWORD *)this + 270);
if ( v6 <= v7 )
v7 = v6;
v8 = v6 - v7;
v5 += 2 * v7;
if ( v8 > 0 )
{
v9 = *((_DWORD *)this + 271);
if ( v8 <= v9 )
v9 = v8;
v10 = v8 - v9;
v5 += 3 * v9;
if ( v10 > 0 )
{
v11 = *((_DWORD *)this + 272);
if ( v10 <= v11 )
v11 = v10;
v12 = v10 - v11;
v5 += 4 * v11;
if ( v12 > 0 )
{
v13 = *((_DWORD *)this + 273);
if ( v12 <= v13 )
v13 = v12;
v14 = v12 - v13;
v5 += 5 * v13;
if ( v14 > 0 )
{
v15 = *((_DWORD *)this + 274);
if ( v14 <= v15 )
v15 = v14;
v16 = v14 - v15;
v5 += 6 * v15;
if ( v16 > 0 )
{
v17 = *((_DWORD *)this + 275);
if ( v16 <= v17 )
v17 = v16;
v18 = v16 - v17;
v5 = v5 + 8 * v17 - v17;
if ( v18 > 0 )
{
v19 = *((_DWORD *)this + 276);
if ( v18 <= v19 )
v19 = v18;
v20 = v18 - v19;
v5 += 8 * v19;
if ( v20 > 0 )
{
if ( v20 <= v3 )
v3 = v20;
v21 = v20 - v3;
v5 += 9 * v3;
if ( v21 > 0 )
{
if ( v2 <= v21 )
v21 = v2;
v5 += 10 * v21;
}
}
}
}
}
}
}
}
}
return (unsigned int)v5;
}