//
// sub_97AD2C from 0x97ad2c to 0x97adf4 (200 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_97AD2C(unsigned __int8 *a1, int *a2, unsigned int a3)
{
unsigned int v4; // r1
unsigned __int64 v6; // kr00_8
unsigned int v7; // r0
bool v8; // cf
int v9; // r1
int v10; // r1
int v11; // lr
int v12; // r5
int v13; // r9
int v14; // r12
_DWORD *v15; // r4
int v16; // r10
int v17; // t1
int v18; // r5
int v19; // r0
int v20; // r3
unsigned int v21; // r2
int v22; // r3
int v23; // r6
v4 = *a1;
if ( (v4 & 1) != 0 )
v6 = *(_QWORD *)(a1 + 4);
else
v6 = __PAIR64__((unsigned int)(a1 + 4), v4 >> 1);
v7 = sub_99883C(a2);
v8 = (unsigned int)v6 >= a3;
v9 = -1;
if ( (unsigned int)v6 >= a3 )
v8 = (unsigned int)v6 - a3 >= v7;
if ( v8 )
{
if ( v7 )
{
v10 = HIDWORD(v6) + 4 * a3;
v11 = HIDWORD(v6) + 4 * v6;
v12 = (int)(4 * v7) >> 2;
v13 = v10;
if ( (v7 & 0x3FFFFFFF) != 0 )
{
v13 = HIDWORD(v6) + 4 * v6;
if ( (v11 - v10) >> 2 >= v12 && v11 + 4 * (1 - v12) != v10 )
{
v14 = 4 * v7 - 4;
v17 = *a2;
v15 = a2 + 1;
v16 = v17;
v18 = -(HIDWORD(v6) + 4 * (v6 - v12));
v19 = v10;
while ( 2 )
{
v10 += 4;
while ( *(_DWORD *)(v10 - 4) != v16 )
{
v19 = v10;
v20 = v10 + 4 + v18;
v10 += 4;
if ( v20 == 8 )
goto LABEL_24;
}
v21 = 0;
do
{
if ( v14 == v21 )
{
v13 = v19;
goto LABEL_24;
}
v22 = v15[v21 / 4];
v23 = *(_DWORD *)(v10 + v21);
v21 += 4;
}
while ( v23 == v22 );
v19 = v10;
if ( v10 + v18 != 4 )
continue;
break;
}
}
}
LABEL_24:
v9 = (v13 - HIDWORD(v6)) >> 2;
if ( v13 == v11 )
return -1;
}
else
{
return a3;
}
}
return v9;
}