//
// sub_6CFF40 from 0x6cff40 to 0x6d0138 (504 bytes)
//
// 3 xrefs:
// > sub_6D5E60 @ 0x6d6074
// > sub_6D5E60 @ 0x6d6078
// > ??> @ 0x6d6500
//
// 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
//
int __fastcall sub_6CFF40(
int result,
unsigned int *a2,
int a3,
int a4,
int a5,
int a6,
int a7,
int a8,
unsigned __int8 *a9)
{
int v11; // [sp+4h] [bp-20h]
int v13; // [sp+10h] [bp-14h]
int v14; // [sp+14h] [bp-10h]
__int16 v15; // [sp+1Eh] [bp-6h]
int v16; // [sp+30h] [bp+Ch]
v13 = *(unsigned __int16 *)(result + 26);
v14 = *(_DWORD *)(result + 56);
v16 = v13 * a7;
while ( a6-- != 0 )
{
v11 = a5;
while ( v11-- != 0 )
{
v15 = 255 - a9[3];
*a2++ = *(unsigned __int8 *)(v14 + (unsigned __int16)((__int16)((255 - *a9) * v15) / 255))
| (*(unsigned __int8 *)(v14 + (unsigned __int16)((__int16)((255 - a9[1]) * v15) / 255)) << 8)
| (*(unsigned __int8 *)(v14 + (unsigned __int16)((__int16)((255 - a9[2]) * v15) / 255)) << 16)
| 0xFF000000;
a9 += v13;
}
a9 += v16;
a2 += a8;
}
return result;
}