//
// sub_778BCC from 0x778bcc to 0x778c30 (100 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
//
const wchar_t **__fastcall sub_778BCC(const wchar_t **a1, const wchar_t **a2, const wchar_t **a3)
{
const wchar_t *v3; // r3
int v5; // r2
const wchar_t *v7; // r0
unsigned int *v9; // r2
unsigned int v10; // r1
char v11[8]; // [sp+4h] [bp-8h] BYREF
v3 = *a2;
v5 = *(*a2 - 1);
v7 = *a2 - 3;
if ( v5 < 0 )
{
v3 = sub_7788F4((int)v7, (int)v11, 0);
}
else if ( v7 != (const wchar_t *)&unk_ACDDAC )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v3 - 1);
__dmb(0xFu);
do
v10 = __ldrex(v9);
while ( __strex(v10 + 1, v9) );
__dmb(0xFu);
}
else
{
*((_DWORD *)v3 - 1) = v5 + 1;
}
}
*a1 = v3;
sub_7783F8(a1, a3);
return a1;
}