//
// sub_14005D870 from 0x14005d870 to 0x14005d8cc (92 bytes)
//
// 150 xrefs:
// > sub_1400530C0 @ 0x1400530db
// > sub_140053730 @ 0x1400537e7
// > sub_140053730 @ 0x1400537ff
// > sub_140053730 @ 0x140053817
// > sub_140053960 @ 0x1400539c4
// > sub_140053960 @ 0x1400539dc
// > sub_140053960 @ 0x1400539f4
// > sub_140053960 @ 0x140053a0c
// > sub_140053960 @ 0x140053a24
// > sub_140053960 @ 0x140053a3c
// > sub_140053960 @ 0x140053a54
// > sub_140053960 @ 0x140053a6c
// > sub_140053960 @ 0x140053a84
// > sub_140053960 @ 0x140053a96
// > CollisionBlockPopup::onNextItemID @ 0x14008b7f4
// > CollisionBlockPopup::onNextItemID @ 0x14008b811
// > EditorUI::copyObjects @ 0x140113150
// > EditorUI::pasteObjects @ 0x1401140a8
// > EditorUI::dynamicGroupUpdate @ 0x140118b39
// > EditorUI::dynamicGroupUpdate @ 0x140118f8f
// > EditorUI::dynamicGroupUpdate @ 0x140118fa4
// > EditorUI::dynamicGroupUpdate @ 0x140118fbd
// > EditorUI::assignNewGroups @ 0x14011932d
// > EditorUI::createLoop @ 0x1401198bd
// > EditorUI::createLoop @ 0x140119b3f
// > EditorUI::editGroup @ 0x14011f44e
// > EditorUI::onAssignNewGroupID @ 0x1401225d5
// > GameLevelManager::getStarLevelsString @ 0x1401484a7
// > GameLevelManager::getStarLevelsString @ 0x1401484ba
// > GameManager::recountUserStats @ 0x140185c7b
// > GameManager::recountUserStats @ 0x140185ca4
// > sub_1401D0F40 @ 0x1401d1091
// > sub_1401D0F40 @ 0x1401d10a9
// > sub_140204FB0 @ 0x140205054
// > sub_140204FB0 @ 0x14020518b
// > sub_140204FB0 @ 0x1402051ad
// > GJBaseGameLayer::dGJBaseGameLayer @ 0x14020618f
// > GJBaseGameLayer::dGJBaseGameLayer @ 0x14020652d
// > GJBaseGameLayer::dGJBaseGameLayer @ 0x1402069e6
// > GJBaseGameLayer::dGJBaseGameLayer @ 0x140206a16
// > GJBaseGameLayer::playKeyframeAnimation @ 0x140217e0b
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x14021a7b1
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x14021a7ca
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x14021a84e
// > GJBaseGameLayer::spawnObject @ 0x14021b142
// > GJBaseGameLayer::generateSpawnRemap @ 0x14021dfef
// > GJBaseGameLayer::generateSpawnRemap @ 0x14021e046
// > GJBaseGameLayer::generateSpawnRemap @ 0x14021e0f4
// > GJBaseGameLayer::sortGroups @ 0x1402244fe
// > GJBaseGameLayer::generateTargetGroups @ 0x140225e95
// > GJBaseGameLayer::generateTargetGroups @ 0x140225eec
// > GJBaseGameLayer::generateTargetGroups @ 0x140225f18
// > GJBaseGameLayer::generateTargetGroups @ 0x140225f2b
// > GJBaseGameLayer::generateVisibilityGroups @ 0x1402318f7
// > GJBaseGameLayer::generateVisibilityGroups @ 0x140231b53
// > GJBaseGameLayer::generateVisibilityGroups @ 0x140231b7a
// > GJBaseGameLayer::activatePersistentItemTrigger @ 0x140234b69
// > GJBaseGameLayer::preUpdateVisibility @ 0x1402373d5
// > GJBaseGameLayer::processSFXObjects @ 0x140241c12
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14024413b
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244821
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244d48
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244d61
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244d7a
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244dc5
// > sub_1402493F0 @ 0x1402494d4
// > sub_140249500 @ 0x140249540
// > sub_140249B90 @ 0x140249bc0
// > sub_14024F6B0 @ 0x14024f6d2
// > sub_140250C10 @ 0x140250c3c
// > sub_140250C10 @ 0x140250c4e
// > sub_140250C10 @ 0x140250c60
// > sub_140250FF0 @ 0x140251013
// > sub_140253320 @ 0x1402534bd
// > sub_140254AB0 @ 0x140254ad3
// > sub_14025A480 @ 0x14025a9c9
// > sub_14025A480 @ 0x14025a9ed
// > sub_14025A480 @ 0x14025aa41
// > sub_14025A480 @ 0x14025aa59
// > sub_14025A480 @ 0x14025aa71
// > sub_14025A480 @ 0x14025aa89
// > sub_14025A480 @ 0x14025aaa1
// > sub_14025A480 @ 0x14025ab77
// > sub_1402D1570 @ 0x1402d199e
// > LevelEditorLayer::getNextFreeGroupID @ 0x1402da965
// > LevelEditorLayer::getNextFreeItemID @ 0x1402daa8e
// > LevelEditorLayer::getNextFreeOrderChannel @ 0x1402dabd3
// > LevelEditorLayer::getNextFreeEditorLayer @ 0x1402dacf5
// > LevelEditorLayer::getNextFreeEnterChannel @ 0x1402dae2b
// > LevelEditorLayer::getNextFreeAreaEffectID @ 0x1402daf38
// > LevelEditorLayer::getNextFreeGradientID @ 0x1402db04b
// > LevelEditorLayer::getNextColorChannel @ 0x1402db40e
// > LevelEditorLayer::resetUnusedColorChannels @ 0x1402db77c
// > LevelEditorLayer::duplicateKeyframeAnimation @ 0x1402e1a58
// > sub_1402E2370 @ 0x1402e2e95
// > sub_1402E2EF0 @ 0x1402e32b9
// > sub_1402E2EF0 @ 0x1402e35f0
// > sub_1402E2EF0 @ 0x1402e3649
// > sub_1402E3B00 @ 0x1402e4188
// > sub_1402E3B00 @ 0x1402e4597
// > sub_1402E3B00 @ 0x1402e55e6
// > sub_1402E3B00 @ 0x1402e55ff
// > sub_1402E3B00 @ 0x1402e5618
// > sub_1402E3B00 @ 0x1402e5764
// > sub_1402E3B00 @ 0x1402e577d
// > sub_1402E3B00 @ 0x1402e5796
// > sub_1402E3B00 @ 0x1402e57af
// > sub_14033B390 @ 0x14033b465
// > sub_14033B390 @ 0x14033b47d
// > sub_14033B6E0 @ 0x14033b730
// > PlayerObject::dPlayerObject @ 0x140386665
// > PlayerObject::dPlayerObject @ 0x14038667d
// > sub_1403A5120 @ 0x1403a516a
// > sub_1403A5120 @ 0x1403a5182
// > sub_1403A5660 @ 0x1403a56ac
// > sub_1403A5660 @ 0x1403a56e8
// > sub_1403A5660 @ 0x1403a5700
// > sub_1403A5660 @ 0x1403a576c
// > PlayLayer::dPlayLayer @ 0x1403a59f7
// > PlayLayer::loadDefaultColors @ 0x1403b1f68
// > sub_1403BC3F0 @ 0x1403bc420
// > sub_1403BC3F0 @ 0x1403bc432
// > sub_1403BD650 @ 0x1403bd673
// > sub_1403BD650 @ 0x1403bd685
// > SetGroupIDLayer::onNextGroupID1 @ 0x1403fc102
// > SetGroupIDLayer::onNextFreeEditorLayer1 @ 0x1403fd012
// > SetGroupIDLayer::onNextFreeEditorLayer2 @ 0x1403fd0b2
// > SetGroupIDLayer::onNextFreeOrderChannel @ 0x1403fd912
// > SetupObjectOptions2Popup::onPlusButton @ 0x140401044
// > SetupAreaMoveTriggerPopup::onNextFreeEffectID @ 0x14040da74
// > SetupEnterEffectPopup::onNextFreeEnterChannel @ 0x1404205f4
// > SetupGradientPopup::onPlusButton @ 0x140421d27
// > SetupInteractObjectPopup::onPlusButton @ 0x1404243f3
// > SetupKeyframePopup::onCustomButton @ 0x140426b3f
// > SetupPickupTriggerPopup::onPlusButton @ 0x1404372c4
// > SetupRotateGameplayPopup::onPlusButton @ 0x140441fa4
// > SetupSFXPopup::onPlusButton @ 0x140449076
// > SetupSFXPopup::onPlusButton @ 0x140449089
// > SetupSFXPopup::onPlusButton @ 0x1404491cc
// > SetupSFXPopup::onPlusButton @ 0x1404491df
// > sub_140496170 @ 0x140496192
// > sub_140496170 @ 0x1404961aa
// > int `std::_Locinfo::_Locinfo @ 0x1404e28db
// > sub_1404F90E0 @ 0x1404f90eb
// > sub_1404F9270 @ 0x1404f927b
// > int `std::_Locinfo::_Locinfo @ 0x1404f9dab
// > ??> @ 0x140665204
// > ??> @ 0x140665214
// > ??> @ 0x1406c5598
// > ??> @ 0x1406c55a4
//
// 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_14005D870(void **a1)
{
_QWORD **v1; // rdx
_QWORD *v3; // rcx
_QWORD *v4; // rbx
v1 = (_QWORD **)*a1;
**((_QWORD **)*a1 + 1) = 0;
v3 = *v1;
if ( *v1 )
{
do
{
v4 = (_QWORD *)*v3;
j_j_free(v3);
v3 = v4;
}
while ( v4 );
}
j_j_free(*a1);
}