//
// GameSettingsLayer::getValue from 0x100602710 to 0x1006028db (459 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b7f4f8
//
// 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:34:31 +0000
//
float __fastcall GameSettingsLayer::getValue(_QWORD *a1, int a2)
{
__int64 v3; // rax
unsigned __int64 v5; // r9
unsigned __int64 v6; // r10
unsigned __int64 v7; // r8
__int64 **v8; // rax
__int64 *v9; // rbx
unsigned __int64 v10; // r9
unsigned __int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
switch ( a2 )
{
case -4:
return *(float *)(GameManager::sharedState() + 1108);
case -3:
return (float)*(int *)(FMODAudioEngine::sharedEngine() + 548);
case -2:
v3 = GameStatsManager::sharedState();
return (float)(unsigned __int8)GameStatsManager::isItemEnabled(v3, 12, 0x11u);
case -1:
return (float)*(char *)(GameManager::sharedState() + 924);
default:
v5 = a1[139];
if ( !v5 )
return SetupTriggerPopup::getValue(a1, a2);
v6 = (0x101010101010101LL
* ((((v5 - ((v5 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v5 - ((v5 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v5 - ((v5 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v5 - ((v5 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v6 > 1 )
{
v7 = a2;
if ( v5 <= a2 )
{
if ( (v5 | a2) >> 32 )
v7 = a2 % v5;
else
v7 = a2 % (unsigned int)v5;
}
}
else
{
v7 = a2 & (v5 - 1);
}
v8 = *(__int64 ***)(a1[138] + 8 * v7);
if ( !v8 )
return SetupTriggerPopup::getValue(a1, a2);
v9 = *v8;
if ( !*v8 )
return SetupTriggerPopup::getValue(a1, a2);
if ( (unsigned int)v6 < 2 )
{
v10 = v5 - 1;
while ( 1 )
{
v12 = v9[1];
if ( v12 == a2 )
{
if ( *((_DWORD *)v9 + 4) == a2 )
goto LABEL_33;
}
else if ( (v10 & v12) != v7 )
{
return SetupTriggerPopup::getValue(a1, a2);
}
v9 = (__int64 *)*v9;
if ( !v9 )
return SetupTriggerPopup::getValue(a1, a2);
}
}
break;
}
while ( 1 )
{
v11 = v9[1];
if ( v11 == a2 )
break;
if ( v11 < v5 )
goto LABEL_24;
if ( (v5 | v11) >> 32 )
{
v11 %= v5;
LABEL_24:
if ( v11 != v7 )
return SetupTriggerPopup::getValue(a1, a2);
goto LABEL_19;
}
if ( (unsigned int)v11 % (unsigned int)v5 != v7 )
return SetupTriggerPopup::getValue(a1, a2);
LABEL_19:
v9 = (__int64 *)*v9;
if ( !v9 )
return SetupTriggerPopup::getValue(a1, a2);
}
if ( *((_DWORD *)v9 + 4) != a2 )
goto LABEL_19;
LABEL_33:
v13 = GameManager::sharedState();
return (float)(unsigned __int8)GameManager::getGameVariable(v13, (const std::string::value_type *)v9[3]);
}