//
// sub_1000D8E78 from 0x1000d8e78 to 0x1000d8f30 (184 bytes)
//
// 46 xrefs:
// > GJLevelList::hasMatchingLevels @ 0x1000d63d4
// > CustomSongWidget::processNextMultiAsset @ 0x100122fe0
// > sub_1001400F0 @ 0x10014015c
// > sub_100140250 @ 0x1001402bc
// > PlayLayer::scanDynamicSaveObjects @ 0x100140474
// > PlayLayer::scanDynamicSaveObjects @ 0x10014048c
// > PlayLayer::scanDynamicSaveObjects @ 0x1001404b4
// > GJKeybindManager::bindChord @ 0x10018beac
// > GJKeybindManager::bindChord @ 0x10018bed8
// > GJKeybindManager::applyMovementOverride @ 0x10018c140
// > GJKeybindManager::applyMovementOverride @ 0x10018c22c
// > GJKeybindManager::buildBindsBlob @ 0x10018d394
// > sub_1001D6594 @ 0x1001d664c
// > sub_1001D6594 @ 0x1001d66a8
// > sub_1001D852C @ 0x1001d85b8
// > sub_1001DDC00 @ 0x1001ddcd8
// > sub_1001F3B74 @ 0x1001f3ca8
// > SFXBrowser::cellPerformedAction @ 0x1001f7e84
// > sub_10024A580 @ 0x10024a608
// > SetupKeyframePopup::onCustomButton @ 0x10024a994
// > GJBaseGameLayer::addRemapTargets @ 0x10027a164
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a5e0
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a618
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a644
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a670
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a688
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a6a0
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a6bc
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a6d4
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a6f0
// > GJBaseGameLayer::optimizeMoveGroups @ 0x10027a708
// > GJBaseGameLayer::prepareSavePositionObjects @ 0x10027b034
// > GJBaseGameLayer::calculateColorGroups @ 0x10027c9c4
// > GJBaseGameLayer::activateSFXEditTrigger @ 0x1002a0000
// > LevelEditorLayer::getSongIDs @ 0x1003fe4d8
// > LevelEditorLayer::getSongIDs @ 0x1003fe52c
// > LevelEditorLayer::getSFXIDs @ 0x1003fea88
// > LevelSettingsObject::objectFromDict @ 0x10040f924
// > EventLinkTrigger::customObjectSetup @ 0x10043519c
// > EditorUI::updateObjectInfoLabel @ 0x1004759d0
// > SelectEventLayer::onCustomToggleTriggerValue @ 0x100489a84
// > KeybindSet::bindChord @ 0x1004f1e4c
// > sub_100528C08 @ 0x100528c90
// > sub_100529A80 @ 0x100529b34
// > sub_100549F0C @ 0x100549f5c
// > AccountReviewPopup::FLAlert_Clicked @ 0x10054acac
//
// This function is hookable on this platform (idp: arm, 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 10:58:57 +0000
//
_DWORD *__fastcall sub_1000D8E78(__int64 a1, int *a2, _DWORD *a3)
{
__int64 v5; // x9
_QWORD *v6; // x22
int v7; // w8
_QWORD *v8; // x21
int v9; // w9
_DWORD *v10; // x23
v6 = (_QWORD *)(a1 + 8);
v5 = *(_QWORD *)(a1 + 8);
if ( v5 )
{
v7 = *a2;
while ( 1 )
{
while ( 1 )
{
v8 = (_QWORD *)v5;
v9 = *(_DWORD *)(v5 + 28);
if ( v7 >= v9 )
break;
v5 = *v8;
v6 = v8;
if ( !*v8 )
goto LABEL_10;
}
if ( v9 >= v7 )
break;
v5 = v8[1];
if ( !v5 )
{
v6 = v8 + 1;
goto LABEL_10;
}
}
}
else
{
v8 = (_QWORD *)(a1 + 8);
LABEL_10:
v10 = operator new(0x20u);
v10[7] = *a3;
sub_10000A0F0((__int64 **)a1, (__int64)v8, v6, v10);
return v10;
}
return v8;
}