//
// sub_C493E0 from 0xc493e0 to 0xc49464 (132 bytes)
//
// 2 xrefs:
// > TIFFRGBAImageBegin @ 0xc52828
// > TIFFRGBAImageBegin @ 0xc52830
//
// 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
//
unsigned __int8 *__fastcall sub_C493E0(
__int64 a1,
_DWORD *a2,
__int64 a3,
__int64 a4,
int a5,
int a6,
int a7,
int a8,
unsigned __int8 *a9)
{
__int64 v9; // x9
int v10; // w11
unsigned __int8 *result; // x0
__int64 v13; // x8
__int64 v14; // x13
__int64 v15; // x7
__int64 v16; // x12
int v17; // w2
_DWORD *v18; // x3
unsigned int v19; // w5
v9 = *(_QWORD *)(a1 + 96);
v10 = a6 - 1;
result = (unsigned __int8 *)*(unsigned __int16 *)(a1 + 30);
if ( a6 )
{
v13 = (unsigned __int16)result;
v14 = (unsigned int)(a5 - 1);
v15 = 4LL * a8;
v16 = (v14 + 1) * (unsigned __int16)result;
do
{
if ( a5 )
{
v17 = a5 - 1;
result = a9;
v18 = a2;
do
{
v19 = *result;
--v17;
result += v13;
*v18++ = **(_DWORD **)(v9 + 8LL * v19);
}
while ( v17 != -1 );
a2 += v14 + 1;
a9 += v16;
}
--v10;
a2 = (_DWORD *)((char *)a2 + v15);
a9 += a7;
}
while ( v10 != -1 );
}
return result;
}