//
// FMODLevelVisualizer::updateVisualizer from 0x10029df20 to 0x10029e1a8 (648 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updateAudioVisualizer @ 0x1001311d7
// > GJBaseGameLayer::updateAudioVisualizer @ 0x100131240
// > FMODLevelVisualizer::init @ 0x10029df04
//
// This function is hookable on this platform (idp: pc, 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:27:53 +0000
//
__int64 __fastcall FMODLevelVisualizer::updateVisualizer(float *a1, float a2, float a3, float a4)
{
__int64 v4; // rbx
__int64 v5; // rax
void (__fastcall *v6)(__int64, __int64); // rcx
__int64 v7; // r15
__int64 v8; // rax
void (__fastcall *v9)(__int64, __int64); // rcx
__int64 v10; // r15
__int64 v11; // rax
void (__fastcall *v12)(__int64, __int64); // rcx
__int64 v13; // r15
__int64 v14; // rbx
float *v15; // rax
void *v16; // rsi
float v18[2]; // [rsp+4h] [rbp-2Ch] BYREF
float v19; // [rsp+Ch] [rbp-24h]
float v20; // [rsp+10h] [rbp-20h]
float v21; // [rsp+14h] [rbp-1Ch]
v19 = a4;
v20 = a3;
v21 = a2;
v4 = (*(__int64 (__fastcall **)(float *, __int64))(*(_QWORD *)a1 + 480LL))(a1, 50);
v5 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 480LL))(v4, 100);
if ( v5 )
{
v6 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 344LL);
if ( v21 <= 0.0 )
{
v6(v5, 0);
}
else
{
v7 = v5;
v6(v5, 1);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v7 + 144LL))(
v7,
(float)(fminf(0.60000002, v21) * 96.0) / a1[79]);
}
}
v8 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 480LL))(v4, 200);
if ( v8 )
{
v9 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 344LL);
if ( v21 <= 0.60000002 )
{
v9(v8, 0);
}
else
{
v10 = v8;
v9(v8, 1);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 144LL))(
v10,
(float)((float)(fminf(0.85000002, v21) + -0.60000002) * 96.0) / a1[79]);
}
}
v11 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 480LL))(v4, 300);
if ( v11 )
{
v12 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 344LL);
if ( v21 <= 0.85000002 )
{
v12(v11, 0);
}
else
{
v13 = v11;
v12(v11, 1);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v13 + 144LL))(
v13,
(float)((float)(fminf(1.0, v21) + -0.85000002) * 96.0) / a1[79]);
}
}
v14 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 480LL))(v4, 400);
v15 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 192LL))(v14);
sub_100278250(v18, *v15, (float)(96.0 * v20) + -48.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v14 + 184LL))(v14, v18);
if ( v20 <= 0.85000002 )
{
if ( v20 <= 0.60000002 )
v16 = &unk_100A073D6;
else
v16 = &unk_100A073D9;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v14 + 960LL))(v14, v16);
}
else
{
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v14 + 960LL))(v14, &unk_100A073D2);
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 912LL))(
v14,
(unsigned __int8)(int)fmaxf((float)(0.5 - v19) * 255.0, 0.0));
return (*(__int64 (__fastcall **)(__int64, bool))(*(_QWORD *)v14 + 344LL))(v14, v20 > 0.0);
}