//
// sub_8B2ECC from 0x8b2ecc to 0x8b2fa4 (216 bytes)
//
// 9 xrefs:
// > _TIFFsetByteArray @ 0x8b2fcc
// > _TIFFsetString @ 0x8b3010
// > _TIFFsetNString @ 0x8b3048
// > _TIFFsetShortArray @ 0x8b3080
// > _TIFFsetLongArray @ 0x8b30b8
// > _TIFFsetLong8Array @ 0x8b30f0
// > _TIFFsetFloatArray @ 0x8b3128
// > _TIFFsetDoubleArray @ 0x8b3160
// > sub_8B34CC @ 0x8b48e8
//
// 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:03:54 +0000
//
int __fastcall sub_8B2ECC(int result, int a2, int a3, unsigned int a4)
{
int *v7; // [sp+Ch] [bp-10h]
unsigned int v8; // [sp+14h] [bp-8h]
v7 = (int *)result;
if ( *(_DWORD *)result )
{
result = TIFFfree(*(_DWORD *)result);
*v7 = 0;
}
if ( a2 )
{
v8 = a4 * a3;
if ( a4 )
{
result = v8 / a4;
if ( v8 / a4 == a3 )
{
result = TIFFmalloc(v8);
*v7 = result;
}
}
if ( *v7 )
return TIFFmemcpy(*v7, a2, v8);
}
return result;
}