//
// sub_8EB668 from 0x8eb668 to 0x8eb8fc (660 bytes)
//
// 2 xrefs:
// > sub_8EB950 @ 0x8eb9b4
// > sub_8EBBD0 @ 0x8ebc1c
//
// 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:11 +0000
//
int __fastcall sub_8EB668(_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_8EB520(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_8EB250(*((_DWORD *)v5 + 7), *((_DWORD *)v5 + 8));
else
v2 = sub_8EB250(*((_DWORD *)v5 + 4), *((_DWORD *)v5 + 15));
v6[4] = v2;
if ( sub_8EB250(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;
}