//
// GJBaseGameLayer::spawnGroup from 0x10010a4d0 to 0x10010a76f (671 bytes)
//
// 4 xrefs:
// > sub_10010A8E0 @ 0x10010a8ec
// > ??> @ 0x100abafe0
// > ??> @ 0x100ac3df8
// > ??> @ 0x100ac50a8
//
// 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:21:33 +0000
//
__int64 __fastcall GJBaseGameLayer::spawnGroup(
__int64 a1,
__int64 a2,
char a3,
_QWORD *a4,
unsigned int a5,
unsigned int a6,
double a7)
{
int v10; // r15d
__int64 *v12; // rdi
__int64 result; // rax
__int64 v14; // rax
__int64 v15; // r13
int v16; // esi
__int64 *v17; // rax
__int64 *v18; // rcx
int v19; // edx
int v20; // edx
_QWORD *v21; // r12
__int64 *v22; // r14
int v23; // eax
int v24; // eax
char *v25; // rax
__int64 v26; // rcx
int v27; // eax
__int64 v28; // r13
__int64 v29; // r15
_QWORD *v30; // r12
__int64 v31; // r15
unsigned __int64 v32; // r14
unsigned __int64 v33; // r15
__int64 v34; // rsi
bool v35; // cc
_QWORD *v36; // [rsp+8h] [rbp-48h]
unsigned int v38; // [rsp+20h] [rbp-30h]
unsigned int v39; // [rsp+24h] [rbp-2Ch]
v10 = a2;
v12 = *(__int64 **)(a1 + 2152);
result = GJEffectManager::isGroupEnabled(v12, a2);
if ( !(_BYTE)result || *(_BYTE *)(a1 + 13096) )
return result;
v39 = a5;
v14 = a4[1];
v15 = 0;
v16 = 0;
if ( *a4 != v14 )
v16 = -*(_DWORD *)(v14 - 4);
if ( *(_BYTE *)(a1 + 1979) )
v15 = v39;
v17 = *(__int64 **)(a1 + 4088);
v36 = a4;
v38 = a6;
if ( !v17 )
{
v21 = (_QWORD *)(a1 + 4088);
v22 = (__int64 *)(a1 + 4088);
goto LABEL_31;
}
v18 = *(__int64 **)(a1 + 4088);
do
{
if ( *((_DWORD *)v18 + 7) <= v10 )
{
if ( *((_DWORD *)v18 + 7) < v10 )
goto LABEL_10;
v19 = *((_DWORD *)v18 + 8);
if ( (int)v15 >= v19 )
{
if ( (int)v15 > v19 )
goto LABEL_10;
v20 = *((_DWORD *)v18 + 9);
if ( v16 >= v20 )
{
if ( v16 <= v20 )
{
result = *(unsigned int *)(a1 + 13092);
*(_DWORD *)(a1 + 13092) = result + 1;
if ( (int)result >= 10000 )
*(_BYTE *)(a1 + 13096) = 1;
return result;
}
LABEL_10:
++v18;
}
}
}
v18 = (__int64 *)*v18;
}
while ( v18 );
do
{
while ( 1 )
{
v22 = v17;
if ( *((_DWORD *)v17 + 7) <= v10 )
break;
LABEL_20:
v17 = (__int64 *)*v22;
v21 = v22;
if ( !*v22 )
goto LABEL_31;
}
if ( *((_DWORD *)v17 + 7) >= v10 )
{
v23 = *((_DWORD *)v17 + 8);
if ( (int)v15 < v23 )
goto LABEL_20;
if ( (int)v15 <= v23 )
{
v24 = *((_DWORD *)v22 + 9);
if ( v16 < v24 )
goto LABEL_20;
if ( v16 <= v24 )
goto LABEL_34;
}
}
v17 = (__int64 *)v22[1];
}
while ( v17 );
v21 = v22 + 1;
LABEL_31:
v25 = (char *)operator new(0x28u);
*(_QWORD *)(v25 + 28) = (v15 << 32) | (unsigned int)v10;
*((_DWORD *)v25 + 9) = v16;
*(_OWORD *)v25 = 0;
*((_QWORD *)v25 + 2) = v22;
*v21 = v25;
v26 = **(_QWORD **)(a1 + 4080);
if ( v26 )
*(_QWORD *)(a1 + 4080) = v26;
v12 = *(__int64 **)(a1 + 4088);
sub_10001B680(v12, (__int64 *)v25);
++*(_QWORD *)(a1 + 4096);
LABEL_34:
v27 = 9999;
if ( v10 < 9999 )
v27 = v10;
v28 = 0;
if ( v27 > 0 )
v28 = (unsigned int)v27;
result = *(_QWORD *)(a1 + 3616);
v29 = *(_QWORD *)(result + 8 * v28);
if ( v29 )
{
v30 = v36;
if ( a3 )
return GJBaseGameLayer::spawnObjectsInOrder(a1, v29, v30, v39, v38, a7);
LABEL_42:
if ( v29 )
{
result = *(_QWORD *)(v29 + 56);
if ( *(_DWORD *)result )
{
v31 = *(_QWORD *)(result + 16);
v32 = v31 + 8LL * *(unsigned int *)result - 8;
v33 = v31 + 8;
do
{
v34 = *(_QWORD *)(v33 - 8);
if ( !v34 )
break;
result = (*(__int64 (__fastcall **)(__int64, __int64, _QWORD *, double))(*(_QWORD *)a1 + 1264LL))(
a1,
v34,
v30,
a7);
if ( *(_BYTE *)(a1 + 13096) )
break;
result = v33 + 8;
v35 = v33 <= v32;
v33 += 8LL;
}
while ( v35 );
}
}
}
else
{
v29 = sub_1007FE900(v12);
cocos2d::CCDictionary::setObject_1(*(_QWORD *)(a1 + 3592), v29, v28);
result = *(_QWORD *)(a1 + 3616);
*(_QWORD *)(result + 8 * v28) = v29;
v30 = v36;
if ( !a3 )
goto LABEL_42;
return GJBaseGameLayer::spawnObjectsInOrder(a1, v29, v30, v39, v38, a7);
}
return result;
}