//
// sub_1008E3AE0 from 0x1008e3ae0 to 0x1008e3c2b (331 bytes)
//
// 1 xrefs:
// > EditorSFXSettingsPopup::getValue @ 0x1008eedb9
//
// 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:37:47 +0000
//
float __fastcall sub_1008E3AE0(__int64 a1, int a2)
{
unsigned __int64 v2; // r9
float result; // xmm0_4
unsigned __int64 v4; // r10
unsigned __int64 v5; // r8
float **v6; // rax
float *v7; // rdi
unsigned __int64 v8; // r9
__int64 v9; // rax
unsigned __int64 v10; // rax
v2 = *(_QWORD *)(a1 + 88);
result = 0.0;
if ( v2 )
{
v4 = (0x101010101010101LL
* ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v4 > 1 )
{
v5 = a2;
if ( v2 <= a2 )
{
if ( (v2 | a2) >> 32 )
v5 = a2 % v2;
else
v5 = a2 % (unsigned int)v2;
}
}
else
{
v5 = a2 & (v2 - 1);
}
v6 = *(float ***)(*(_QWORD *)(a1 + 80) + 8 * v5);
if ( v6 )
{
v7 = *v6;
if ( *v6 )
{
if ( (unsigned int)v4 < 2 )
{
v8 = v2 - 1;
while ( 1 )
{
v9 = *((_QWORD *)v7 + 1);
if ( v9 == a2 )
{
if ( *((_DWORD *)v7 + 4) == a2 )
return v7[5];
}
else if ( (v8 & v9) != v5 )
{
return result;
}
v7 = *(float **)v7;
if ( !v7 )
return result;
}
}
do
{
v10 = *((_QWORD *)v7 + 1);
if ( v10 == a2 )
{
if ( *((_DWORD *)v7 + 4) == a2 )
return v7[5];
}
else
{
if ( v10 < v2 )
goto LABEL_23;
if ( (v2 | v10) >> 32 )
{
v10 %= v2;
LABEL_23:
if ( v10 != v5 )
return result;
goto LABEL_18;
}
if ( (unsigned int)v10 % (unsigned int)v2 != v5 )
return result;
}
LABEL_18:
v7 = *(float **)v7;
}
while ( v7 );
}
}
}
return result;
}