//
// GJEffectManager::spawnObject from 0x5c8194 to 0x5c8314 (384 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::spawnObjectsInOrder @ 0x58fc74
//
// 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:54 +0000
//
_DWORD *__fastcall GJEffectManager::spawnObject(_DWORD *result, int a2, float a3, char **a4, int a5, int a6)
{
_DWORD *v7; // r5
unsigned int v9; // r4
double v10; // d8
int v11; // r1
int v12; // r2
unsigned int v13; // r1
unsigned int v14; // r1
int v15; // r11
_DWORD v16[2]; // [sp+0h] [bp-1Ch] BYREF
int v17; // [sp+8h] [bp-14h]
v7 = result;
if ( a2 )
{
v9 = result[169];
v10 = a3;
result = (_DWORD *)result[170];
if ( v9 >= (unsigned int)result )
{
v11 = v7[168];
v12 = -1227133513 * ((int)(v9 - v11) >> 3);
if ( (unsigned int)(v12 + 1) > 0x4924924 )
sub_388B90();
v13 = -1227133513 * (((int)result - v11) >> 3);
if ( v13 > 0x2492491 )
{
v14 = 76695844;
}
else
{
v14 = 2 * v13;
if ( v14 < v12 + 1 )
v14 = v12 + 1;
}
std::__split_buffer::__split_buffer(v16, v14, v12, (int)(v7 + 170));
v15 = v17;
if ( v17 )
{
*(_DWORD *)(v17 + 40) = a2;
*(_BYTE *)v15 = 0;
*(_BYTE *)(v15 + 1) = 0;
*(_QWORD *)(v15 + 16) = 0;
*(_DWORD *)(v15 + 24) = 0;
*(_DWORD *)(v15 + 28) = 0;
*(_DWORD *)(v15 + 32) = 0;
*(_BYTE *)(v15 + 36) = 0;
*(_DWORD *)(v15 + 44) = 0;
*(_DWORD *)(v15 + 48) = 0;
*(_DWORD *)(v15 + 52) = 0;
*(double *)(v15 + 8) = v10;
if ( (char **)(v15 + 44) != a4 )
std::vector::assign((_DWORD *)(v15 + 44), *a4, a4[1]);
*(_DWORD *)(v15 + 28) = a5;
*(_DWORD *)(v15 + 32) = a6;
}
v17 += 56;
std::vector::__swap_out_circular_buffer(v7 + 168, v16);
return (_DWORD *)std::__split_buffer::~__split_buffer((int)v16);
}
else
{
if ( v9 )
{
*(_DWORD *)(v9 + 40) = a2;
result = nullptr;
*(_BYTE *)v9 = 0;
*(_BYTE *)(v9 + 1) = 0;
*(_QWORD *)(v9 + 16) = 0;
*(_DWORD *)(v9 + 24) = 0;
*(_DWORD *)(v9 + 28) = 0;
*(_DWORD *)(v9 + 32) = 0;
*(_BYTE *)(v9 + 36) = 0;
*(_DWORD *)(v9 + 44) = 0;
*(_DWORD *)(v9 + 48) = 0;
*(_DWORD *)(v9 + 52) = 0;
*(double *)(v9 + 8) = v10;
if ( (char **)(v9 + 44) != a4 )
result = std::vector::assign((_DWORD *)(v9 + 44), *a4, a4[1]);
*(_DWORD *)(v9 + 28) = a5;
*(_DWORD *)(v9 + 32) = a6;
}
v7[169] += 56;
}
}
return result;
}