//
// LevelSearchLayer::updateSearchLabel from 0x6ce3bc to 0x6ce828 (1132 bytes)
//
// 4 xrefs:
// > LevelSearchLayer::textInputClosed @ 0x6ce85c
// > LevelSearchLayer::textChanged @ 0x6ce948
// > LevelSearchLayer::init @ 0x6d1c4c
// > ??> @ 0x71880
//
// 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
//
void LevelSearchLayer::updateSearchLabel(LevelSearchLayer *a1, const char *a2)
{
cocos2d::CCLabelBMFont *m_textLabel; // x24
char *v5; // x1
_DWORD *v6; // x20
unsigned __int64 v7; // x19
unsigned __int64 v8; // x27
size_t v9; // x2
int v10; // w0
_BOOL4 v11; // w27
_DWORD *v12; // x20
unsigned __int64 v13; // x26
unsigned __int64 v14; // x19
size_t v15; // x2
unsigned __int64 v16; // x19
char *v17; // x0
char *v18; // x0
char *v19; // x0
CCTextInputNode *m_searchInput; // x20
char *v21; // x0
void (__fastcall *v22)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x2
_DWORD *v23; // x1
char *v24; // x0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
unsigned int *v26; // x1
int v27; // w2
unsigned int *v28; // x20
int v29; // w1
unsigned int *v30; // x1
int v31; // w2
unsigned int *v32; // x20
int v33; // w1
unsigned int *v34; // x1
int v35; // w2
void *v36; // [xsp+80h] [xbp+80h] BYREF
void *v37; // [xsp+88h] [xbp+88h] BYREF
void *v38; // [xsp+90h] [xbp+90h] BYREF
void *v39; // [xsp+98h] [xbp+98h] BYREF
_DWORD *v40; // [xsp+A0h] [xbp+A0h] BYREF
m_textLabel = a1->m_searchInput->m_textLabel;
if ( a1->m_type == 1 )
v5 = "Enter a list or id";
else
v5 = "Enter a level, user or id";
sub_D153B8((int)&v36, v5);
sub_D153B8((int)&v37, (char *)a2);
sub_D153B8((int)&v38, &byte_F288A0);
v6 = v38;
v7 = *((_QWORD *)v37 - 3);
v8 = *((_QWORD *)v38 - 3);
if ( v8 > v7 )
v9 = *((_QWORD *)v37 - 3);
else
v9 = *((_QWORD *)v38 - 3);
if ( !memcmp(v37, v38, v9) )
{
v10 = v7 - v8;
if ( v7 - v8 + 0x80000000 <= 0xFFFFFFFF )
{
v11 = 1;
if ( !v10 )
{
v18 = (char *)(v6 - 6);
if ( v6 - 6 == (_DWORD *)&qword_124B6B0 )
goto LABEL_16;
goto LABEL_30;
}
}
}
sub_D153B8((int)&v39, (char *)a2);
v11 = 0;
v12 = v39;
v13 = *((_QWORD *)v36 - 3);
v14 = *((_QWORD *)v39 - 3);
if ( v13 > v14 )
v15 = *((_QWORD *)v39 - 3);
else
v15 = *((_QWORD *)v36 - 3);
if ( !memcmp(v39, v36, v15) )
{
v16 = v14 - v13;
if ( v16 + 0x80000000 <= 0xFFFFFFFF )
v11 = v16 == 0;
}
v17 = (char *)(v12 - 6);
if ( v12 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = v12 - 2;
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *(v12 - 2);
*(v12 - 2) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v17);
}
v6 = v38;
v18 = (char *)v38 - 24;
if ( (char *)v38 - 24 != (char *)&qword_124B6B0 )
{
LABEL_30:
if ( &pthread_create )
{
v28 = v6 - 2;
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *(v6 - 2);
*(v6 - 2) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v18);
}
LABEL_16:
v19 = (char *)v37 - 24;
if ( (char *)v37 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = (unsigned int *)((char *)v37 - 8);
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *((_DWORD *)v37 - 2);
*((_DWORD *)v37 - 2) = v31 - 1;
}
if ( v31 <= 0 )
operator delete(v19);
}
if ( !v11 )
{
setColor = m_textLabel->setColor;
LOWORD(v40) = -1;
BYTE2(v40) = -1;
setColor(m_textLabel, (const cocos2d::ccColor3B *)&v40);
v23 = v36;
v24 = (char *)v36 - 24;
if ( (char *)v36 - 24 == (char *)&qword_124B6B0 )
return;
goto LABEL_22;
}
m_searchInput = a1->m_searchInput;
sub_D18D28(&v40, &v36);
CCTextInputNode::updateLabel(m_searchInput, (const void **)&v40);
v21 = (char *)(v40 - 6);
if ( v40 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = v40 - 2;
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *(v40 - 2);
*(v40 - 2) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v21);
}
v22 = m_textLabel->setColor;
LOWORD(v40) = -26260;
BYTE2(v40) = -40;
v22(m_textLabel, (const cocos2d::ccColor3B *)&v40);
v23 = v36;
v24 = (char *)v36 - 24;
if ( (char *)v36 - 24 != (char *)&qword_124B6B0 )
{
LABEL_22:
if ( &pthread_create )
{
v26 = v23 - 2;
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *(v23 - 2);
*(v23 - 2) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v24);
}
}