//
// sub_100583D50 from 0x100583d50 to 0x100583dc8 (120 bytes)
//
// 2 xrefs:
// > sub_1005927AC @ 0x10059291c
// > sub_1005F4FC0 @ 0x1005f5130
//
// 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:08:31 +0000
//
__int64 __fastcall sub_100583D50(_QWORD *a1)
{
__int64 v2; // x8
unsigned int *v3; // x8
unsigned int v4; // w9
unsigned int *v5; // x8
unsigned int v6; // w9
__int64 result; // x0
sub_1005823CC((__int64)a1, 83);
v2 = a1[14];
if ( !v2 )
goto LABEL_8;
v3 = (unsigned int *)(v2 + 100);
do
v4 = __ldaxr(v3);
while ( __stlxr(v4 & 0xFFFFFFDF, v3) );
v5 = (unsigned int *)(a1[14] + 100LL);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 & 0xFFFFFFBF, v5) );
result = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[14] + 16LL))(a1[14]);
if ( !(_DWORD)result )
{
a1[14] = 0;
LABEL_8:
a1[12] = 0;
a1[13] = 0;
return 0;
}
return result;
}