//
// sub_826A0C from 0x826a0c to 0x826b6c (352 bytes)
//
// 2 xrefs:
// > sub_4E3160 @ 0x4e3248
// > sub_4E3160 @ 0x4e3250
//
// 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 sub_826A0C()
{
void *v0; // x0
void *v1; // x0
void *v2; // x0
unsigned int *v4; // x1
int v5; // w2
unsigned int *v6; // x1
int v7; // w2
unsigned int *v8; // x1
int v9; // w2
v0 = (void *)(qword_1242BC0 - 24);
if ( (__int64 *)(qword_1242BC0 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v4 = (unsigned int *)(qword_1242BC0 - 8);
do
v5 = __ldaxr(v4);
while ( __stlxr(v5 - 1, v4) );
}
else
{
v5 = *(_DWORD *)(qword_1242BC0 - 8);
*(_DWORD *)(qword_1242BC0 - 8) = v5 - 1;
}
if ( v5 <= 0 )
operator delete(v0);
}
v1 = (void *)(qword_1242BB8 - 24);
if ( (__int64 *)(qword_1242BB8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(qword_1242BB8 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(qword_1242BB8 - 8);
*(_DWORD *)(qword_1242BB8 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v1);
}
v2 = (void *)(qword_1242BB0 - 24);
if ( (__int64 *)(qword_1242BB0 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(qword_1242BB0 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(qword_1242BB0 - 8);
*(_DWORD *)(qword_1242BB0 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v2);
}
return _stack_chk_guard;
}