//
// sub_6EFA34 from 0x6efa34 to 0x6efc84 (592 bytes)
//
// 1 xrefs:
// > TIFFFillTile @ 0x6ef670
//
// 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_6EFA34(int a1, unsigned int a2)
{
unsigned int v3; // r3
unsigned int v4; // r3
_DWORD *v8; // [sp+Ch] [bp-10h]
v8 = (_DWORD *)(a1 + 40);
if ( !TIFFFillStriles() || !*(_DWORD *)(a1 + 176) )
return 0;
if ( (*(_DWORD *)(a1 + 12) & 0x20) == 0 )
{
if ( !(*(int (__fastcall **)(int))(a1 + 508))(a1) )
return 0;
*(_DWORD *)(a1 + 12) |= 0x20u;
}
*(_DWORD *)(a1 + 492) = a2;
if ( v8[4] >= (unsigned int)-v8[7] )
v3 = 0;
else
v3 = (unsigned int)(v8[4] + v8[7] - 1) / v8[7];
*(_DWORD *)(a1 + 444) = v8[8] * (a2 % v3);
if ( v8[5] >= (unsigned int)-v8[8] )
v4 = 0;
else
v4 = (unsigned int)(v8[5] + v8[8] - 1) / v8[8];
*(_DWORD *)(a1 + 488) = v8[7] * (a2 % v4);
*(_DWORD *)(a1 + 12) &= ~0x100000u;
if ( (*(_DWORD *)(a1 + 12) & 0x20000) != 0 )
{
*(_DWORD *)(a1 + 604) = 0;
*(_DWORD *)(a1 + 608) = 0;
}
else
{
*(_DWORD *)(a1 + 604) = *(_DWORD *)(a1 + 588);
*(_DWORD *)(a1 + 608) = *(_DWORD *)(v8[34] + 8 * a2);
}
return (*(int (__fastcall **)(int, _DWORD))(a1 + 512))(a1, (unsigned __int16)(a2 / v8[31]));
}