//
// sub_978CBC from 0x978cbc to 0x978d24 (104 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_978CBC(unsigned __int8 *a1, char *a2, unsigned int a3)
{
unsigned int v4; // r1
unsigned __int64 v6; // kr00_8
size_t v7; // r0
int v8; // r1
unsigned __int8 *v9; // r2
unsigned __int8 *v10; // r3
size_t v11; // r6
char *v12; // r4
int v13; // t1
v4 = *a1;
if ( (v4 & 1) != 0 )
v6 = *(_QWORD *)(a1 + 4);
else
v6 = __PAIR64__((unsigned int)(a1 + 1), v4 >> 1);
v7 = strlen(a2);
v8 = -1;
if ( (unsigned int)v6 > a3 && v7 )
{
v9 = (unsigned __int8 *)(HIDWORD(v6) + v6);
v10 = (unsigned __int8 *)(HIDWORD(v6) + a3);
if ( (_DWORD)v6 != a3 )
{
LABEL_7:
v11 = v7;
v12 = a2;
while ( 1 )
{
v13 = (unsigned __int8)*v12++;
if ( *v10 == v13 )
break;
if ( !--v11 )
{
if ( ++v10 != v9 )
goto LABEL_7;
v10 = (unsigned __int8 *)(HIDWORD(v6) + v6);
break;
}
}
}
v8 = (int)&v10[-HIDWORD(v6)];
if ( v10 == v9 )
return -1;
}
return v8;
}