//
// sub_8CCB94 from 0x8ccb94 to 0x8ccde8 (596 bytes)
//
// 1 xrefs:
// > sub_8CB470 @ 0x8cb4d4
//
// 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:04 +0000
//
int __fastcall sub_8CCB94(int a1, int a2, int a3, unsigned __int16 a4, unsigned int a5, float *a6)
{
int v12; // [sp+24h] [bp-18h]
_DWORD *v14; // [sp+2Ch] [bp-10h]
unsigned int i; // [sp+30h] [bp-Ch]
int v16; // [sp+34h] [bp-8h]
v12 = TIFFmalloc(8 * a5);
if ( v12 )
{
v14 = (_DWORD *)v12;
for ( i = 0; i < a5; ++i )
{
if ( *a6 > 0.0 )
{
if ( *a6 == (float)(unsigned int)*a6 )
{
*v14 = (unsigned int)*a6;
v14[1] = 1;
}
else if ( *a6 >= 1.0 )
{
*v14 = -1;
v14[1] = (unsigned int)(float)(4295000000.0 / *a6);
}
else
{
*v14 = (unsigned int)(float)(*a6 * 4295000000.0);
v14[1] = -1;
}
}
else
{
*v14 = 0;
v14[1] = 1;
}
++a6;
v14 += 2;
}
if ( (*(_DWORD *)(a1 + 12) & 0x80) != 0 )
TIFFSwabArrayOfLong(v12, 2 * a5);
v16 = sub_8CD480(a1, a2, a3, a4, 5, a5, 8 * a5, v12);
TIFFfree(v12);
return v16;
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), "TIFFWriteDirectoryTagCheckedRationalArray", "Out of memory");
return 0;
}
}