//
// sub_C7CC8 from 0xc7cc8 to 0xc7d1c (84 bytes)
//
// 6 xrefs:
// > sub_7755C @ 0x77898
// > sub_91888 @ 0x91890
// > sub_93B20 @ 0x94258
// > sub_956EC @ 0x960d4
// > sub_9FE64 @ 0xa0c28
// > sub_A50C8 @ 0xa5fd4
//
// 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 12:14:46 +0000
//
__int64 __fastcall sub_C7CC8(__int64 a1, int a2, char a3)
{
unsigned int v3; // w8
unsigned int *v4; // x8
unsigned int v5; // w9
unsigned int v6; // w9
if ( (a3 & 1) != 0 )
{
v3 = atomic_load((unsigned int *)(a1 + 100));
if ( ((a2 ^ (v3 >> 13)) & 1) != 0 )
a1 = sub_CD198();
}
v4 = (unsigned int *)(a1 + 100);
if ( (a2 & 1) != 0 )
{
do
v5 = __ldaxr(v4);
while ( __stlxr(v5 | 0x2000, v4) );
}
else
{
do
v6 = __ldaxr(v4);
while ( __stlxr(v6 & 0xFFFFDFFF, v4) );
}
return 0;
}