//
// sub_C3CF8 from 0xc3cf8 to 0xc3e48 (336 bytes)
//
// 2 xrefs:
// > sub_C3BD4 @ 0xc3c70
// > sub_C4B4C @ 0xc4b54
//
// 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_C3CF8(__int64 a1, int a2, char a3, float a4)
{
__int64 result; // x0
float v8; // s0
__int64 v9; // x1
__int64 v10; // [xsp+8h] [xbp-18h] BYREF
switch ( a2 )
{
case 0:
*(float *)(a1 + 2088) = a4;
if ( (a3 & 1) == 0 )
goto LABEL_25;
goto LABEL_29;
case 1:
*(float *)(a1 + 2092) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 2:
*(float *)(a1 + 2096) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 3:
*(float *)(a1 + 2100) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 4:
*(float *)(a1 + 2104) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 5:
*(float *)(a1 + 2108) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 6:
*(float *)(a1 + 2112) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 7:
*(float *)(a1 + 2116) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 8:
*(float *)(a1 + 2120) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 9:
*(float *)(a1 + 2124) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 10:
*(float *)(a1 + 2128) = a4;
if ( (a3 & 1) != 0 )
goto LABEL_29;
goto LABEL_25;
case 11:
*(float *)(a1 + 2132) = a4;
if ( (a3 & 1) == 0 )
goto LABEL_25;
goto LABEL_29;
case 12:
*(float *)(a1 + 2136) = a4;
sub_C4BB0(0.05);
if ( a4 <= -80.0 )
v8 = 0.0;
*(float *)(a1 + 2140) = v8;
if ( (a3 & 1) != 0 )
{
LABEL_29:
result = sub_77980(*(_QWORD *)(a1 + 168), &v10, 16, 1);
if ( !(_DWORD)result )
{
*(_BYTE *)v10 = 7;
v9 = v10;
*(_QWORD *)(v10 + 8) = a1;
result = sub_77A28(*(_QWORD *)(a1 + 168), v9, 1);
}
}
else
{
LABEL_25:
result = 0;
}
break;
default:
result = 31;
break;
}
return result;
}