//
// sub_8E6570 from 0x8e6570 to 0x8e6688 (280 bytes)
//
// 6 xrefs:
// > sub_8E5A20 @ 0x8e5b50
// > sub_8E5A20 @ 0x8e5b88
// > sub_8E5A20 @ 0x8e5bc4
// > sub_8E6108 @ 0x8e6230
// > sub_8E6108 @ 0x8e6268
// > sub_8E6108 @ 0x8e62a4
//
// 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:10 +0000
//
int __fastcall sub_8E6570(_DWORD *a1)
{
_BYTE *v4; // [sp+8h] [bp-Ch]
unsigned int i; // [sp+Ch] [bp-8h]
if ( a1[20] )
_assert2();
a1[20] = TIFFmalloc(0x10000);
if ( a1[20] )
{
v4 = (_BYTE *)a1[20];
for ( i = 0; i <= 0xFFFF; ++i )
*v4++ = (i + 128) / 0x101;
return 1;
}
else
{
TIFFErrorExt(*(_DWORD *)(*a1 + 628), (int)"BuildMapBitdepth16To8", "Out of memory");
return 0;
}
}