//
// SecretLayer::updateSearchLabel from 0x1403dfa40 to 0x1403dfd24 (740 bytes)
//
// 3 xrefs:
// > SecretLayer::init @ 0x1403ddc1c
// > SecretLayer::textInputClosed @ 0x1403df9e4
// > ??> @ 0x1406d7e5c
//
// 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
//
// Hidden C++ exception states: #wind=3
void SecretLayer::updateSearchLabel(SecretLayer *a1, const char *a2)
{
size_t v3; // rbx
size_t v4; // r8
char v5; // si
void **v6; // rcx
char *v7; // r15
unsigned __int64 v8; // r13
__int64 v9; // r14
size_t v10; // r8
unsigned __int64 v11; // r14
unsigned __int64 v12; // rdi
char *v13; // rbx
bool v14; // r12
void **v15; // rcx
unsigned __int64 v16; // r12
size_t v17; // r8
char *v18; // rax
void *v19; // rcx
char *v20; // rax
int v21; // [rsp+20h] [rbp-79h] BYREF
cocos2d::CCLabelBMFont *m_textLabel; // [rsp+28h] [rbp-71h]
SecretLayer *v23; // [rsp+30h] [rbp-69h]
void *Buf1[2]; // [rsp+38h] [rbp-61h] BYREF
__int64 v25; // [rsp+48h] [rbp-51h]
unsigned __int64 v26; // [rsp+50h] [rbp-49h]
void *Block[2]; // [rsp+58h] [rbp-41h] BYREF
unsigned __int64 v28; // [rsp+68h] [rbp-31h]
unsigned __int64 v29; // [rsp+70h] [rbp-29h]
void *v30[2]; // [rsp+78h] [rbp-21h] BYREF
__int64 v31; // [rsp+88h] [rbp-11h]
__int64 v32; // [rsp+90h] [rbp-9h]
__int128 Buf2; // [rsp+98h] [rbp-1h] BYREF
__int64 v34; // [rsp+A8h] [rbp+Fh]
__int64 v35; // [rsp+B0h] [rbp+17h]
v23 = a1;
v21 = 0;
m_textLabel = a1->m_searchInput->m_textLabel;
Buf2 = 0;
v34 = 0;
v35 = 15;
LOBYTE(Buf2) = 0;
v21 = 1;
*(_OWORD *)Buf1 = 0;
v25 = 0;
v26 = 0;
v3 = -1;
v4 = -1;
do
++v4;
while ( a2[v4] );
sub_14003A930(Buf1, a2, v4);
v5 = 3;
v6 = Buf1;
v7 = (char *)Buf1[0];
v8 = v26;
if ( v26 > 0xF )
v6 = (void **)Buf1[0];
v9 = v25;
v10 = v25;
if ( v25 )
v10 = 0;
if ( memcmp(v6, &Buf2, v10) || v9 )
{
*(_OWORD *)v30 = 0;
v31 = 3;
v11 = 15;
v32 = 15;
LOWORD(v30[0]) = *(_WORD *)"...";
WORD1(v30[0]) = (unsigned __int8)asc_14053DBB0[2];
v21 = 7;
*(_OWORD *)Block = 0;
v28 = 0;
v29 = 0;
do
++v3;
while ( a2[v3] );
sub_14003A930(Block, a2, v3);
v5 = 15;
v15 = Block;
v13 = (char *)Block[0];
v12 = v29;
if ( v29 > 0xF )
v15 = (void **)Block[0];
v16 = v28;
v17 = v28;
if ( v28 > 3 )
v17 = 3;
v14 = !memcmp(v15, v30, v17) && v16 == 3;
}
else
{
v11 = v32;
v12 = v29;
v13 = (char *)Block[0];
v14 = 1;
}
if ( (v5 & 8) != 0 )
{
v5 &= ~8u;
if ( v12 > 0xF )
{
v18 = v13;
if ( v12 + 1 >= 0x1000 )
{
v13 = *((char **)v13 - 1);
if ( (unsigned __int64)(v18 - v13 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v13);
}
}
if ( (v5 & 4) != 0 )
{
v5 &= ~4u;
if ( v11 > 0xF )
{
v19 = v30[0];
if ( v11 + 1 >= 0x1000 )
{
v19 = *((void **)v30[0] - 1);
if ( (unsigned __int64)((char *)v30[0] - (char *)v19 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v19);
}
}
if ( (v5 & 2) != 0 && v8 > 0xF )
{
v20 = v7;
if ( v8 + 1 >= 0x1000 )
{
v7 = *((char **)v7 - 1);
if ( (unsigned __int64)(v20 - v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
if ( v14 )
{
*(_OWORD *)Buf1 = 0;
v25 = 3;
v26 = 15;
LOWORD(Buf1[0]) = *(_WORD *)"...";
WORD1(Buf1[0]) = (unsigned __int8)asc_14053DBB0[2];
CCTextInputNode::updateLabel(v23->m_searchInput, (__int64)Buf1);
LOWORD(v21) = -26260;
BYTE2(v21) = -40;
}
else
{
LOWORD(v21) = -1;
BYTE2(v21) = -1;
}
m_textLabel->setColor(&m_textLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v21);
}