//
// GJBaseGameLayer::toggleAudioVisualizer from 0x9ad0e4 to 0x9ad28c (424 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::init @ 0x9bd76c
// > GameOptionsLayer::didToggle @ 0xa1e3c4
// > GameSettingsLayer::didChangeGV @ 0xc04e38
// > ??> @ 0xaf0f0
//
// 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:58:13 +0000
//
__int64 __fastcall GJBaseGameLayer::toggleAudioVisualizer(GJBaseGameLayer *this, unsigned __int8 a2)
{
char *v2; // x22
unsigned int v4; // w19
__int64 v5; // x1
__int64 v6; // x0
cocos2d::CCDirector *v8; // x0
FMODLevelVisualizer *WinSize; // x0
__int64 v10; // x0
__int64 v11; // x24
__int64 (__fastcall *v12)(__int64, _BYTE *); // x25
FMODLevelVisualizer *v13; // x0
__int64 v14; // x0
__int64 v15; // x24
void (__fastcall *v16)(__int64, _BYTE *); // x23
__int64 v17; // [xsp+50h] [xbp+50h] BYREF
float v18; // [xsp+58h] [xbp+58h] BYREF
_BYTE v19[8]; // [xsp+60h] [xbp+60h] BYREF
v2 = (char *)this + 12288;
v4 = a2;
*(_BYTE *)(FMODAudioEngine::sharedEngine(_stack_chk_guard) + 1608) = a2;
if ( (unsigned __int8)v2[1416] != v4 )
{
v2[1416] = v4;
v5 = v4;
v6 = *((_QWORD *)this + 1711);
if ( !v6 )
{
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(nullptr);
WinSize = (FMODLevelVisualizer *)cocos2d::CCDirector::getWinSize(&v17, v8);
v10 = FMODLevelVisualizer::create(WinSize);
*((_QWORD *)this + 1711) = v10;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 1661) + 464LL))(
*((_QWORD *)this + 1661),
v10,
100);
v11 = *((_QWORD *)this + 1711);
v12 = *(__int64 (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v11 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v18, 0.0, 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v19, v18 + 20.0, *((float *)&v17 + 1) * 0.5);
v13 = (FMODLevelVisualizer *)v12(v11, v19);
v14 = FMODLevelVisualizer::create(v13);
*((_QWORD *)this + 1712) = v14;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 1661) + 464LL))(
*((_QWORD *)this + 1661),
v14,
100);
v15 = *((_QWORD *)this + 1712);
v16 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v15 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v18, 0.0, 0.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v19, v18 + 35.0, *((float *)&v17 + 1) * 0.5);
v16(v15, v19);
v6 = *((_QWORD *)this + 1711);
v5 = (unsigned __int8)v2[1416];
}
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v6 + 344LL))(v6, v5);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 1712) + 344LL))(
*((_QWORD *)this + 1712),
(unsigned __int8)v2[1416]);
}
return _stack_chk_guard;
}