//
// FMODLevelVisualizer::updateVisualizer from 0x8d4d54 to 0x8d5018 (708 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::updateAudioVisualizer @ 0x86be18
// > GJBaseGameLayer::updateAudioVisualizer @ 0x86be64
// > FMODLevelVisualizer::init @ 0x8d540c
// > ??> @ 0x79158
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void FMODLevelVisualizer::updateVisualizer(FMODLevelVisualizer *a1, float a2, float a3, float a4)
{
int v8; // w20
cocos2d::CCNode *v9; // x22
int v10; // w0
cocos2d::CCNode_vtbl *v11; // x2
__int64 v12; // x19
float v13; // s9
float v14; // s8
cocos2d::CCNode_vtbl *v15; // x2
cocos2d::CCNode *v16; // x0
__int64 v17; // x19
void (__fastcall *v18)(__int64, cocos2d::CCPoint *); // x22
float *v19; // x0
__int64 v20; // x2
void (__fastcall *v21)(__int64, __int64); // x2
float v22; // s0
__int64 v23; // x1
__int64 v24; // x0
cocos2d::CCPoint v25; // [xsp+90h] [xbp+90h] BYREF
v8 = 1;
v9 = a1->getChildByTag(a1, 50);
v10 = 0;
v11 = v9->__vftable;
while ( 1 )
{
if ( v10 == 2 )
{
v12 = (__int64)v11->getChildByTag(v9, 300);
if ( !v12 )
goto LABEL_15;
v13 = 0.85;
v14 = 1.0;
}
else
{
v24 = (__int64)v11->getChildByTag(v9, 100);
v12 = v24;
if ( !v24 )
goto LABEL_8;
v14 = 0.6;
v13 = 0.0;
}
v15 = *(cocos2d::CCNode_vtbl **)v12;
v16 = (cocos2d::CCNode *)v12;
if ( a2 <= v13 )
break;
LABEL_12:
v15->setVisible(v16, 1);
if ( a2 <= v14 )
v14 = a2;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v12 + 144LL))(
v12,
(float)((float)(v14 - v13) * 96.0) / a1->m_width);
if ( v8 == 3 )
goto LABEL_15;
LABEL_9:
while ( 1 )
{
++v8;
v11 = v9->__vftable;
v10 = v8 - 1;
if ( v8 != 2 )
break;
v16 = v11->getChildByTag(v9, 200);
v12 = (__int64)v16;
if ( v16 )
{
v13 = 0.6;
v15 = v16->__vftable;
v14 = 0.85;
if ( a2 <= 0.6 )
goto LABEL_7;
goto LABEL_12;
}
}
}
LABEL_7:
v15->setVisible(v16, 0);
LABEL_8:
if ( v8 != 3 )
goto LABEL_9;
LABEL_15:
v17 = (__int64)v9->getChildByTag(v9, 400);
v18 = *(void (__fastcall **)(__int64, cocos2d::CCPoint *))(*(_QWORD *)v17 + 184LL);
v19 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v17 + 192LL))(v17);
cocos2d::CCPoint::CCPoint(&v25, *v19, (float)(a3 * 96.0) + -48.0);
v18(v17, &v25);
if ( a3 > 0.85 )
{
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v17 + 944LL))(v17, &unk_EEDEE0);
}
else
{
v20 = *(_QWORD *)v17;
if ( a3 > 0.6 )
{
(*(void (__fastcall **)(__int64, void *))(v20 + 944))(v17, &unk_EEDEE8);
v21 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 896LL);
v22 = (float)(0.5 - a4) * 255.0;
if ( v22 > 0.0 )
goto LABEL_19;
LABEL_24:
v23 = 0;
goto LABEL_20;
}
(*(void (__fastcall **)(__int64, void *))(v20 + 944))(v17, &unk_EEDEF0);
}
v21 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 896LL);
v22 = (float)(0.5 - a4) * 255.0;
if ( v22 <= 0.0 )
goto LABEL_24;
LABEL_19:
v23 = (unsigned __int8)(unsigned int)v22;
LABEL_20:
v21(v17, v23);
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v17 + 328LL))(v17, a3 > 0.0);
}