//
// sub_1001D989C from 0x1001d989c to 0x1001d99c8 (300 bytes)
//
// 1 xrefs:
// > SFXBrowser::sfxFolderPicked @ 0x1001f6a50
//
// 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
//
__int64 __fastcall sub_1001D989C(__int64 a1, int a2, int a3)
{
__int64 result; // x0
__int64 v6; // x20
__int64 v7; // x22
int v8; // w1
unsigned int v9; // w23
__int64 v10; // x0
__int64 v11; // x1
__int64 v12; // x0
__int64 v14; // x0
__int64 v15; // x0
if ( a2 < 2 )
return 0;
result = *(_QWORD *)(a1 + 824);
if ( result )
{
v6 = cocos2d::CCDictionary::objectForKey_1(result, (unsigned int)a2);
result = 0;
if ( a3 >= 1 )
{
if ( *(_QWORD *)(a1 + 824) )
{
v7 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 824), (unsigned int)a3);
result = 0;
if ( v6 )
{
if ( v7 )
{
if ( *(_BYTE *)(v7 + 72) == 1 )
{
v8 = *(_DWORD *)(v6 + 60);
if ( v8 != a3 )
{
if ( *(_BYTE *)(v6 + 72) == 1 )
{
v9 = 0;
v10 = v7;
do
{
if ( *(_DWORD *)(v10 + 76) == 1 || v9 > 0x63 )
break;
if ( v10 == v6 )
return 0;
v11 = *(unsigned int *)(v10 + 60);
v12 = *(_QWORD *)(a1 + 824);
if ( (int)v11 < 1 || v12 == 0 )
break;
v10 = cocos2d::CCDictionary::objectForKey_1(v12, v11);
++v9;
}
while ( v10 );
v8 = *(_DWORD *)(v6 + 60);
}
v14 = sub_1001D6784(a1, v8);
if ( v14 )
{
v15 = *(_QWORD *)(v14 + 152);
if ( v15 )
sub_1002E765C(v15, v6, 1);
}
sub_1002E74E0(*(_QWORD *)(v7 + 152), v6);
*(_DWORD *)(v6 + 60) = a3;
}
return 1;
}
else
{
return 0;
}
}
}
}
}
}
return result;
}