//
// sub_1004B592C from 0x1004b592c to 0x1004b5ad0 (420 bytes)
//
// 1 xrefs:
// > sub_1004D5434 @ 0x1004d5508
//
// 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
//
__int64 __fastcall sub_1004B592C(__int64 a1, __int64 a2, __int64 a3, __int64 a4, int a5, int a6, pthread_t *a7)
{
int v13; // w8
__int64 result; // x0
_QWORD *v15; // x0
void *v16; // x23
pthread_t v17; // [xsp+8h] [xbp-88h] BYREF
sched_param v18; // [xsp+10h] [xbp-80h] BYREF
pthread_attr_t v19; // [xsp+18h] [xbp-78h] BYREF
if ( !pthread_attr_init(&v19) && !pthread_attr_setdetachstate(&v19, 2) )
{
v18 = 0;
switch ( a5 )
{
case -32775:
v13 = 99;
goto LABEL_11;
case -32774:
v13 = 97;
goto LABEL_11;
case -32773:
v13 = 94;
goto LABEL_11;
case -32772:
v13 = 90;
goto LABEL_11;
case -32771:
v13 = 87;
goto LABEL_11;
case -32770:
v13 = 83;
LABEL_11:
v18.sched_priority = v13;
break;
default:
v18.sched_priority = a5;
break;
}
if ( !pthread_attr_setstacksize(&v19, (unsigned int)(a6 + 0x4000))
&& !pthread_attr_setschedpolicy(&v19, 4)
&& !pthread_attr_setschedparam(&v19, &v18) )
{
v15 = sub_1004B14F8(
*((__int64 **)off_1008524C8 + 54),
272,
(char)"/opt/teamcity-agent/work/570ad728b1678096/core_api/platforms/ios/src/fmod_os_misc.cpp",
440,
0);
if ( !v15 )
return 38;
v16 = v15;
*v15 = a2;
v15[1] = a3;
sub_1004C6BD0(v15 + 2, a1, 256);
if ( !pthread_create(&v17, &v19, (void *(__cdecl *)(void *))sub_1004B58C8, v16) )
{
result = pthread_attr_destroy(&v19);
if ( !(_DWORD)result )
{
*a7 = v17;
return result;
}
}
}
}
return 28;
}