//
// sub_6BCFD4 from 0x6bcfd4 to 0x6bd228 (596 bytes)
//
// 1 xrefs:
// > sub_6BB8B0 @ 0x6bb914
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_6BCFD4(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_6BD8C0(a1, a2, a3, a4, 5, a5, 8 * a5, v12);
TIFFfree(v12);
return v16;
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), "TIFFWriteDirectoryTagCheckedRationalArray", "Out of memory");
return 0;
}
}