//
// sub_C49790 from 0xc49790 to 0xc49814 (132 bytes)
//
// 2 xrefs:
// > TIFFRGBAImageBegin @ 0xc5289c
// > TIFFRGBAImageBegin @ 0xc528a4
//
// 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_C49790(
unsigned __int8 *result,
_DWORD *a2,
__int64 a3,
__int64 a4,
int a5,
int a6,
int a7,
int a8,
unsigned __int8 *a9)
{
int v10; // w11
unsigned __int16 v11; // w2
__int64 v12; // x9
__int64 v13; // x8
__int64 v14; // x13
__int64 v15; // x7
__int64 v16; // x12
int v17; // w2
_DWORD *v18; // x3
unsigned int v19; // w5
v10 = a6 - 1;
v11 = *((_WORD *)result + 15);
v12 = *((_QWORD *)result + 11);
if ( a6 )
{
v13 = v11;
v14 = (unsigned int)(a5 - 1);
v15 = 4LL * a8;
v16 = (v14 + 1) * v11;
do
{
if ( a5 )
{
v17 = a5 - 1;
result = a9;
v18 = a2;
do
{
v19 = *result;
--v17;
result += v13;
*v18++ = **(_DWORD **)(v12 + 8LL * v19);
}
while ( v17 != -1 );
a2 += v14 + 1;
a9 += v16;
}
--v10;
a2 = (_DWORD *)((char *)a2 + v15);
a9 += a7;
}
while ( v10 != -1 );
}
return result;
}