//
// IDNameInput::nameLess from 0x7937f8 to 0x79392a (306 bytes)
//
// 2 xrefs:
// > sub_78F30C @ 0x78f318
// > sub_793930 @ 0x79393c
//
// 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 11:59:43 +0000
//
bool __fastcall IDNameInput::nameLess(int a1, int a2, int a3, int a4)
{
int v7; // r5
int v8; // r10
size_t v9; // r2
int v10; // r11
int v11; // r1
char *v12; // r0
unsigned __int8 *v13; // r1
char *v14; // r0
unsigned __int8 *v15; // r2
int v16; // t1
size_t v17; // r4
unsigned int v18; // r5
char *v19; // r0
char *v20; // r1
size_t v21; // r2
unsigned int v22; // r0
_BOOL4 v23; // r4
int v25; // [sp+4h] [bp+0h] BYREF
size_t v26; // [sp+8h] [bp+4h]
void *v27; // [sp+Ch] [bp+8h]
int v28; // [sp+10h] [bp+Ch] BYREF
unsigned int v29; // [sp+14h] [bp+10h]
unsigned __int8 *v30; // [sp+18h] [bp+14h]
GameToolbox::lowercaseASCII(&v25, a1);
GameToolbox::lowercaseASCII(&v28, a3);
v7 = (unsigned __int8)v28;
v8 = v25 & 1;
if ( v8 )
v9 = v26;
else
v9 = (int)(unsigned __int8)v25 >> 1;
v10 = v28 & 1;
if ( v10 )
v11 = v29;
else
v11 = (int)(unsigned __int8)v28 >> 1;
if ( v9 == v11 )
{
if ( v8 )
{
v12 = (char *)v27;
if ( !v10 )
{
v13 = (unsigned __int8 *)&v28 + 1;
LABEL_13:
if ( !v9 || !memcmp(v12, v13, v9) )
{
LABEL_39:
v23 = a2 < a4;
goto LABEL_40;
}
goto LABEL_21;
}
}
else
{
v12 = (char *)&v25 + 1;
if ( !v10 )
{
v13 = (unsigned __int8 *)&v28 + 1;
LABEL_11:
v14 = v12 - 1;
v15 = &v13[v9];
while ( v13 != v15 )
{
v16 = (unsigned __int8)*++v14;
if ( v16 != *v13 )
goto LABEL_22;
++v13;
}
goto LABEL_39;
}
}
v13 = v30;
if ( !v8 )
goto LABEL_11;
goto LABEL_13;
}
if ( v8 )
{
LABEL_21:
v17 = v26;
goto LABEL_23;
}
LABEL_22:
v17 = (int)(unsigned __int8)v25 >> 1;
LABEL_23:
if ( !v10 )
{
v18 = v7 >> 1;
if ( !v8 )
{
v19 = (char *)&v25 + 1;
goto LABEL_30;
}
LABEL_27:
v19 = (char *)v27;
if ( v10 )
goto LABEL_28;
LABEL_30:
v20 = (char *)&v28 + 1;
goto LABEL_31;
}
v18 = v29;
if ( v8 )
goto LABEL_27;
v19 = (char *)&v25 + 1;
LABEL_28:
v20 = (char *)v30;
LABEL_31:
v21 = v18;
if ( v18 >= v17 )
v21 = v17;
if ( !v21 || (v22 = memcmp(v19, v20, v21)) == 0 )
{
if ( v17 < v18 )
v22 = -1;
else
v22 = v17 > v18;
}
v23 = v22 >> 31;
LABEL_40:
std::string::~string((int)&v28);
std::string::~string((int)&v25);
return v23;
}