//
// SecretLayer::updateSearchLabel from 0x901fd0 to 0x902434 (1124 bytes)
//
// 4 xrefs:
// > SecretLayer::textInputClosed @ 0x902468
// > SecretLayer::textChanged @ 0x902554
// > SecretLayer::init @ 0x9062fc
// > ??> @ 0x40c80
//
// 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 SecretLayer::updateSearchLabel(SecretLayer *a1, const char *a2)
{
cocos2d::CCLabelBMFont *m_textLabel; // x23
_DWORD *v5; // x20
unsigned __int64 v6; // x19
unsigned __int64 v7; // x22
size_t v8; // x2
unsigned __int64 v9; // x19
_DWORD *v10; // x20
_BOOL4 v11; // w26
_DWORD *v12; // x27
unsigned __int64 v13; // x19
unsigned __int64 v14; // x28
size_t v15; // x2
unsigned __int64 v16; // x19
char *v17; // x0
char *v18; // x0
char *v19; // x0
char *v20; // x0
CCTextInputNode *m_searchInput; // x20
char *v22; // x0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x2
void (__fastcall *v24)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x3
unsigned int *v25; // x20
int v26; // w1
unsigned int *v27; // x1
int v28; // w2
unsigned int *v29; // x20
int v30; // w1
unsigned int *v31; // x27
int v32; // w1
unsigned int *v33; // x1
int v34; // w2
void *v35; // [xsp+88h] [xbp+88h] BYREF
void *v36; // [xsp+90h] [xbp+90h] BYREF
void *v37; // [xsp+98h] [xbp+98h] BYREF
void *v38; // [xsp+A0h] [xbp+A0h] BYREF
m_textLabel = a1->m_searchInput->m_textLabel;
sub_D153B8((int)&v35, (char *)a2);
sub_D153B8((int)&v36, &byte_F288A0);
v5 = v36;
v6 = *((_QWORD *)v35 - 3);
v7 = *((_QWORD *)v36 - 3);
if ( v7 > v6 )
v8 = *((_QWORD *)v35 - 3);
else
v8 = *((_QWORD *)v36 - 3);
if ( !memcmp(v35, v36, v8) )
{
v9 = v6 - v7;
if ( v9 + 0x80000000 <= 0xFFFFFFFF && !(_DWORD)v9 )
{
v19 = (char *)(v5 - 6);
v11 = 1;
if ( v5 - 6 == (_DWORD *)&qword_124B6B0 )
goto LABEL_15;
goto LABEL_22;
}
}
sub_D153B8((int)&v37, (char *)a2);
sub_D153B8((int)&v38, "...");
v10 = v37;
v11 = 0;
v12 = v38;
v13 = *((_QWORD *)v37 - 3);
v14 = *((_QWORD *)v38 - 3);
if ( v14 > v13 )
v15 = *((_QWORD *)v37 - 3);
else
v15 = *((_QWORD *)v38 - 3);
if ( !memcmp(v37, v38, v15) )
{
v16 = v13 - v14;
if ( v16 + 0x80000000 <= 0xFFFFFFFF )
v11 = v16 == 0;
}
v17 = (char *)(v12 - 6);
if ( v12 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v31 = v12 - 2;
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *(v12 - 2);
*(v12 - 2) = v32 - 1;
}
if ( v32 <= 0 )
operator delete(v17);
v10 = v37;
}
v18 = (char *)(v10 - 6);
if ( v10 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = v10 - 2;
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = *(v10 - 2);
*(v10 - 2) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v18);
}
v5 = v36;
v19 = (char *)v36 - 24;
if ( (char *)v36 - 24 != (char *)&qword_124B6B0 )
{
LABEL_22:
if ( &pthread_create )
{
v25 = v5 - 2;
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(v5 - 2);
*(v5 - 2) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v19);
}
LABEL_15:
v20 = (char *)v35 - 24;
if ( (char *)v35 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)((char *)v35 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *((_DWORD *)v35 - 2);
*((_DWORD *)v35 - 2) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v20);
}
if ( v11 )
{
m_searchInput = a1->m_searchInput;
sub_D153B8((int)&v38, "...");
CCTextInputNode::updateLabel(m_searchInput, (const void **)&v38);
v22 = (char *)v38 - 24;
if ( (char *)v38 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)((char *)v38 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *((_DWORD *)v38 - 2);
*((_DWORD *)v38 - 2) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v22);
}
setColor = m_textLabel->setColor;
LOWORD(v38) = -26260;
BYTE2(v38) = -40;
setColor(m_textLabel, (const cocos2d::ccColor3B *)&v38);
}
else
{
v24 = m_textLabel->setColor;
LOWORD(v38) = -1;
BYTE2(v38) = -1;
v24(m_textLabel, (const cocos2d::ccColor3B *)&v38);
}
}