//
// sub_10061F0D8 from 0x10061f0d8 to 0x10061f1c8 (240 bytes)
//
// 4 xrefs:
// > sub_1005E0114 @ 0x1005e0144
// > sub_1005E0114 @ 0x1005e0154
// > sub_1005E0330 @ 0x1005e0354
// > sub_1005E0330 @ 0x1005e0364
//
// 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:10:18 +0000
//
__int64 __fastcall sub_10061F0D8(int a1, int a2, int a3)
{
pthread_mutex_t *v6; // x19
_QWORD *v7; // x24
_QWORD *i; // x25
__int64 v9; // x22
__int64 v10; // x0
__int64 v11; // x23
v6 = (pthread_mutex_t *)qword_100A3B278;
sub_1005DBDD8((pthread_mutex_t *)qword_100A3B278);
v7 = &off_1009DB980 + 3 * a1;
for ( i = (_QWORD *)*v7; i != v7; i = (_QWORD *)*i )
{
v9 = i[2];
if ( !*(_BYTE *)(v9 + 505) )
{
if ( a2 )
{
AudioQueueDispose(*(AudioQueueRef *)(v9 + 480), 1u);
*(_QWORD *)(v9 + 480) = 0;
}
if ( a3 )
{
v10 = sub_10061F1C8((void *)v9);
if ( (_DWORD)v10 || (v10 = sub_10061F48C(v9), (_DWORD)v10) )
{
v11 = v10;
goto LABEL_12;
}
}
}
}
v11 = 0;
LABEL_12:
sub_1005DBE08(v6);
return v11;
}