//
// sub_1001D7AA0 from 0x1001d7aa0 to 0x1001d7cbc (540 bytes)
//
// 2 xrefs:
// > LevelSettingsObject::objectFromDict @ 0x10040f784
// > EditorSFXManager::deserializeAll @ 0x1004c7914
//
// 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 11:00:26 +0000
//
void __fastcall sub_1001D7AA0(__int64 a1, __int64 a2, int a3)
{
_QWORD *v6; // x22
__int64 v7; // x8
__int64 v8; // x24
unsigned __int64 v9; // x25
void **v10; // x22
const char *v11; // x0
int v12; // w23
const char *v13; // x0
__int64 v14; // x0
__int64 *v15; // x8
int v16; // w9
int v17; // w9
_QWORD *v18; // x0
const char **v19; // [xsp+8h] [xbp-98h] BYREF
__int64 v20; // [xsp+10h] [xbp-90h]
__int64 v21; // [xsp+18h] [xbp-88h]
__int64 v22; // [xsp+20h] [xbp-80h] BYREF
__int64 v23; // [xsp+28h] [xbp-78h]
__int64 v24; // [xsp+30h] [xbp-70h]
void ***v25; // [xsp+40h] [xbp-60h] BYREF
void ***v26; // [xsp+48h] [xbp-58h] BYREF
if ( (a3 & 1) == 0 )
{
v6 = (_QWORD *)(a2 + 8);
sub_100076C88(a2, *(char **)(a2 + 8));
*(_QWORD *)a2 = v6;
*(_QWORD *)(a2 + 16) = 0;
*v6 = 0;
}
v7 = *(unsigned __int8 *)(a1 + 23);
if ( (v7 & 0x80u) != 0LL )
v7 = *(_QWORD *)(a1 + 8);
if ( v7 )
{
v22 = 0;
v23 = 0;
v24 = 0;
sub_1001D45F0((std::string *)a1, "|", (__int64)&v22);
if ( v23 != v22 && *(int *)(a2 + 16) <= 999 )
{
v8 = 0;
v9 = 0xAAAAAAAAAAAAAAABLL * ((v23 - v22) >> 3);
while ( 1 )
{
v19 = nullptr;
v20 = 0;
v21 = 0;
sub_1001D45F0((std::string *)(v22 + 24 * v8), ":", (__int64)&v19);
v10 = (void **)v19;
if ( 0xAAAAAAAAAAAAAAABLL * ((v20 - (__int64)v19) >> 3) < 3 )
goto LABEL_29;
v11 = (const char *)v19;
if ( *((char *)v19 + 23) < 0 )
v11 = *v19;
v12 = atoi(v11);
v13 = (const char *)(v10 + 3);
if ( *((char *)v10 + 47) < 0 )
v13 = *(const char **)v13;
v14 = atoi(v13);
if ( v12 < 1 || (int)v14 < 1 )
goto LABEL_29;
if ( (*((char *)v10 + 71) & 0x8000000000000000LL) != 0 )
break;
if ( *((_BYTE *)v10 + 71) )
goto LABEL_20;
LABEL_29:
v26 = (void ***)&v19;
sub_100018250((void ***)&v26);
if ( ++v8 >= v9 || *(int *)(a2 + 16) >= 1000 )
goto LABEL_31;
}
if ( !v10[7] )
goto LABEL_29;
LABEL_20:
v26 = (void ***)((unsigned int)v12 | (unsigned __int64)(v14 << 32));
if ( !a3 || (v15 = *(__int64 **)(a2 + 8)) == nullptr )
{
LABEL_28:
v25 = (void ***)&v26;
v18 = sub_10001AB98((__int64 **)a2, (__int64)&v26, (__int64)&unk_100761731, (__int64 **)&v25);
std::string::operator=((std::string *)(v18 + 5), (const std::string *)v10 + 2);
goto LABEL_29;
}
while ( 1 )
{
v16 = *((_DWORD *)v15 + 8);
if ( v12 >= v16 )
{
if ( v16 < v12 )
goto LABEL_26;
v17 = *((_DWORD *)v15 + 9);
if ( (int)v14 >= v17 )
break;
}
LABEL_27:
v15 = (__int64 *)*v15;
if ( !v15 )
goto LABEL_28;
}
if ( v17 >= (int)v14 )
goto LABEL_29;
LABEL_26:
++v15;
goto LABEL_27;
}
LABEL_31:
v19 = (const char **)&v22;
sub_100018250((void ***)&v19);
}
}