//
// sub_757BA0 from 0x757ba0 to 0x757cc8 (296 bytes)
//
// 0 xrefs:
//
// 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
//
_DWORD *__fastcall sub_757BA0(_DWORD *a1, unsigned int **a2)
{
char v4; // r3
unsigned int *v5; // r2
int v6; // r8
unsigned int v7; // r1
unsigned int *v8; // r2
char *v9; // r0
unsigned int *v11; // r2
int v12; // r3
int v13; // r3
char *locale[2]; // [sp+4h] [bp-8h] BYREF
sub_757B4C();
v4 = byte_ACD1A8;
__dmb(0xFu);
if ( (v4 & 1) != 0 || !_cxa_guard_acquire((__guard *)&byte_ACD1A8) )
{
if ( !&pthread_create )
{
LABEL_15:
v8 = *a2;
v6 = dword_ACCF64;
++**a2;
goto LABEL_7;
}
}
else
{
dword_ACDBC8 = 0;
_cxa_guard_release((__guard *)&byte_ACD1A8);
if ( !&pthread_create )
goto LABEL_15;
}
if ( pthread_mutex_lock((pthread_mutex_t *)&dword_ACDBC8) )
sub_756FA8();
v5 = *a2;
v6 = dword_ACCF64;
__dmb(0xFu);
do
v7 = __ldrex(v5);
while ( __strex(v7 + 1, v5) );
__dmb(0xFu);
v8 = *a2;
LABEL_7:
dword_ACCF64 = (int)v8;
sub_7562D0((int *)locale, (int)a2);
if ( sub_774E98((int)locale, "*") )
setlocale(6, locale[0]);
v9 = locale[0] - 12;
if ( (int *)locale[0] - 3 == &dword_ACDD9C )
{
LABEL_10:
if ( !&pthread_create )
goto LABEL_12;
goto LABEL_11;
}
if ( !&pthread_create )
{
v13 = *((_DWORD *)locale[0] - 1);
*((_DWORD *)locale[0] - 1) = v13 - 1;
if ( v13 > 0 )
goto LABEL_12;
goto LABEL_20;
}
v11 = (unsigned int *)(locale[0] - 4);
__dmb(0xFu);
do
v12 = __ldrex(v11);
while ( __strex(v12 - 1, v11) );
__dmb(0xFu);
if ( v12 <= 0 )
{
LABEL_20:
operator delete(v9);
goto LABEL_10;
}
LABEL_11:
if ( pthread_mutex_unlock((pthread_mutex_t *)&dword_ACDBC8) )
sub_756274();
LABEL_12:
sub_7562CC(a1, v6);
return a1;
}