//
// sub_97ABA4 from 0x97aba4 to 0x97ac74 (208 bytes)
//
// 0 xrefs:
//
// 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:06:02 +0000
//
int __fastcall sub_97ABA4(unsigned __int8 *a1, unsigned __int8 *a2, unsigned int a3)
{
unsigned int v3; // r3
unsigned __int64 v4; // kr00_8
unsigned __int8 *v5; // r0
unsigned int v6; // r4
unsigned __int8 *v7; // lr
unsigned int v8; // r1
bool v9; // cf
int result; // r0
int v11; // r0
int v12; // r9
int v13; // r5
int v14; // r2
int v15; // r3
_DWORD *v16; // lr
int v17; // t1
int v18; // r8
int v19; // r6
int v20; // r5
int v21; // r4
unsigned int v22; // r7
int v23; // r4
int v24; // r1
v3 = *a1;
if ( (v3 & 1) != 0 )
v4 = *(_QWORD *)(a1 + 4);
else
v4 = __PAIR64__((unsigned int)(a1 + 4), v3 >> 1);
v5 = a2 + 4;
v6 = *((_DWORD *)a2 + 1);
v7 = *((unsigned __int8 **)a2 + 2);
v8 = *a2;
if ( (v8 & 1) == 0 )
{
v6 = v8 >> 1;
v7 = v5;
}
v9 = (unsigned int)v4 >= a3;
result = -1;
if ( (unsigned int)v4 >= a3 )
v9 = (unsigned int)v4 - a3 >= v6;
if ( v9 )
{
if ( v6 )
{
v11 = HIDWORD(v4) + 4 * a3;
v12 = HIDWORD(v4) + 4 * v4;
v13 = (int)(4 * v6) >> 2;
v14 = v11;
if ( (v6 & 0x3FFFFFFF) != 0 )
{
v14 = HIDWORD(v4) + 4 * v4;
if ( (v12 - v11) >> 2 >= v13 && v12 + 4 * (1 - v13) != v11 )
{
v17 = *(_DWORD *)v7;
v16 = v7 + 4;
v15 = v17;
v18 = 4 * v6 - 4;
v19 = v11;
v20 = -(HIDWORD(v4) + 4 * (v4 - v13));
while ( 2 )
{
v11 += 4;
while ( *(_DWORD *)(v11 - 4) != v15 )
{
v19 = v11;
v21 = v11 + 4 + v20;
v11 += 4;
if ( v21 == 8 )
goto LABEL_26;
}
v22 = 0;
do
{
if ( v18 == v22 )
{
v14 = v19;
goto LABEL_26;
}
v23 = v16[v22 / 4];
v24 = *(_DWORD *)(v11 + v22);
v22 += 4;
}
while ( v24 == v23 );
v19 = v11;
if ( v11 + v20 != 4 )
continue;
break;
}
}
}
LABEL_26:
result = (v14 - HIDWORD(v4)) >> 2;
if ( v14 == v12 )
return -1;
}
else
{
return a3;
}
}
return result;
}