//
// sub_1000115B8 from 0x1000115b8 to 0x100011688 (208 bytes)
//
// 79 xrefs:
// > GJEffectManager::processCopyColorPulseActions @ 0x10000f640
// > GJEffectManager::createKeyframeCommand @ 0x100011154
// > GJEffectManager::createKeyframeCommand @ 0x100011160
// > GJEffectManager::createKeyframeCommand @ 0x100011180
// > GJEffectManager::createKeyframeCommand @ 0x100011340
// > GJEffectManager::createKeyframeCommand @ 0x10001136c
// > GJEffectManager::getMoveCommandNode @ 0x1000114a8
// > GJEffectManager::getTempGroupCommand @ 0x100012a38
// > GJEffectManager::getTempGroupCommand @ 0x100012a50
// > GJEffectManager::registerRotationCommand @ 0x100012b20
// > GJEffectManager::registerRotationCommand @ 0x100012b2c
// > GJEffectManager::resetTempGroupCommands @ 0x100012bd4
// > GJEffectManager::prepareMoveActions @ 0x100012d08
// > GJEffectManager::prepareMoveActions @ 0x100012d90
// > GJEffectManager::prepareMoveActions @ 0x100012e18
// > GJEffectManager::prepareMoveActions @ 0x100012f50
// > GJEffectManager::prepareMoveActions @ 0x100013088
// > GJEffectManager::prepareMoveActions @ 0x10001315c
// > GJEffectManager::prepareMoveActions @ 0x100013180
// > GJEffectManager::prepareMoveActions @ 0x10001378c
// > GJEffectManager::prepareMoveActions @ 0x1000137d0
// > SetupRandAdvTriggerPopup::updateGroupIDButtons @ 0x10002efbc
// > SetupRandAdvTriggerPopup::updateGroupIDButtons @ 0x10002f0e8
// > SetupSpawnPopup::updateRemapButtons @ 0x1000f89f8
// > PlayLayer::scanDynamicSaveObjects @ 0x100117860
// > PlayLayer::scanDynamicSaveObjects @ 0x100117934
// > PlayLayer::scanDynamicSaveObjects @ 0x100117980
// > PlayLayer::scanDynamicSaveObjects @ 0x1001179e0
// > PlayLayer::scanActiveSaveObjects @ 0x100117b00
// > PlayLayer::scanActiveSaveObjects @ 0x100117b2c
// > FMODAudioEngine::updateTemporaryEffects @ 0x1001391a0
// > FMODAudioEngine::channelStopped @ 0x10013c2f8
// > FMODAudioEngine::stopChannel @ 0x10013c410
// > FMODAudioEngine::unloadAllEffects @ 0x10013cd2c
// > FMODAudioEngine::stopAndRemoveMusic @ 0x10013e814
// > DS_Dictionary::DS_Dictionary @ 0x100160f34
// > DS_Dictionary::loadRootSubDictFromString @ 0x1001610a8
// > DS_Dictionary::stepIntoSubDictWithKey @ 0x100161600
// > DS_Dictionary::setSubDictForKey @ 0x100161d18
// > DS_Dictionary::getObjectForKey @ 0x100162964
// > DS_Dictionary::getDictForKey @ 0x10016312c
// > GJBaseGameLayer::sortGroups @ 0x1001dfe58
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x1001e0340
// > GJBaseGameLayer::generateVisibilityGroups @ 0x1001e1e64
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e80d0
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001e80f8
// > GJBaseGameLayer::controlTriggersWithControlID @ 0x1001ee584
// > GJBaseGameLayer::addUIObject @ 0x1001f3220
// > GJBaseGameLayer::addToSection @ 0x1001f36e4
// > GJBaseGameLayer::addToSection @ 0x1001f38b0
// > GJBaseGameLayer::addToSection @ 0x1001f3a20
// > GJBaseGameLayer::addToSection @ 0x1001f3a50
// > GJBaseGameLayer::addToSection @ 0x1001f3a8c
// > GJBaseGameLayer::resetAreaObjectValues @ 0x1001f4cac
// > GJBaseGameLayer::processAreaActions @ 0x1001f6414
// > GJBaseGameLayer::processDynamicObjectActions @ 0x1001f7280
// > GJBaseGameLayer::addObjectCounter @ 0x1001fb9e4
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fdc0c
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fdd28
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fdd6c
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fdec4
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fdfa0
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fdfe4
// > GJBaseGameLayer::preUpdateVisibility @ 0x1001fe0a0
// > GJBaseGameLayer::activateSongTrigger @ 0x100202dec
// > GJBaseGameLayer::activateSongEditTrigger @ 0x100202f34
// > GJBaseGameLayer::activateSFXTrigger @ 0x10020300c
// > GJBaseGameLayer::activateSFXEditTrigger @ 0x1002031a0
// > GameStatsManager::tryFixPathBug @ 0x10032ff90
// > LevelEditorLayer::updateGameObjects @ 0x100358bd4
// > LevelEditorLayer::resetDelayedSpawnNodes @ 0x100360a74
// > LevelEditorLayer::stopTriggersInGroup @ 0x1003617a4
// > LevelEditorLayer::getDelayedSpawnNode @ 0x100361850
// > LevelEditorLayer::updateDisabledObjectsLastPos @ 0x100362a2c
// > sub_100365890 @ 0x100365a28
// > sub_100365890 @ 0x100365ac4
// > sub_100365890 @ 0x100365b38
// > sub_100365890 @ 0x1003667c8
// > EditorUI::pasteObjects @ 0x1003ecb24
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall sub_1000115B8(__int64 a1, _QWORD *a2)
{
unsigned __int64 v4; // x8
_QWORD *v5; // x21
_QWORD *v6; // x21
__int64 v7; // x21
__int64 v8; // x8
__int64 v9; // x9
__int64 v10; // x1
__int64 v11; // x0
_QWORD *v12; // x8
__int64 v13; // x22
size_t v14; // x2
char *v15; // x20
void *v16; // x0
v5 = *(_QWORD **)(a1 + 8);
v4 = *(_QWORD *)(a1 + 16);
if ( (unsigned __int64)v5 >= v4 )
{
v7 = ((__int64)v5 - *(_QWORD *)a1) >> 3;
if ( (unsigned __int64)(v7 + 1) >> 61 )
sub_10000A5F8();
v8 = v4 - *(_QWORD *)a1;
v9 = v8 >> 2;
if ( v8 >> 2 <= (unsigned __int64)(v7 + 1) )
v9 = v7 + 1;
if ( (unsigned __int64)v8 >= 0x7FFFFFFFFFFFFFF8LL )
v10 = 0x1FFFFFFFFFFFFFFFLL;
else
v10 = v9;
if ( v10 )
v11 = sub_1000181B8(a1);
else
v11 = 0;
v13 = v11 + 8 * v10;
v12 = (_QWORD *)(v11 + 8 * v7);
*v12 = *a2;
v6 = v12 + 1;
v14 = *(_QWORD *)(a1 + 8) - *(_QWORD *)a1;
v15 = (char *)v12 - v14;
memcpy((char *)v12 - v14, *(const void **)a1, v14);
v16 = *(void **)a1;
*(_QWORD *)a1 = v15;
*(_QWORD *)(a1 + 8) = v6;
*(_QWORD *)(a1 + 16) = v13;
if ( v16 )
operator delete(v16);
}
else
{
*v5 = *a2;
v6 = v5 + 1;
}
*(_QWORD *)(a1 + 8) = v6;
}