//
// GJBaseGameLayer::canBeActivatedByPlayer from 0x100105760 to 0x1001059bf (607 bytes)
//
// 20 xrefs:
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104b36
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104bf8
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104c3e
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104c78
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104d34
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104db1
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104e5b
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104ea1
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104f28
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104fd8
// > GJBaseGameLayer::collisionCheckObjects @ 0x100105066
// > GJBaseGameLayer::collisionCheckObjects @ 0x10010509d
// > GJBaseGameLayer::collisionCheckObjects @ 0x100105127
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001051df
// > GJBaseGameLayer::collisionCheckObjects @ 0x100105216
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001052e1
// > GJBaseGameLayer::collisionCheckObjects @ 0x10010537d
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001053b9
// > GJBaseGameLayer::bumpPlayer @ 0x1001059da
// > GJBaseGameLayer::gravBumpPlayer @ 0x100105cbb
//
// 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:31 +0000
//
char __fastcall GJBaseGameLayer::canBeActivatedByPlayer(__int64 a1, __int64 a2, _DWORD *a3)
{
_DWORD *v3; // r15
char v4; // al
_QWORD *v5; // rcx
__int64 v6; // r13
__int64 v7; // r14
__int64 *v8; // rax
int v9; // edx
int v10; // edx
__int64 v11; // r15
int v12; // edx
_QWORD *v13; // r12
int v14; // eax
int v15; // eax
int v16; // edx
char *v17; // r12
int v18; // eax
int v19; // eax
_QWORD *v20; // r15
char *v21; // rbx
__int64 v22; // rax
char *v24; // r14
__int64 v25; // rax
int v26; // [rsp+10h] [rbp-40h]
_DWORD *v27; // [rsp+18h] [rbp-38h]
_QWORD *v28; // [rsp+18h] [rbp-38h]
int v29; // [rsp+24h] [rbp-2Ch]
v3 = a3;
v4 = (*(__int64 (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)a3 + 1744LL))(a3, *(unsigned __int8 *)(a2 + 2832));
v5 = *(_QWORD **)(a1 + 1176);
v27 = v3;
if ( !v4 )
{
LODWORD(v6) = v3[229];
v7 = *(unsigned int *)(a2 + 916);
LABEL_19:
v16 = *(_DWORD *)(a1 + 944);
v29 = v16;
if ( !v5 )
{
LABEL_30:
v17 = (char *)(a1 + 1176);
v20 = (_QWORD *)(a1 + 1176);
goto LABEL_31;
}
while ( 1 )
{
v17 = (char *)v5;
v18 = *((_DWORD *)v5 + 7);
if ( (int)v6 < v18 )
goto LABEL_21;
if ( (int)v6 > v18 )
{
LABEL_26:
v5 = (_QWORD *)v5[1];
if ( !v5 )
{
v20 = v17 + 8;
LABEL_31:
v21 = v17;
v17 = (char *)operator new(0x28u);
*(_QWORD *)(v17 + 28) = (v7 << 32) | (unsigned int)v6;
*((_DWORD *)v17 + 9) = 0;
*(_OWORD *)v17 = 0;
*((_QWORD *)v17 + 2) = v21;
*v20 = v17;
v22 = **(_QWORD **)(a1 + 1168);
if ( v22 )
*(_QWORD *)(a1 + 1168) = v22;
sub_10001B680(*(__int64 **)(a1 + 1176), (__int64 *)v17);
++*(_QWORD *)(a1 + 1184);
v3 = v27;
v16 = v29;
LABEL_34:
*((_DWORD *)v17 + 9) = v16;
return (*(__int64 (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v3 + 1544LL))(v3, a2) ^ 1;
}
}
else
{
v19 = *((_DWORD *)v5 + 8);
if ( (int)v7 >= v19 )
{
if ( (int)v7 <= v19 )
goto LABEL_34;
goto LABEL_26;
}
LABEL_21:
v5 = (_QWORD *)*v5;
if ( !*(_QWORD *)v17 )
{
v20 = v17;
goto LABEL_31;
}
}
}
}
v6 = (unsigned int)v3[229];
v7 = *(unsigned int *)(a2 + 916);
if ( !v5 )
{
v29 = *(_DWORD *)(a1 + 944);
goto LABEL_30;
}
v8 = *(__int64 **)(a1 + 1176);
while ( 1 )
{
v9 = *((_DWORD *)v8 + 7);
if ( (int)v6 < v9 )
goto LABEL_5;
if ( (int)v6 <= v9 )
{
v10 = *((_DWORD *)v8 + 8);
if ( (int)v7 < v10 )
goto LABEL_5;
if ( (int)v7 <= v10 )
break;
}
++v8;
LABEL_5:
v8 = (__int64 *)*v8;
if ( !v8 )
goto LABEL_19;
}
v11 = v7 << 32;
v12 = *(_DWORD *)(a1 + 944);
do
{
while ( 1 )
{
v13 = v5;
v14 = *((_DWORD *)v5 + 7);
if ( (int)v6 < v14 )
goto LABEL_11;
if ( (int)v6 <= v14 )
break;
LABEL_16:
v5 = (_QWORD *)v5[1];
if ( !v5 )
{
v26 = *(_DWORD *)(a1 + 944);
v28 = v13 + 1;
goto LABEL_36;
}
}
v15 = *((_DWORD *)v5 + 8);
if ( (int)v7 >= v15 )
{
if ( (int)v7 <= v15 )
{
v24 = (char *)v5;
goto LABEL_39;
}
goto LABEL_16;
}
LABEL_11:
v5 = (_QWORD *)*v5;
}
while ( *v13 );
v26 = *(_DWORD *)(a1 + 944);
v28 = v13;
LABEL_36:
v24 = (char *)operator new(0x28u);
*(_QWORD *)(v24 + 28) = v6 | v11;
*((_DWORD *)v24 + 9) = 0;
*(_OWORD *)v24 = 0;
*((_QWORD *)v24 + 2) = v13;
*v28 = v24;
v25 = **(_QWORD **)(a1 + 1168);
if ( v25 )
*(_QWORD *)(a1 + 1168) = v25;
sub_10001B680(*(__int64 **)(a1 + 1176), (__int64 *)v24);
++*(_QWORD *)(a1 + 1184);
v12 = v26;
LABEL_39:
*((_DWORD *)v24 + 9) = v12;
return 0;
}