//
// sub_8EBBD0 from 0x8ebbd0 to 0x8ebe30 (608 bytes)
//
// 3 xrefs:
// > TIFFInitSGILog @ 0x8ec3c8
// > TIFFInitSGILog @ 0x8ec3cc
// > ??> @ 0x8ec4d0
//
// 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:12 +0000
//
int __fastcall sub_8EBBD0(int a1)
{
int v1; // r3
int v2; // r3
int v3; // r3
const char *v5; // r12
int *v8; // [sp+10h] [bp-Ch]
int v9; // [sp+14h] [bp-8h]
v8 = *(int **)(a1 + 576);
v9 = a1 + 40;
v1 = *(unsigned __int16 *)(a1 + 90);
if ( v1 == 32844 )
{
if ( !sub_8EB2B8((_DWORD *)a1) )
return 1;
*(_DWORD *)(a1 + 536) = sub_8E7998;
if ( !*v8 )
{
v8[5] = (int)sub_8E8FB8;
return 1;
}
if ( *v8 == 1 )
return 1;
}
else
{
if ( v1 != 32845 )
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"LogLuvSetupEncode",
"Inappropriate photometric interpretation %d for SGILog compression; %s",
*(unsigned __int16 *)(a1 + 90),
"must be either LogLUV or LogL");
return 1;
}
if ( !sub_8EB668((_DWORD *)a1) )
return 1;
if ( *(unsigned __int16 *)(v9 + 48) == 34677 )
{
*(_DWORD *)(a1 + 536) = sub_8E7FF4;
v2 = *v8;
if ( *v8 == 1 )
{
v8[5] = (int)sub_8EA538;
return 1;
}
if ( v2 == 2 )
return 1;
if ( !v2 )
{
v8[5] = (int)sub_8EA4A0;
return 1;
}
}
else
{
*(_DWORD *)(a1 + 536) = sub_8E82BC;
v3 = *v8;
if ( *v8 == 1 )
{
v8[5] = (int)sub_8EAEE8;
return 1;
}
if ( v3 == 2 )
return 1;
if ( !v3 )
{
v8[5] = (int)sub_8EAE50;
return 1;
}
}
}
if ( *(unsigned __int16 *)(v9 + 50) == 32844 )
v5 = "Y, L";
else
v5 = "XYZ, Luv";
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"LogLuvSetupEncode",
"SGILog compression supported only for %s, or raw data",
v5);
return 0;
}