//
// sub_CC714 from 0xcc714 to 0xcc7c4 (176 bytes)
//
// 7 xrefs:
// > sub_57B24 @ 0x57bdc
// > sub_57B24 @ 0x57c08
// > sub_587C0 @ 0x58810
// > sub_5B7B0 @ 0x5b7f8
// > sub_5BFFC @ 0x5c0b0
// > sub_5BFFC @ 0x5c0f4
// > sub_7755C @ 0x778e4
//
// 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_CC714(__int64 a1, char a2, float a3)
{
__int64 result; // x0
__int16 v4; // w8
float v6; // s8
__int64 v7; // x0
__int64 v8; // x1
int v9; // w8
unsigned int v10; // w9
__int64 v11; // [xsp+8h] [xbp-18h] BYREF
if ( a3 < 0.0 )
return 31;
v4 = atomic_load((unsigned int *)(a1 + 100));
v6 = fminf(a3, 256.0);
if ( (v4 & 0x100) != 0 || (a2 & 1) == 0 )
{
v9 = *(_DWORD *)(a1 + 40);
v10 = vcvts_n_u32_f32(v6, 0x14u);
result = 0;
*(_DWORD *)(a1 + 40) = v10;
if ( (v10 == 0) != (v9 == 0) )
return sub_CD198(0);
}
else
{
result = sub_CD294(*(_QWORD *)(a1 + 168), &v11, 16);
if ( !(_DWORD)result )
{
v7 = sub_CD2F8();
*(float *)(v8 + 4) = v6;
return sub_CD2F0(v7);
}
}
return result;
}