//
// sub_F80D40 from 0xf80d40 to 0xf80dec (172 bytes)
//
// 0 xrefs:
//
// 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:13:50 +0000
//
__int64 __fastcall sub_F80D40(unsigned __int8 *a1, unsigned __int8 *a2, unsigned __int64 a3)
{
unsigned __int64 v3; // x8
unsigned __int8 *v4; // x21
unsigned __int64 v5; // x8
unsigned __int64 v6; // x9
bool v7; // zf
size_t v8; // x9
const wchar_t *v9; // x19
size_t v10; // x20
__int64 v11; // x23
unsigned __int8 *v12; // x22
__int64 v13; // x24
v3 = *a1;
if ( (v3 & 1) != 0 )
{
v5 = *((_QWORD *)a1 + 1);
v4 = *((unsigned __int8 **)a1 + 2);
}
else
{
v4 = a1 + 4;
v5 = v3 >> 1;
}
v6 = *a2;
v7 = (v6 & 1) == 0;
v8 = v6 >> 1;
if ( v7 )
v9 = (const wchar_t *)(a2 + 4);
else
v9 = *((const wchar_t **)a2 + 2);
if ( v7 )
v10 = v8;
else
v10 = *((_QWORD *)a2 + 1);
if ( v5 <= a3 )
return -1;
v11 = 4 * a3;
v12 = &v4[4 * a3];
v13 = 4 * v5;
while ( v10 )
{
if ( !wmemchr(v9, *(_DWORD *)&v4[v11], v10) )
{
v12 = &v4[v11];
return (v12 - v4) >> 2;
}
v11 += 4;
if ( v13 == v11 )
return -1;
}
return (v12 - v4) >> 2;
}