//
// LevelEditorLayer::addTriggersWithTargetGroupID from 0x1000c1490 to 0x1000c19c9 (1337 bytes)
//
// 0 xrefs:
//
// 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:20:34 +0000
//
unsigned __int64 __fastcall LevelEditorLayer::addTriggersWithTargetGroupID(
__int64 a1,
_QWORD *a2,
__int64 *a3,
__int64 a4,
_QWORD *a5,
int a6)
{
unsigned __int64 result; // rax
int **v9; // r13
int **v10; // r15
int *v11; // rbx
int *v12; // r11
unsigned __int64 v13; // rdi
unsigned __int64 v14; // rcx
unsigned __int64 v15; // r10
__int64 v16; // rsi
__int64 *v17; // r8
unsigned __int64 v18; // rdi
unsigned __int64 v19; // rdi
int v20; // ebx
__int64 v21; // rcx
unsigned __int64 v22; // rdx
unsigned __int64 v23; // r8
unsigned __int64 v24; // rsi
__int64 v25; // r11
__int64 **v26; // rax
__int64 *v27; // r10
int *v28; // r11
__int64 **v29; // rbx
_QWORD *v30; // r15
_QWORD *v31; // r12
int v32; // r14d
unsigned __int64 v33; // rsi
__int64 *v34; // r10
unsigned __int64 v35; // rdi
int *v36; // [rsp+8h] [rbp-68h] BYREF
int **v37; // [rsp+10h] [rbp-60h]
__int64 v38; // [rsp+18h] [rbp-58h]
__int64 *v39; // [rsp+20h] [rbp-50h]
int v40; // [rsp+2Ch] [rbp-44h] BYREF
int v41; // [rsp+30h] [rbp-40h]
int v42; // [rsp+34h] [rbp-3Ch]
int *v43; // [rsp+38h] [rbp-38h]
char v44[41]; // [rsp+47h] [rbp-29h] BYREF
v38 = a4;
v39 = a3;
result = *(_QWORD *)(a1 + 3280);
if ( result )
{
result = *(_QWORD *)(result + 56);
if ( *(_DWORD *)result )
{
v9 = *(int ***)(result + 16);
v10 = &v9[*(unsigned int *)result - 1];
v39 += 2;
do
{
v12 = *v9;
if ( !*v9 )
return result;
if ( v12[312] != 1 || a6 > 0 && v12[257] != a6 )
goto LABEL_5;
v13 = a5[1];
if ( !v13 )
goto LABEL_37;
v14 = v12[229];
v15 = (0x101010101010101LL
* ((((v13 - ((v13 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v13 - ((v13 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v13 - ((v13 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v13 - ((v13 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v15 > 1 )
{
v16 = v12[229];
if ( v13 > v14 )
goto LABEL_17;
if ( (v13 | v14) >> 32 )
{
v16 = v14 % v13;
LABEL_17:
result = *(_QWORD *)(*a5 + 8 * v16);
if ( !result )
goto LABEL_37;
goto LABEL_18;
}
v16 = (unsigned int)v14 % (unsigned int)v13;
result = *(_QWORD *)(*a5 + 8 * v16);
if ( !result )
goto LABEL_37;
}
else
{
v16 = v14 & (v13 - 1);
result = *(_QWORD *)(*a5 + 8 * v16);
if ( !result )
goto LABEL_37;
}
LABEL_18:
v17 = *(__int64 **)result;
if ( *(_QWORD *)result )
{
if ( (unsigned int)v15 < 2 )
{
v18 = v13 - 1;
while ( 1 )
{
result = v17[1];
if ( result == v14 )
{
if ( *((_DWORD *)v17 + 4) == (_DWORD)v14 )
goto LABEL_5;
}
else
{
result &= v18;
if ( result != v16 )
goto LABEL_37;
}
v17 = (__int64 *)*v17;
if ( !v17 )
goto LABEL_37;
}
}
while ( 1 )
{
result = v17[1];
if ( result == v14 )
{
if ( *((_DWORD *)v17 + 4) == (_DWORD)v14 )
goto LABEL_5;
goto LABEL_22;
}
if ( result < v13 )
goto LABEL_27;
if ( (v13 | result) >> 32 )
break;
result = (unsigned int)result % (unsigned int)v13;
if ( result != v16 )
goto LABEL_37;
LABEL_22:
v17 = (__int64 *)*v17;
if ( !v17 )
goto LABEL_37;
}
result %= v13;
LABEL_27:
if ( result != v16 )
goto LABEL_37;
goto LABEL_22;
}
LABEL_37:
v19 = a2[1];
if ( !v19 )
goto LABEL_5;
v20 = v12[366];
v21 = v20;
v22 = ((v19 - ((v19 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v19 - ((v19 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL);
v23 = (0x101010101010101LL * ((v22 + (v22 >> 4)) & 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v23 > 1 )
{
v24 = v20;
if ( v19 <= v20 )
{
if ( (v19 | v20) >> 32 )
v22 = v20 % v19;
else
v22 = v20 % (unsigned int)v19;
v24 = v22;
}
}
else
{
v24 = v20 & (v19 - 1);
}
v43 = *v9;
v25 = *a2;
v26 = *(__int64 ***)(*a2 + 8 * v24);
if ( !v26 || (v27 = *v26) == nullptr )
{
LABEL_69:
v20 = v43[367];
v21 = v20;
if ( (unsigned int)v23 <= 1 )
{
v33 = v20 & (v19 - 1);
result = *(_QWORD *)(v25 + 8 * v33);
v28 = v43;
if ( !result )
goto LABEL_5;
goto LABEL_76;
}
v33 = v20;
if ( v19 > v20 )
{
LABEL_75:
result = *(_QWORD *)(v25 + 8 * v33);
v28 = v43;
if ( !result )
goto LABEL_5;
goto LABEL_76;
}
if ( (v19 | v20) >> 32 )
{
v22 = v20 % v19;
v33 = v22;
goto LABEL_75;
}
v22 = v20 % (unsigned int)v19;
v33 = v22;
result = *(_QWORD *)(v25 + 8 * v22);
v28 = v43;
if ( !result )
goto LABEL_5;
LABEL_76:
v34 = *(__int64 **)result;
if ( !*(_QWORD *)result )
goto LABEL_5;
if ( (unsigned int)v23 < 2 )
{
v35 = v19 - 1;
while ( 1 )
{
result = v34[1];
if ( result == v20 )
{
if ( *((_DWORD *)v34 + 4) == v20 )
goto LABEL_54;
}
else
{
result &= v35;
if ( result != v33 )
goto LABEL_5;
}
v34 = (__int64 *)*v34;
if ( !v34 )
goto LABEL_5;
}
}
while ( 2 )
{
result = v34[1];
if ( result == v20 )
{
if ( *((_DWORD *)v34 + 4) == v20 )
goto LABEL_54;
}
else if ( result < v19 )
{
LABEL_85:
if ( result != v33 )
goto LABEL_5;
}
else
{
if ( (v19 | result) >> 32 )
{
v22 = result % v19;
result %= v19;
goto LABEL_85;
}
v22 = (unsigned int)result % (unsigned int)v19;
result = v22;
if ( v22 != v33 )
goto LABEL_5;
}
v34 = (__int64 *)*v34;
if ( !v34 )
goto LABEL_5;
continue;
}
}
if ( (unsigned int)v23 < 2 )
{
result = v19 - 1;
while ( 1 )
{
v22 = v27[1];
if ( v22 == v20 )
{
if ( *((_DWORD *)v27 + 4) == v20 )
goto LABEL_53;
}
else
{
v22 &= result;
if ( v22 != v24 )
goto LABEL_69;
}
v27 = (__int64 *)*v27;
if ( !v27 )
goto LABEL_69;
}
}
while ( 1 )
{
result = v27[1];
if ( result == v20 )
break;
if ( result >= v19 )
{
if ( (v19 | result) >> 32 )
{
v22 = result % v19;
result %= v19;
}
else
{
v22 = (unsigned int)result % (unsigned int)v19;
result = v22;
}
}
if ( result != v24 )
goto LABEL_69;
LABEL_62:
v27 = (__int64 *)*v27;
if ( !v27 )
goto LABEL_69;
}
if ( *((_DWORD *)v27 + 4) != v20 )
goto LABEL_62;
LABEL_53:
v28 = v43;
LABEL_54:
v41 = v20;
if ( v20 > 0 )
{
if ( v28[257] == 1268 )
{
v29 = (__int64 **)v39;
v37 = v10;
while ( 1 )
{
v29 = (__int64 **)*v29;
if ( !v29 )
break;
v30 = a2;
v31 = a5;
v32 = a6;
result = SpawnTriggerGameObject::getRemapWithSource(v28, *((unsigned int *)v29 + 4), v22, v21);
v28 = v43;
a6 = v32;
a5 = v31;
a2 = v30;
v10 = v37;
if ( result )
goto LABEL_5;
}
}
v42 = a6;
v11 = v28;
sub_1007FEBF0(v38, v28);
v40 = v11[229];
v36 = &v40;
result = sub_1000E12B0(a5, &v40, &unk_100A04AD3, &v36, v44);
a6 = v42;
*(_DWORD *)(result + 20) = v41;
}
LABEL_5:
++v9;
}
while ( v9 <= v10 );
}
}
return result;
}