//
// GJBaseGameLayer::removeObjectFromSection from 0x10011cd20 to 0x10011ced8 (440 bytes)
//
// 23 xrefs:
// > PlayLayer::storeCheckpoint @ 0x10008acdf
// > PlayLayer::removeCheckpoint @ 0x10008ad7f
// > LevelEditorLayer::init @ 0x1000aab5d
// > LevelEditorLayer::init @ 0x1000aab6c
// > LevelEditorLayer::removePlayerCollisionBlock @ 0x1000abb90
// > LevelEditorLayer::removePlayerCollisionBlock @ 0x1000abba5
// > LevelEditorLayer::removeObject @ 0x1000b1a2c
// > LevelEditorLayer::removeSpecial @ 0x1000b1bc4
// > LevelEditorLayer::removeAllObjects @ 0x1000b1fcf
// > LevelEditorLayer::removeAllObjectsOfType @ 0x1000b223a
// > LevelEditorLayer::handleAction @ 0x1000b24ac
// > LevelEditorLayer::handleAction @ 0x1000b25c4
// > LevelEditorLayer::onPausePlaytest @ 0x1000c69f1
// > LevelEditorLayer::onPausePlaytest @ 0x1000c6a00
// > LevelEditorLayer::onStopPlaytest @ 0x1000c6d45
// > LevelEditorLayer::onStopPlaytest @ 0x1000c6d54
// > GJBaseGameLayer::updatePlayerCollisionBlocks @ 0x100108d6e
// > GJBaseGameLayer::updatePlayerCollisionBlocks @ 0x100108e2a
// > GJBaseGameLayer::reorderObjectSection @ 0x100108e5d
// > GJBaseGameLayer::addUIObject @ 0x10011cb92
// > GJBaseGameLayer::updateExtendedCollision @ 0x10011de75
// > GJBaseGameLayer::updateObjectSection @ 0x10011ed04
// > SetupObjectOptionsPopup::onDisableObject @ 0x100305484
//
// 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:24:36 +0000
//
__int64 __fastcall GJBaseGameLayer::removeObjectFromSection(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v3; // r8
__int64 *v4; // rcx
__int64 v5; // rax
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // rdx
__int64 v9; // rax
__int64 v10; // rcx
__int64 v11; // rdx
__int64 v12; // rax
__int64 v13; // rdx
_QWORD *v14; // rcx
__int64 v15; // rdi
__int64 *v16; // rcx
__int64 v17; // rax
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // rdx
__int64 v21; // rax
__int64 v22; // r8
__int64 *v23; // rcx
__int64 v24; // rax
__int64 v25; // rdx
__int64 v26; // rax
__int64 v27; // rcx
__int64 v28; // rdx
result = *(int *)(a2 + 628);
if ( result >= 0 )
{
v3 = *(int *)(a2 + 632);
v4 = *(__int64 **)(**(_QWORD **)(*(_QWORD *)(a1 + 13368) + 8 * result) + 8 * v3);
v5 = **(_QWORD **)(*(_QWORD *)(a1 + 13536) + 8 * result);
v6 = *(int *)(v5 + 4 * v3);
*(_DWORD *)(v5 + 4 * v3) = v6 - 1;
result = *v4;
v7 = *(_QWORD *)(*v4 + 8 * v6 - 8);
v8 = *(int *)(a2 + 620);
*(_QWORD *)(result + 8 * v8) = v7;
*(_DWORD *)(v7 + 620) = v8;
if ( *(_DWORD *)(a2 + 1028) == 1816 )
{
if ( *(_BYTE *)(a2 + 636) == 1 )
{
v9 = *(int *)(a1 + 13496);
*(_DWORD *)(a1 + 13496) = v9 - 1;
v10 = *(_QWORD *)(a1 + 13472);
LABEL_8:
result = *(_QWORD *)(v10 + 8 * v9 - 8);
v11 = *(int *)(a2 + 624);
*(_QWORD *)(v10 + 8 * v11) = result;
*(_DWORD *)(result + 624) = v11;
return result;
}
v12 = *(int *)(a2 + 628);
v13 = *(_QWORD *)(a1 + 13584);
v14 = *(_QWORD **)(*(_QWORD *)(a1 + 13416) + 8 * v12);
v15 = *(int *)(a2 + 632);
v16 = *(__int64 **)(*v14 + 8 * v15);
v17 = **(_QWORD **)(v13 + 8 * v12);
v18 = *(int *)(v17 + 4 * v15);
*(_DWORD *)(v17 + 4 * v15) = v18 - 1;
result = *v16;
v19 = *(_QWORD *)(*v16 + 8 * v18 - 8);
v20 = *(int *)(a2 + 624);
*(_QWORD *)(result + 8 * v20) = v19;
*(_DWORD *)(v19 + 624) = v20;
}
else
{
if ( *(_DWORD *)(a2 + 920) == 7 )
return result;
if ( *(_BYTE *)(a2 + 636) == 1 )
{
v9 = *(int *)(a1 + 13464);
*(_DWORD *)(a1 + 13464) = v9 - 1;
v10 = *(_QWORD *)(a1 + 13440);
goto LABEL_8;
}
v21 = *(int *)(a2 + 628);
v22 = *(int *)(a2 + 632);
v23 = *(__int64 **)(**(_QWORD **)(*(_QWORD *)(a1 + 13392) + 8 * v21) + 8 * v22);
v24 = **(_QWORD **)(*(_QWORD *)(a1 + 13560) + 8 * v21);
v25 = *(int *)(v24 + 4 * v22);
*(_DWORD *)(v24 + 4 * v22) = v25 - 1;
v26 = *v23;
v27 = *(_QWORD *)(*v23 + 8 * v25 - 8);
v28 = *(int *)(a2 + 624);
*(_QWORD *)(v26 + 8 * v28) = v27;
*(_DWORD *)(v27 + 624) = v28;
result = **(_QWORD **)(*(_QWORD *)(a1 + 13608) + 8LL * *(int *)(a2 + 628));
*(_QWORD *)(result + 8 * ((unsigned __int64)*(int *)(a2 + 632) >> 6)) |= 1LL << *(_DWORD *)(a2 + 632);
}
}
return result;
}