//
// sub_C4A5AC from 0xc4a5ac to 0xc4a67c (208 bytes)
//
// 2 xrefs:
// > TIFFRGBAImageBegin @ 0xc52c44
// > TIFFRGBAImageBegin @ 0xc52c4c
//
// 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_C4A5AC(
__int64 result,
int *a2,
__int64 a3,
__int64 a4,
int a5,
int a6,
int a7,
int a8,
unsigned __int16 *a9)
{
int v9; // w17
int v11; // w6
__int64 v12; // x15
__int64 v13; // x19
__int64 v14; // x7
__int64 v15; // x6
__int64 v16; // x8
int v17; // w10
__int64 v18; // x14
unsigned __int16 *v19; // x2
int *v20; // x11
__int64 v21; // x12
__int64 v22; // x9
int v23; // w5
__int64 v24; // x13
v9 = a6 - 1;
v11 = a7 * *(unsigned __int16 *)(result + 30);
if ( a6 )
{
v12 = 2LL * *(unsigned __int16 *)(result + 30);
v13 = (unsigned int)(a5 - 1);
v14 = 4LL * a8;
v15 = 2LL * v11;
do
{
if ( a5 )
{
v16 = *(_QWORD *)(result + 128);
v17 = a5 - 1;
v18 = *(_QWORD *)(result + 120);
v19 = a9;
v20 = a2;
do
{
--v17;
v21 = *v19;
v22 = v19[1];
v23 = *(unsigned __int8 *)(v16 + v19[3]);
v24 = v19[2];
v19 = (unsigned __int16 *)((char *)v19 + v12);
*v20++ = *(unsigned __int8 *)(v18
+ ((unsigned __int64)(unsigned __int8)v23 << 8)
+ *(unsigned __int8 *)(v16 + v21))
| (v23 << 24)
| (*(unsigned __int8 *)(v18
+ ((unsigned __int64)(unsigned __int8)v23 << 8)
+ *(unsigned __int8 *)(v16 + v22)) << 8)
| (*(unsigned __int8 *)(v18
+ ((unsigned __int64)(unsigned __int8)v23 << 8)
+ *(unsigned __int8 *)(v16 + v24)) << 16);
}
while ( v17 != -1 );
a2 += v13 + 1;
a9 = (unsigned __int16 *)((char *)a9 + (v13 + 1) * v12);
}
--v9;
a2 = (int *)((char *)a2 + v14);
a9 = (unsigned __int16 *)((char *)a9 + v15);
}
while ( v9 != -1 );
}
return result;
}