//
// sub_1005ED2A4 from 0x1005ed2a4 to 0x1005ed34c (168 bytes)
//
// 5 xrefs:
// > sub_1005D2480 @ 0x1005d25a8
// > sub_1005D2480 @ 0x1005d25ec
// > sub_1005D2480 @ 0x1005d26b0
// > sub_1005DA03C @ 0x1005da13c
// > sub_1005DA03C @ 0x1005da1ac
//
// 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 11:09:46 +0000
//
char *__fastcall sub_1005ED2A4(char *__s1, unsigned __int8 *__s2)
{
char *v3; // x19
__int64 v4; // x9
__int64 v5; // x8
int v6; // w11
int v7; // w22
int v8; // w23
char *v9; // x9
int v10; // t1
size_t v11; // x21
v3 = __s1;
v4 = 0;
v5 = 0xFFFFFFFF00000000LL;
do
{
v6 = __s2[v4];
v5 += (__int64)&_mh_execute_header;
++v4;
}
while ( v6 );
if ( (_DWORD)v4 != 1 )
{
v7 = 0;
v8 = v4 - 1;
v9 = __s1;
do
{
v10 = (unsigned __int8)*v9++;
++v7;
}
while ( v10 );
if ( v7 - 1 < v8 )
{
return nullptr;
}
else
{
v11 = v5 >> 32;
while ( memcmp(v3, __s2, v11) )
{
++v3;
if ( --v7 <= v8 )
return nullptr;
}
}
}
return v3;
}