//
// sub_1001A6048 from 0x1001a6048 to 0x1001a6104 (188 bytes)
//
// 24 xrefs:
// > LevelTools::timeForPos @ 0x1001a85ac
// > LevelTools::timeForPos @ 0x1001a85d4
// > LevelTools::timeForPos @ 0x1001a8608
// > LevelTools::timeForPos @ 0x1001a87ec
// > SecretRewardsLayer::generateChestItems @ 0x1002eaf50
// > SecretRewardsLayer::generateChestItems @ 0x1002eb104
// > GJGarageLayer::setupIconSelect @ 0x10030409c
// > GJGarageLayer::onArrow @ 0x100304a58
// > GJGarageLayer::selectTab @ 0x100304b60
// > GJGarageLayer::setupPage @ 0x100304c78
// > GJGarageLayer::getItems @ 0x1003056bc
// > GameManager::calculateBaseKeyForIcons @ 0x100311e8c
// > GameManager::isIconLoaded @ 0x10031786c
// > GameManager::loadIcon @ 0x100317aec
// > GameManager::loadIcon @ 0x100317bec
// > GameManager::loadIcon @ 0x100317c1c
// > GameManager::loadIcon @ 0x100317c88
// > GameManager::unloadIcon @ 0x100317d7c
// > GameManager::unloadIcon @ 0x100317db0
// > GameManager::unloadIcon @ 0x100317de0
// > GameManager::unloadIcon @ 0x100317e08
// > GameManager::unloadIcons @ 0x1003180c4
// > EditorUI::updateObjectInfoLabel @ 0x1003e7bc8
// > EditorUI::updateObjectInfoLabel @ 0x1003e7c54
//
// 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
//
_QWORD *__fastcall sub_1001A6048(__int64 a1, int *a2, __int64 a3, unsigned int **a4)
{
__int64 v6; // x9
_QWORD *v7; // x22
int v8; // w8
_QWORD *v9; // x20
int v10; // w9
_QWORD *v11; // x23
v7 = (_QWORD *)(a1 + 8);
v6 = *(_QWORD *)(a1 + 8);
if ( v6 )
{
v8 = *a2;
while ( 1 )
{
while ( 1 )
{
v9 = (_QWORD *)v6;
v10 = *(_DWORD *)(v6 + 28);
if ( v8 >= v10 )
break;
v6 = *v9;
v7 = v9;
if ( !*v9 )
goto LABEL_10;
}
if ( v10 >= v8 )
break;
v6 = v9[1];
if ( !v6 )
{
v7 = v9 + 1;
goto LABEL_10;
}
}
}
else
{
v9 = (_QWORD *)(a1 + 8);
LABEL_10:
v11 = operator new(0x28u);
*(_QWORD *)((char *)v11 + 28) = **a4;
sub_10000A0F0((__int64 **)a1, (__int64)v9, v7, v11);
return v11;
}
return v9;
}