//
// sub_978E2A from 0x978e2a to 0x978e88 (94 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:00 +0000
//
int __fastcall sub_978E2A(unsigned __int8 *a1, unsigned __int8 *a2, unsigned int a3)
{
unsigned int v4; // r2
unsigned __int64 v5; // kr00_8
unsigned __int64 v6; // kr08_8
unsigned int v7; // r0
unsigned int v8; // r10
v4 = *a1;
if ( (v4 & 1) != 0 )
v5 = *(_QWORD *)(a1 + 4);
else
v5 = __PAIR64__((unsigned int)(a1 + 1), v4 >> 1);
v6 = *(_QWORD *)(a2 + 4);
v7 = *a2;
if ( (v7 & 1) == 0 )
v6 = __PAIR64__((unsigned int)(a2 + 1), v7 >> 1);
if ( (unsigned int)v5 <= a3 )
return -1;
v8 = HIDWORD(v5) + a3;
while ( (_DWORD)v6 )
{
if ( !memchr((const void *)HIDWORD(v6), *(unsigned __int8 *)(HIDWORD(v5) + a3), v6) )
{
v8 = HIDWORD(v5) + a3;
return v8 - HIDWORD(v5);
}
if ( (_DWORD)v5 == ++a3 )
return -1;
}
return v8 - HIDWORD(v5);
}