//
// _TIFFFindFieldByName from 0xea9fc0 to 0xeaa09c (220 bytes)
//
// 2 xrefs:
// > TIFFFieldWithName @ 0xeaa124
// > ??> @ 0x5cc20
//
// 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:11 +0000
//
__int64 __fastcall TIFFFindFieldByName(_QWORD *a1, char *a2, int a3)
{
__int64 v3; // x20
__int64 *v7; // x19
unsigned __int64 v8; // x21
v3 = a1[128];
if ( !v3 || strcmp(*(const char **)(v3 + 32), a2) || a3 && *(_DWORD *)(v3 + 8) != a3 )
{
v7 = (__int64 *)a1[126];
if ( v7 )
{
v8 = (unsigned __int64)&v7[a1[127]];
if ( (unsigned __int64)v7 >= v8 )
{
LABEL_9:
v3 = 0;
}
else if ( a3 )
{
while ( 1 )
{
v3 = *v7;
if ( !strcmp(a2, *(const char **)(*v7 + 32)) && *(_DWORD *)(v3 + 8) == a3 )
break;
if ( v8 <= (unsigned __int64)++v7 )
goto LABEL_9;
}
}
else
{
while ( 1 )
{
v3 = *v7;
if ( !strcmp(a2, *(const char **)(*v7 + 32)) )
break;
if ( (unsigned __int64)++v7 >= v8 )
goto LABEL_9;
}
}
a1[128] = v3;
}
else
{
return 0;
}
}
return v3;
}