//
// sub_1004E6938 from 0x1004e6938 to 0x1004e6a48 (272 bytes)
//
// 83 xrefs:
// > sub_1004E25D8 @ 0x1004e2748
// > sub_1004E25D8 @ 0x1004e2788
// > sub_1004E25D8 @ 0x1004e27b4
// > sub_1004E25D8 @ 0x1004e27dc
// > sub_1004E25D8 @ 0x1004e2848
// > sub_1004E25D8 @ 0x1004e2868
// > sub_1004E25D8 @ 0x1004e2964
// > sub_1004E25D8 @ 0x1004e2980
// > sub_1004E25D8 @ 0x1004e29b8
// > sub_1004E25D8 @ 0x1004e29e8
// > sub_1004E25D8 @ 0x1004e2a48
// > sub_1004E25D8 @ 0x1004e2a68
// > sub_1004E25D8 @ 0x1004e2b30
// > sub_1004E25D8 @ 0x1004e2bc0
// > sub_1004E25D8 @ 0x1004e2c18
// > sub_1004E25D8 @ 0x1004e2c5c
// > sub_1004E25D8 @ 0x1004e2ce8
// > sub_1004E25D8 @ 0x1004e2d64
// > sub_1004E25D8 @ 0x1004e2e1c
// > sub_1004E25D8 @ 0x1004e2e44
// > sub_1004E25D8 @ 0x1004e2ed8
// > sub_1004E25D8 @ 0x1004e2f00
// > sub_1004E25D8 @ 0x1004e2fac
// > sub_1004E25D8 @ 0x1004e3088
// > sub_1004E25D8 @ 0x1004e3104
// > sub_1004E25D8 @ 0x1004e31b4
// > sub_1004E25D8 @ 0x1004e3224
// > sub_1004E3320 @ 0x1004e3358
// > sub_1004E3320 @ 0x1004e3374
// > sub_1004E3320 @ 0x1004e33f0
// > sub_1004E3320 @ 0x1004e3468
// > sub_1004E34B8 @ 0x1004e3508
// > sub_1004E34B8 @ 0x1004e3554
// > sub_1004E34B8 @ 0x1004e35a0
// > sub_1004E34B8 @ 0x1004e35ec
// > sub_1004E34B8 @ 0x1004e3634
// > sub_1004E34B8 @ 0x1004e3680
// > sub_1004E34B8 @ 0x1004e36cc
// > sub_1004E3724 @ 0x1004e377c
// > sub_1004E3724 @ 0x1004e3840
// > sub_1004E3724 @ 0x1004e38c0
// > sub_1004E3724 @ 0x1004e3954
// > sub_1004E3724 @ 0x1004e399c
// > sub_1004E3724 @ 0x1004e39e0
// > sub_1004E8DA8 @ 0x1004e8ef0
// > sub_1004E8DA8 @ 0x1004e8fdc
// > sub_1004E920C @ 0x1004e9240
// > sub_1004E920C @ 0x1004e9258
// > sub_1004E920C @ 0x1004e9288
// > sub_1004E920C @ 0x1004e92b4
// > sub_1004E92E0 @ 0x1004e9324
// > sub_1004E92E0 @ 0x1004e9348
// > sub_1004E92E0 @ 0x1004e936c
// > sub_1004E9394 @ 0x1004e93e4
// > sub_1004E9394 @ 0x1004e9408
// > sub_1004E9394 @ 0x1004e942c
// > sub_1004E9394 @ 0x1004e9450
// > sub_1004E947C @ 0x1004e94d4
// > sub_1004E947C @ 0x1004e9588
// > sub_1004E9664 @ 0x1004e96b8
// > sub_1004E9664 @ 0x1004e976c
// > sub_1004E9840 @ 0x1004e98a4
// > sub_1004E9840 @ 0x1004e98c4
// > sub_1004E9840 @ 0x1004e9900
// > sub_1004E9840 @ 0x1004e9930
// > sub_1004E9840 @ 0x1004e996c
// > sub_1004E9840 @ 0x1004e998c
// > sub_1004E9ABC @ 0x1004e9b30
// > sub_1004E9ABC @ 0x1004e9b64
// > sub_1004E9ABC @ 0x1004e9b9c
// > sub_1004E9ABC @ 0x1004e9bdc
// > sub_1004E9ABC @ 0x1004e9bfc
// > sub_1004E9D34 @ 0x1004e9da4
// > sub_1004E9D34 @ 0x1004e9e48
// > sub_1004E9D34 @ 0x1004e9f04
// > sub_1004EA008 @ 0x1004ea0b8
// > sub_1004EA160 @ 0x1004ea1f0
// > sub_1004EA160 @ 0x1004ea214
// > sub_1004EA160 @ 0x1004ea2f0
// > sub_1004EA160 @ 0x1004ea31c
// > sub_1004EA5D8 @ 0x1004ea63c
// > sub_1004EA6D8 @ 0x1004ea724
// > sub_1004EA6D8 @ 0x1004ea7ec
//
// 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:06:40 +0000
//
bool __fastcall sub_1004E6938(char *a1, int a2, char *a3, int a4)
{
void **v7; // x23
__int64 *v8; // x24
unsigned __int8 v9; // w25
size_t v10; // x22
int v11; // w26
void *v12; // x21
unsigned __int64 v13; // x27
size_t v14; // x2
int v15; // w0
_BOOL8 v16; // x19
__int64 v18[2]; // [xsp+0h] [xbp-80h] BYREF
unsigned __int8 v19; // [xsp+17h] [xbp-69h]
void *__p[2]; // [xsp+18h] [xbp-68h] BYREF
unsigned __int8 v21; // [xsp+2Fh] [xbp-51h]
v7 = __p;
sub_10004B424(a1, (__int64 *)__p);
v8 = v18;
sub_10004B424(a3, v18);
v9 = v21;
if ( (v21 & 0x80u) == 0 )
v10 = v21;
else
v10 = (size_t)__p[1];
v11 = (char)v19;
if ( (v21 & 0x80u) != 0 )
v7 = (void **)__p[0];
v12 = (void *)v18[0];
if ( (v19 & 0x80u) == 0 )
v13 = v19;
else
v13 = v18[1];
if ( (v19 & 0x80u) != 0 )
v8 = (__int64 *)v18[0];
if ( v10 == v13 && !memcmp(v7, v8, v10) )
{
v16 = a2 < a4;
if ( (v11 & 0x80000000) == 0 )
goto LABEL_20;
LABEL_23:
operator delete(v12);
if ( (v21 & 0x80) == 0 )
return v16;
LABEL_24:
operator delete(__p[0]);
return v16;
}
if ( v13 >= v10 )
v14 = v10;
else
v14 = v13;
v15 = memcmp(v7, v8, v14);
if ( v15 )
v16 = v15 < 0;
else
v16 = v10 < v13;
if ( v11 < 0 )
goto LABEL_23;
LABEL_20:
if ( (v9 & 0x80) != 0 )
goto LABEL_24;
return v16;
}