//
// CustomSongWidget::updateProgressBar from 0x8684b8 to 0x868568 (176 bytes)
//
// 4 xrefs:
// > CustomSongWidget::startMonitorDownload @ 0x868580
// > CustomSongWidget::init @ 0x86b9fc
// > CustomSongWidget::updateDownloadProgress @ 0x86c54c
// > ??> @ 0x7d830
//
// 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:55:41 +0000
//
__int64 __fastcall CustomSongWidget::updateProgressBar(CustomSongWidget *this, int a2)
{
float v2; // s0
float v3; // s2
__int64 v4; // x20
void (__fastcall *v5)(__int64, _BYTE *); // x21
_BYTE v7[16]; // [xsp+48h] [xbp+48h] BYREF
if ( a2 < 0 )
a2 = 0;
v2 = *(float *)(*((_QWORD *)this + 57) + 432LL) - 4.0;
v3 = (float)((float)a2 / 100.0) * v2;
if ( v2 <= v3 )
v3 = *(float *)(*((_QWORD *)this + 57) + 432LL) - 4.0;
v4 = *((_QWORD *)this + 58);
v5 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v4 + 1136LL);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v7, 0.0, 0.0, v3, 8.0);
v5(v4, v7);
return _stack_chk_guard;
}