//
// sub_6AF958 from 0x6af958 to 0x6afa3c (228 bytes)
//
// 6 xrefs:
// > sub_6A9B04 @ 0x6a9de0
// > sub_6A9E54 @ 0x6aa110
// > sub_6AA184 @ 0x6aa40c
// > sub_6AA47C @ 0x6aa6ec
// > sub_6AA75C @ 0x6aa974
// > sub_6AAAB8 @ 0x6aacd4
//
// 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_6AF958(int a1, int a2, _QWORD *a3)
{
int v7; // [sp+18h] [bp-Ch] BYREF
int v8; // [sp+1Ch] [bp-8h]
if ( (*(_DWORD *)(a1 + 12) & 0x80000) != 0 )
{
*a3 = *(_QWORD *)(a2 + 16);
}
else
{
v7 = *(_DWORD *)(a2 + 16);
if ( (*(_DWORD *)(a1 + 12) & 0x80) != 0 )
TIFFSwabLong(&v7);
v8 = sub_6B0978(a1, a3, v7, 0, 8, a3);
if ( v8 )
return v8;
}
if ( (*(_DWORD *)(a1 + 12) & 0x80) != 0 )
TIFFSwabLong8(a3);
return 0;
}