//
// TIFFScanlineSize64 from 0x900564 to 0x900924 (960 bytes)
//
// 6 xrefs:
// > TIFFReadDirectory @ 0x8c1ef4
// > sub_8C2BA0 @ 0x8c3040
// > TIFFVStripSize64 @ 0x9000cc
// > _TIFFDefaultStripSize @ 0x9004ac
// > TIFFScanlineSize @ 0x90095c
// > ??> @ 0x6b1ac
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:04:17 +0000
//
unsigned __int64 __fastcall TIFFScanlineSize64(int a1)
{
unsigned int v2; // r3
unsigned __int64 v3; // r0
unsigned __int16 v6; // [sp+18h] [bp-3Ch] BYREF
unsigned __int16 v7; // [sp+1Ah] [bp-3Ah] BYREF
int v8; // [sp+1Ch] [bp-38h]
unsigned __int16 v10; // [sp+2Ah] [bp-2Ah]
unsigned int v11; // [sp+2Ch] [bp-28h]
unsigned __int64 v12; // [sp+30h] [bp-24h]
unsigned __int64 v13; // [sp+38h] [bp-1Ch]
v8 = a1 + 40;
if ( *(_WORD *)(a1 + 126) != 1 )
return (TIFFMultiply64(a1, *(unsigned int *)(v8 + 16), *(unsigned __int16 *)(v8 + 44), "TIFFScanlineSize64") + 7) >> 3;
if ( *(_WORD *)(v8 + 50) != 6 || *(_WORD *)(v8 + 58) != 3 || (*(_DWORD *)(a1 + 12) & 0x4000) != 0 )
{
v3 = TIFFMultiply64(a1, *(unsigned int *)(v8 + 16), *(unsigned __int16 *)(v8 + 58), "TIFFScanlineSize64");
return (TIFFMultiply64(a1, v3, *(unsigned __int16 *)(v8 + 44), "TIFFScanlineSize64") + 7) >> 3;
}
if ( *(_WORD *)(v8 + 58) == 3 )
{
TIFFGetFieldDefaulted(a1, 0x212u, &v6, &v7);
if ( v6 != 1 && v6 != 2 && v6 != 4 || v7 != 1 && v7 != 2 && v7 != 4 )
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"TIFFScanlineSize64", "Invalid YCbCr subsampling");
return 0;
}
v10 = v7 * v6 + 2;
if ( *(_DWORD *)(v8 + 16) >= (unsigned int)-v6 )
v2 = 0;
else
v2 = (*(_DWORD *)(v8 + 16) + (unsigned int)v6 - 1) / v6;
v11 = v2;
v12 = TIFFMultiply64(a1, v2, v10, "TIFFScanlineSize64");
v13 = (TIFFMultiply64(a1, v12, *(unsigned __int16 *)(v8 + 44), "TIFFScanlineSize64") + 7) >> 3;
return v13 / v7;
}
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"TIFFScanlineSize64", "Invalid td_samplesperpixel value");
return 0;
}