//
// LevelSettingsObject::findIDByName from 0x7978d8 to 0x797ab0 (472 bytes)
//
// 3 xrefs:
// > IDNameBrowserPopup::updateConflictLabel @ 0xcde37c
// > IDNameBrowserPopup::onFormAdd @ 0xce3d68
// > ??> @ 0x7f9a8
//
// 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 12:53:34 +0000
//
__int64 __fastcall LevelSettingsObject::findIDByName(LevelSettingsObject *a1, __int64 a2, int a3)
{
__int64 v4; // x19
int v5; // w20
size_t v6; // x2
int v7; // w4
__int64 v8; // x1
char *v9; // x1
void *v10; // x26
_BOOL4 v11; // w25
unsigned __int8 *v13; // x0
unsigned __int8 *v14; // x1
unsigned __int8 *v15; // x2
int v16; // t1
__int64 v18[2]; // [xsp+68h] [xbp+68h] BYREF
void *v19; // [xsp+78h] [xbp+78h]
__int64 v20[2]; // [xsp+80h] [xbp+80h] BYREF
void *v21; // [xsp+90h] [xbp+90h]
GameToolbox::lowercaseASCII(a2, v18);
v4 = LevelSettingsObject::getIDNames(a1, a3)[2];
if ( v4 )
{
v5 = 0;
while ( 1 )
{
while ( 1 )
{
if ( v5 > 0 && *(_DWORD *)(v4 + 16) > v5 )
goto LABEL_4;
GameToolbox::lowercaseASCII(v4 + 24, v20);
v6 = LOBYTE(v20[0]) >> 1;
if ( (v20[0] & 1) != 0 )
v6 = v20[1];
v7 = v18[0] & 1;
v8 = LOBYTE(v18[0]) >> 1;
if ( v7 )
v8 = v18[1];
if ( v6 == v8 )
break;
if ( (v20[0] & 1) != 0 )
{
v10 = v21;
v11 = 0;
goto LABEL_17;
}
LABEL_4:
v4 = *(_QWORD *)v4;
if ( !v4 )
goto LABEL_20;
}
if ( (v20[0] & 1) == 0 )
{
v13 = (unsigned __int8 *)v18 + 1;
if ( v7 )
v13 = (unsigned __int8 *)v19;
if ( !v6 )
goto LABEL_18;
if ( BYTE1(v20[0]) == *v13 )
{
v14 = (unsigned __int8 *)v20 + 2;
v15 = (unsigned __int8 *)v20 + v6 + 1;
while ( 1 )
{
++v13;
if ( v14 == v15 )
break;
v16 = *v14++;
if ( *v13 != v16 )
goto LABEL_4;
}
v5 = *(_DWORD *)(v4 + 16);
goto LABEL_19;
}
goto LABEL_4;
}
if ( v7 )
{
v9 = (char *)v19;
v10 = v21;
}
else
{
v10 = v21;
v9 = (char *)v18 + 1;
}
v11 = 1;
if ( v6 )
v11 = memcmp(v21, v9, v6) == 0;
LABEL_17:
operator delete(v10);
if ( !v11 )
goto LABEL_4;
LABEL_18:
v5 = *(_DWORD *)(v4 + 16);
LABEL_19:
v4 = *(_QWORD *)v4;
if ( !v4 )
goto LABEL_20;
}
}
v5 = 0;
LABEL_20:
if ( (v18[0] & 1) != 0 )
operator delete(v19);
return (unsigned int)v5;
}