//
// 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!
//
// 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 __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;
}