//
// LevelBrowserLayer::isCorrect from 0x4a52e0 to 0x4a53c2 (226 bytes)
//
// 3 xrefs:
// > LevelBrowserLayer::loadLevelsFailed @ 0x4a53cc
// > LevelBrowserLayer::setupPageInfo @ 0x4a5436
// > LevelBrowserLayer::loadLevelsFinished @ 0x4a92c4
//
// 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:49:53 +0000
//
unsigned int __fastcall LevelBrowserLayer::isCorrect(LevelBrowserLayer *this, const char *a2)
{
GJSearchObject *v2; // r0
const char *Key; // r4
size_t v5; // r0
size_t v6; // r0
int v7; // r3
size_t v8; // r8
unsigned int v9; // r4
char *v10; // r0
char *v11; // r1
size_t v12; // r2
unsigned int v13; // r0
unsigned int v14; // r4
unsigned int v15; // r4
int v17; // [sp+4h] [bp-1Ch] BYREF
size_t v18; // [sp+8h] [bp-18h]
char *v19; // [sp+Ch] [bp-14h]
int v20; // [sp+10h] [bp-10h] BYREF
unsigned int v21; // [sp+14h] [bp-Ch]
char *v22; // [sp+18h] [bp-8h]
v2 = *((GJSearchObject **)this + 125);
if ( !v2 )
return 0;
v17 = 0;
v18 = 0;
v19 = nullptr;
Key = (const char *)GJSearchObject::getKey(v2);
v5 = strlen(Key);
std::string::__init(&v17, Key, v5);
v20 = 0;
v21 = 0;
v22 = nullptr;
v6 = strlen(a2);
std::string::__init(&v20, a2, v6);
v7 = v17 & 1;
if ( v7 )
v8 = v18;
else
v8 = (int)(unsigned __int8)v17 >> 1;
if ( (v20 & 1) == 0 )
{
v9 = (int)(unsigned __int8)v20 >> 1;
if ( !v7 )
{
v10 = (char *)&v17 + 1;
goto LABEL_12;
}
LABEL_9:
v10 = v19;
if ( (v20 & 1) != 0 )
goto LABEL_10;
LABEL_12:
v11 = (char *)&v20 + 1;
goto LABEL_13;
}
v9 = v21;
if ( v7 )
goto LABEL_9;
v10 = (char *)&v17 + 1;
LABEL_10:
v11 = v22;
LABEL_13:
v12 = v9;
if ( v9 >= v8 )
v12 = v8;
if ( !v12 || (v13 = memcmp(v10, v11, v12)) == 0 )
{
if ( v8 < v9 )
v13 = -1;
else
v13 = v8 > v9;
}
v14 = __clz(v13);
std::string::~string((int)&v20);
v15 = v14 >> 5;
std::string::~string((int)&v17);
return v15;
}