//
// sub_775A4C from 0x775a4c to 0x775ad0 (132 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
//
void *__fastcall sub_775A4C(int a1)
{
int v1; // r4
void *result; // r0
int *v4; // r0
size_t v5; // r2
int *v6; // r5
unsigned int *v7; // r3
unsigned int v8; // r2
v1 = *(_DWORD *)(a1 + 8);
if ( v1 < 0 )
{
v4 = sub_774FAC(*(_DWORD *)a1, *(_DWORD *)(a1 + 4));
v5 = *(_DWORD *)a1;
v6 = v4;
result = v4 + 3;
if ( *(_DWORD *)a1 )
{
if ( v5 == 1 )
{
result = v6 + 3;
*((_BYTE *)v6 + 12) = *(_BYTE *)(a1 + 12);
}
else
{
result = memcpy(v6 + 3, (const void *)(a1 + 12), v5);
}
v5 = *(_DWORD *)a1;
}
if ( v6 != &dword_ACDD9C )
{
*v6 = v5;
v6[2] = 0;
*((_BYTE *)v6 + v5 + 12) = 0;
}
}
else
{
if ( (int *)a1 != &dword_ACDD9C )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(a1 + 8);
__dmb(0xFu);
do
v8 = __ldrex(v7);
while ( __strex(v8 + 1, v7) );
__dmb(0xFu);
}
else
{
*(_DWORD *)(a1 + 8) = v1 + 1;
}
}
return (void *)(a1 + 12);
}
return result;
}