//
// TIFFFindCODEC from 0xc2ecb8 to 0xc2ed38 (128 bytes)
//
// 11 xrefs:
// > sub_C2D114 @ 0xc2d140
// > TIFFIsCODECConfigured @ 0xc2d1b4
// > _TIFFNoRowEncode @ 0xc2ed4c
// > _TIFFNoTileDecode @ 0xc2edc8
// > TIFFSetCompressionScheme @ 0xc2ee48
// > _TIFFNoStripEncode @ 0xc2ee9c
// > _TIFFNoStripDecode @ 0xc2ef18
// > _TIFFNoTileEncode @ 0xc2ef94
// > _TIFFNoRowDecode @ 0xc2f010
// > TIFFPrintDirectory @ 0xc5e158
// > ??> @ 0xc0558
//
// 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
//
char **__fastcall TIFFFindCODEC(unsigned __int16 a1)
{
int v1; // w3
_QWORD *v2; // x1
char **result; // x0
char **v4; // x1
char *v5; // x2
v1 = a1;
v2 = (_QWORD *)qword_1247860;
if ( qword_1247860 )
{
while ( 1 )
{
result = (char **)v2[1];
if ( *((unsigned __int16 *)result + 4) == v1 )
break;
v2 = (_QWORD *)*v2;
if ( !v2 )
goto LABEL_6;
}
}
else
{
LABEL_6:
if ( !TIFFBuiltinCODECS )
return nullptr;
if ( (unsigned __int16)word_12314F8 != v1 )
{
v4 = &off_1231508;
while ( 1 )
{
v5 = *v4;
result = v4;
v4 += 3;
if ( !v5 )
break;
if ( *((unsigned __int16 *)v4 - 8) == v1 )
return result;
}
return nullptr;
}
return &TIFFBuiltinCODECS;
}
return result;
}