//
// GJKeybindManager::handleGlobalAudioAction from 0xc09c70 to 0xc09f84 (788 bytes)
//
// 2 xrefs:
// > GJKeybindManager::handleGlobalAction @ 0xc09f94
// > ??> @ 0x71e00
//
// 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 13:03:52 +0000
//
__int64 __fastcall GJKeybindManager::handleGlobalAudioAction(GJKeybindManager *this, char a2)
{
int v2; // w20
unsigned int v3; // w21
FMODAudioEngine *v4; // x0
int v5; // w1
unsigned __int64 v6; // x0
float v7; // s8
__int64 v8; // x0
GameManager *v9; // x0
GameManager *v10; // x0
__int64 v11; // x0
const char *v12; // x20
__int64 v13; // x21
cocos2d::CCString *v14; // x0
size_t v15; // x0
_QWORD *v16; // x0
FMODAudioEngine *v18; // x0
FMODAudioEngine *v19; // x0
GameManager *v20; // x0
__int64 v21; // x0
char *CString; // [xsp+48h] [xbp+48h]
__int64 v23; // [xsp+50h] [xbp+50h] BYREF
size_t v24; // [xsp+58h] [xbp+58h]
void *v25; // [xsp+60h] [xbp+60h]
__int64 v26[2]; // [xsp+68h] [xbp+68h] BYREF
void *v27; // [xsp+78h] [xbp+78h]
__int64 v28; // [xsp+80h] [xbp+80h] BYREF
size_t v29; // [xsp+88h] [xbp+88h]
void *v30; // [xsp+90h] [xbp+90h]
v2 = (int)this;
v3 = (unsigned int)((_DWORD)this - 1001) <= 1;
if ( ((unsigned int)((_DWORD)this - 1004) > 1) <= v3 )
{
if ( !a2 )
return 1;
if ( (unsigned int)((_DWORD)this - 1001) <= 1 )
{
v18 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(_stack_chk_guard);
v5 = (int)(float)((float)(FMODAudioEngine::getBackgroundMusicVolume(v18) * 100.0) + 0.5);
}
else
{
v4 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(_stack_chk_guard);
v5 = (int)(float)((float)(FMODAudioEngine::getEffectsVolume(v4) * 100.0) + 0.5);
}
if ( v2 == 1004 || v2 == 1001 )
{
v6 = (unsigned int)(v5 + 10);
if ( v5 + 10 >= 0 )
{
LABEL_8:
if ( (int)v6 <= 100 )
{
v6 = (unsigned int)(10 * (((int)v6 + 5) / 10));
v7 = (float)(int)v6 / 100.0;
}
else
{
v7 = 1.0;
}
if ( v3 )
goto LABEL_11;
goto LABEL_28;
}
}
else
{
v6 = (unsigned int)(v5 - 10);
if ( v5 - 10 >= 0 )
goto LABEL_8;
}
v7 = 0.0;
if ( v3 )
{
LABEL_11:
v8 = FMODAudioEngine::sharedEngine((FMODAudioEngine *)v6);
v9 = (GameManager *)FMODAudioEngine::setBackgroundMusicVolume(v8, v7);
v10 = *(GameManager **)(GameManager::sharedState(v9) + 952);
if ( v10 )
{
v11 = GameManager::sharedState(v10);
v10 = (GameManager *)(***(__int64 (__fastcall ****)(_QWORD))(v11 + 952))(*(_QWORD *)(v11 + 952));
}
v12 = "Music";
goto LABEL_14;
}
LABEL_28:
v19 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine((FMODAudioEngine *)v6);
v20 = FMODAudioEngine::setEffectsVolume(v19, v7);
v10 = *(GameManager **)(GameManager::sharedState(v20) + 952);
if ( v10 )
{
v21 = GameManager::sharedState(v10);
v12 = "SFX";
v10 = (GameManager *)(***(__int64 (__fastcall ****)(_QWORD))(v21 + 952))(*(_QWORD *)(v21 + 952));
}
else
{
v12 = "SFX";
}
LABEL_14:
v13 = *(_QWORD *)(cocos2d::CCDirector::sharedDirector(v10) + 272);
if ( v13 )
{
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s Volume: %d%%",
v12,
(unsigned int)(int)(float)((float)(v7 * 100.0) + 0.5));
v23 = 0;
CString = (char *)cocos2d::CCString::getCString(v14);
v24 = 0;
v25 = nullptr;
v15 = strlen(CString);
std::string::__init(&v23, CString, v15);
v28 = 0;
v29 = 0;
v30 = nullptr;
if ( (v23 & 1) != 0 )
{
std::string::__init(&v28, v25, v24);
}
else
{
v28 = v23;
v29 = v24;
v30 = v25;
}
v26[0] = 0;
v26[1] = 0;
v27 = nullptr;
std::string::__init(v26, &byte_11B8890, 0);
v16 = (_QWORD *)TextAlertPopup::create((char *)&v28, 150, (char *)v26, 0.5, 0.6);
TextAlertPopup::replaceIn(v13, 0x564F4Cu, v16, 0x3E8u);
if ( (v26[0] & 1) != 0 )
operator delete(v27);
if ( (v28 & 1) != 0 )
operator delete(v30);
if ( (v23 & 1) != 0 )
operator delete(v25);
}
return 1;
}
return 0;
}