//
// sub_ED3238 from 0xed3238 to 0xed3454 (540 bytes)
//
// 2 xrefs:
// > TIFFPredictorInit @ 0xed34e0
// > TIFFPredictorInit @ 0xed34e8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:11:41 +0000
//
__int64 __fastcall sub_ED3238(__int64 a1)
{
__int64 v1; // x20
__int64 result; // x0
int *v4; // x21
int v5; // w3
__int64 v6; // x1
int v7; // w3
__int64 v8; // x0
int v9; // w1
__int64 v10; // x0
__int64 (__fastcall *v11)(__int64, __int64, __int64, unsigned __int16); // x2
__int64 v12; // x2
__int64 v13; // x2
int v14; // w3
int v15; // w0
__int64 (__fastcall *v16)(__int64, __int64, __int64, unsigned __int16); // x1
v1 = *(_QWORD *)(a1 + 848);
result = (*(__int64 (**)(void))(v1 + 120))();
if ( (_DWORD)result )
{
v4 = *(int **)(a1 + 848);
v5 = *v4;
if ( *v4 == 2 )
{
v6 = a1 + 56;
v14 = *(unsigned __int16 *)(a1 + 116);
if ( (((_WORD)v14 - 8) & 0xFFF7) == 0 || v14 == 32 )
goto LABEL_8;
TIFFErrorExt(
*(_QWORD *)(a1 + 952),
(__int64)"PredictorSetup",
"Horizontal differencing \"Predictor\" not supported with %d-bit samples",
v14);
return 0;
}
else
{
if ( v5 != 3 )
{
if ( v5 != 1 )
{
TIFFErrorExt(*(_QWORD *)(a1 + 952), (__int64)"PredictorSetup", "\"Predictor\" value %d not supported", v5);
return 0;
}
LABEL_13:
if ( *(_DWORD *)v1 == 2 )
{
v15 = *(unsigned __int16 *)(a1 + 116);
switch ( v15 )
{
case 16:
*(_QWORD *)(v1 + 48) = sub_ED1420;
break;
case 32:
*(_QWORD *)(v1 + 48) = sub_ED17B0;
break;
case 8:
*(_QWORD *)(v1 + 48) = sub_ED0E10;
break;
}
v16 = *(__int64 (__fastcall **)(__int64, __int64, __int64, unsigned __int16))(a1 + 768);
if ( v16 != sub_ED1A50 )
{
*(_QWORD *)(v1 + 24) = v16;
goto LABEL_18;
}
}
else if ( *(_DWORD *)v1 == 3 )
{
v11 = *(__int64 (__fastcall **)(__int64, __int64, __int64, unsigned __int16))(a1 + 768);
*(_QWORD *)(v1 + 48) = sub_ED1BB0;
if ( v11 != sub_ED1A50 )
{
*(_QWORD *)(v1 + 24) = v11;
LABEL_18:
v12 = *(_QWORD *)(a1 + 784);
*(_QWORD *)(a1 + 768) = sub_ED1A50;
*(_QWORD *)(v1 + 32) = v12;
v13 = *(_QWORD *)(a1 + 800);
*(_QWORD *)(a1 + 784) = sub_ED313C;
*(_QWORD *)(v1 + 40) = v13;
*(_QWORD *)(a1 + 800) = sub_ED313C;
return 1;
}
}
return 1;
}
v6 = a1 + 56;
v7 = *(unsigned __int16 *)(a1 + 118);
if ( v7 == 3 )
{
LABEL_8:
v8 = 1;
if ( *(_WORD *)(v6 + 114) == 1 )
v8 = *(unsigned __int16 *)(v6 + 74);
v9 = *(_DWORD *)(a1 + 16);
*((_QWORD *)v4 + 1) = v8;
if ( (v9 & 0x400) != 0 )
v10 = TIFFTileRowSize(a1);
else
v10 = TIFFScanlineSize(a1);
*((_QWORD *)v4 + 2) = v10;
if ( !v10 )
return 0;
goto LABEL_13;
}
TIFFErrorExt(
*(_QWORD *)(a1 + 952),
(__int64)"PredictorSetup",
"Floating point \"Predictor\" not supported with %d data format",
v7);
return 0;
}
}
return result;
}