//
// sub_CA66A8 from 0xca66a8 to 0xca66ec (68 bytes)
//
// 4 xrefs:
// > sub_C998E4 @ 0xc9997c
// > sub_C998E4 @ 0xc99a20
// > sub_CAEA7C @ 0xcaed98
// > sub_CAEEBC @ 0xcaf0c4
//
// 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
//
_BYTE *__fastcall sub_CA66A8(_QWORD *a1, unsigned __int8 a2)
{
int *v2; // x2
int v3; // w3
int v4; // w1
_BYTE *result; // x0
v2 = (int *)a1[9];
v3 = 4;
v4 = 16843009 * a2;
do
{
*v2 = v4;
--v3;
v2 = (int *)((char *)v2 + *(int *)(a1[6] + 56LL));
}
while ( v3 );
result = (_BYTE *)a1[7];
*result = *result & 0xFC | 1;
return result;
}