//
// sub_8CB770 from 0x8cb770 to 0x8cb944 (468 bytes)
//
// 4 xrefs:
// > sub_8C7DD0 @ 0x8c85b0
// > sub_8C7DD0 @ 0x8c85f0
// > sub_8C7DD0 @ 0x8c865c
// > sub_8C7DD0 @ 0x8c869c
//
// 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:03 +0000
//
int __fastcall sub_8CB770(int a1, _DWORD *a2, int a3, unsigned __int16 a4, unsigned int a5, _DWORD *a6)
{
_DWORD *v12; // [sp+1Ch] [bp-18h]
unsigned int i; // [sp+20h] [bp-14h]
int v14; // [sp+24h] [bp-10h]
_DWORD *v15; // [sp+28h] [bp-Ch]
int v16; // [sp+2Ch] [bp-8h]
if ( a3 )
{
if ( (*(_DWORD *)(a1 + 12) & 0x80000) != 0 )
{
return sub_8CC7BC(a1, a2, a3, a4, a5, a6);
}
else
{
v14 = TIFFmalloc(4 * a5);
if ( v14 )
{
v15 = (_DWORD *)v14;
v12 = a6;
for ( i = 0; i < a5; ++i )
{
if ( v12[1] )
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
"TIFFWriteDirectoryTagLongLong8Array",
"Attempt to write value larger than 0xFFFFFFFF in Classic TIFF file.");
TIFFfree(v14);
return 0;
}
*v15 = *v12;
v12 += 2;
++v15;
}
v16 = sub_8CC628(a1, a2, a3, a4, a5, v14);
TIFFfree(v14);
return v16;
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), "TIFFWriteDirectoryTagLongLong8Array", "Out of memory");
return 0;
}
}
}
else
{
++*a2;
return 1;
}
}