//
// sub_6DBAA8 from 0x6dbaa8 to 0x6dbd3c (660 bytes)
//
// 2 xrefs:
// > sub_6DBD90 @ 0x6dbdf4
// > sub_6DC010 @ 0x6dc05c
//
// 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_6DBAA8(_DWORD *a1)
{
int v1; // r3
int v2; // r0
unsigned __int16 *v5; // [sp+8h] [bp-Ch]
int *v6; // [sp+Ch] [bp-8h]
v5 = (unsigned __int16 *)(a1 + 10);
v6 = (int *)a1[144];
if ( !v6 )
_assert2();
if ( v5[25] != 32845 )
_assert2();
if ( v5[43] == 1 )
{
if ( *v6 == -1 )
*v6 = sub_6DB960(v5);
switch ( *v6 )
{
case 0:
v6[2] = 12;
goto LABEL_15;
case 1:
v6[2] = 6;
goto LABEL_15;
case 2:
v6[2] = 4;
goto LABEL_15;
case 3:
v6[2] = 3;
LABEL_15:
if ( (a1[3] & 0x400) != 0 )
v2 = sub_6DB690(*((_DWORD *)v5 + 7), *((_DWORD *)v5 + 8));
else
v2 = sub_6DB690(*((_DWORD *)v5 + 4), *((_DWORD *)v5 + 15));
v6[4] = v2;
if ( sub_6DB690(v6[4], 4) && (v6[3] = TIFFmalloc(4 * v6[4])) != 0 )
{
v1 = 1;
}
else
{
TIFFErrorExt(a1[157], (int)"LogLuvInitState", "No space for SGILog translation buffer");
v1 = 0;
}
break;
default:
TIFFErrorExt(a1[157], (int)"LogLuvInitState", "No support for converting user data format to LogLuv");
v1 = 0;
break;
}
}
else
{
TIFFErrorExt(a1[157], (int)"LogLuvInitState", "SGILog compression cannot handle non-contiguous data");
return 0;
}
return v1;
}