//
// GJBaseGameLayer::processSFXObjects from 0x5a5f90 to 0x5a61da (586 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::updateSpecialGroupData @ 0x5c153c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:53:20 +0000
//
int __fastcall GJBaseGameLayer::processSFXObjects(unsigned int this)
{
int v1; // r3
_DWORD *v2; // r6
int v3; // r7
_DWORD *v4; // r3
int *v5; // r7
int *v6; // r11
int v7; // r8
int v8; // t1
unsigned int v9; // r9
MusicDownloadManager *v10; // r0
FMODAudioEngine *v11; // r0
int v12; // r9
int *v13; // r9
unsigned int v15; // r6
unsigned int v16; // r4
unsigned int v17; // r10
int v18; // r5
_DWORD *v19; // r2
unsigned int v20; // r1
float v21; // s15
bool v22; // r5
unsigned int v23; // r5
unsigned int v24; // r1
void **v25; // r3
unsigned int v26; // r1
_BYTE v27[12]; // [sp+14h] [bp-40h] BYREF
int v28[3]; // [sp+20h] [bp-34h] BYREF
void *v29; // [sp+2Ch] [bp-28h] BYREF
int v30; // [sp+38h] [bp-1Ch] BYREF
unsigned int v31; // [sp+3Ch] [bp-18h]
_DWORD *v32; // [sp+40h] [bp-14h] BYREF
int v33; // [sp+44h] [bp-10h]
float v34; // [sp+48h] [bp-Ch]
v30 = 0;
v31 = 0;
v32 = nullptr;
v33 = 0;
v34 = 1.0;
v1 = *(_DWORD *)(this + 2088);
if ( v1 )
{
v4 = *(_DWORD **)(v1 + 52);
if ( *v4 )
{
v5 = (int *)v4[3];
v6 = &v5[*v4 - 1];
while ( 1 )
{
while ( 1 )
{
LABEL_5:
if ( v5 <= v6 )
{
v8 = *v5++;
v7 = v8;
if ( v8 )
continue;
}
goto LABEL_2;
if ( *(_DWORD *)(v7 + 892) == 3602 )
{
if ( *(_BYTE *)(v7 + 1741) )
{
v15 = *(_DWORD *)(v7 + 1660);
if ( (int)v15 > 0 )
break;
}
}
}
v16 = v31;
if ( v31 )
{
v17 = v31 - 1;
if ( ((v31 - 1) & v31) != 0 )
v18 = v15 % v31;
else
v18 = v17 & v15;
v19 = *(_DWORD **)(v30 + 4 * v18);
if ( v19 )
{
while ( 1 )
{
v19 = (_DWORD *)*v19;
if ( !v19 )
break;
this = v19[1];
if ( ((v31 - 1) & v31) != 0 )
{
v20 = this % v31;
this /= v31;
}
else
{
v20 = v17 & this;
}
if ( v20 != v18 )
break;
if ( v19[2] == v15 )
goto LABEL_5;
}
}
}
else
{
v18 = 0;
}
this = std::__hash_table,std::equal_to,std::allocator>::__construct_node_hash(
(int)&v29,
(int)&v30,
v15,
(_DWORD *)(v7 + 1660));
v21 = (float)(unsigned int)(v33 + 1);
if ( v21 > (float)((float)v16 * v34) )
{
v22 = v16 > 2 && ((v16 - 1) & v16) == 0;
}
else
{
if ( v16 )
goto LABEL_38;
v22 = 0;
}
v23 = 2 * v16 + !v22;
v24 = (unsigned int)ceilf(v21 / v34);
if ( v24 < v23 )
v24 = v23;
std::__hash_table,std::equal_to,std::allocator>::rehash((int)&v30, v24);
v16 = v31;
if ( ((v31 - 1) & v31) != 0 )
{
this = v15 / v31;
v18 = v15 % v31;
}
else
{
v18 = (v31 - 1) & v15;
}
LABEL_38:
v25 = *(void ***)(v30 + 4 * v18);
if ( v25 )
{
*(_DWORD *)v29 = *v25;
*v25 = v29;
}
else
{
*(_DWORD *)v29 = v32;
v32 = v29;
*(_DWORD *)(v30 + 4 * v18) = &v32;
if ( *(_DWORD *)v29 )
{
this = *(_DWORD *)(*(_DWORD *)v29 + 4);
if ( ((v16 - 1) & v16) != 0 )
{
v26 = this % v16;
this /= v16;
}
else
{
v26 = (v16 - 1) & this;
}
*(_DWORD *)(v30 + 4 * v26) = v29;
}
}
++v33;
}
}
}
LABEL_2:
v2 = v32;
v3 = 0;
while ( v2 )
{
v9 = v2[2];
v10 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)this);
v11 = MusicDownloadManager::pathForSFX((MusicDownloadManager *)v27, v10, v9);
v12 = FMODAudioEngine::sharedEngine(v11);
std::string::basic_string(v28, (int)v27);
v13 = FMODAudioEngine::preloadEffect(v12, (int)v28);
std::string::~string((int)v28);
if ( v13 )
{
v3 += v13[4];
if ( v3 > 120000 )
{
std::string::~string((int)v27);
return std::__hash_table,std::equal_to,std::allocator>::~__hash_table((int)&v30);
}
}
this = std::string::~string((int)v27);
v2 = (_DWORD *)*v2;
}
return std::__hash_table,std::equal_to,std::allocator>::~__hash_table((int)&v30);
}