//
// sub_1004C713C from 0x1004c713c to 0x1004c71e4 (168 bytes)
//
// 5 xrefs:
// > sub_1004AC318 @ 0x1004ac440
// > sub_1004AC318 @ 0x1004ac484
// > sub_1004AC318 @ 0x1004ac548
// > sub_1004B3ED4 @ 0x1004b3fd4
// > sub_1004B3ED4 @ 0x1004b4044
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
char *__fastcall sub_1004C713C(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;
}