//
// sub_C080F8 from 0xc080f8 to 0xc0817c (132 bytes)
//
// 1 xrefs:
// > jinit_color_deconverter @ 0xc0929c
//
// 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_C080F8(__int64 result, _QWORD *a2, unsigned int a3, __int64 *a4, int a5)
{
unsigned int v5; // w9
__int64 v6; // x7
__int64 v7; // x13
__int64 v8; // x12
__int64 v9; // x11
__int64 v10; // x10
__int64 v11; // t1
v5 = *(_DWORD *)(result + 136);
v6 = *(_QWORD *)(*(_QWORD *)(result + 648) + 48LL);
while ( --a5 >= 0 )
{
while ( 1 )
{
result = 0;
v7 = *(_QWORD *)(*a2 + 8LL * a3);
v8 = *(_QWORD *)(a2[1] + 8LL * a3);
v9 = *(_QWORD *)(a2[2] + 8LL * a3++);
v11 = *a4++;
v10 = v11;
if ( !v5 )
break;
do
{
*(_BYTE *)(v10 + result) = ((unsigned int)*(_QWORD *)(v6 + 8LL * *(unsigned __int8 *)(v7 + result))
+ *(_DWORD *)(v6 + 8 * (*(unsigned __int8 *)(v8 + result) + 256LL))
+ (unsigned int)*(_QWORD *)(v6 + 8 * (*(unsigned __int8 *)(v9 + result) + 512LL))) >> 16;
++result;
}
while ( v5 > (unsigned int)result );
if ( --a5 < 0 )
return result;
}
}
return result;
}