//
// ThreadSearchPopup::textChanged from 0x1400fbcf0 to 0x1400fbf90 (672 bytes)
//
// 2 xrefs:
// > ??> @ 0x14072cd48
// > ??> @ 0x1409154e8
//
// This function is hookable on this platform (idp: pc, 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 11:26:40 +0000
//
void __fastcall ThreadSearchPopup::textChanged(__int64 a1, _QWORD *a2)
{
char v4; // r14
size_t v5; // rbx
_BYTE *v6; // rax
size_t v7; // r8
const char *v8; // rcx
char v9; // r15
char *v10; // rcx
cocos2d::CCString *v11; // rax
const char *CString; // rax
_BYTE *v13; // rax
const char *v14; // rcx
char v15; // bl
char *v16; // rcx
char *String[2]; // [rsp+38h] [rbp-28h] BYREF
__int128 v18; // [rsp+48h] [rbp-18h]
v4 = 0;
v5 = -1;
if ( a2 != *(_QWORD **)(a1 + 472) )
goto LABEL_8;
v6 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a2[74] + 600LL) + 8LL))(a2[74] + 600LL);
*(_OWORD *)String = 0;
v7 = -1;
v18 = 0;
do
++v7;
while ( v6[v7] );
sub_14003D230(String, v6, v7);
v8 = (const char *)String;
v4 = 5;
if ( *((_QWORD *)&v18 + 1) > 0xFu )
v8 = String[0];
if ( atoi(v8) > *(_DWORD *)(a1 + 496) )
v9 = 1;
else
LABEL_8:
v9 = 0;
if ( (v4 & 1) != 0 )
{
v4 &= ~1u;
if ( *((_QWORD *)&v18 + 1) > 0xFu )
{
v10 = String[0];
if ( (unsigned __int64)(*((_QWORD *)&v18 + 1) + 1LL) >= 0x1000 )
{
v10 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
}
if ( v9 )
{
v11 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, *(unsigned int *)(a1 + 496));
CString = cocos2d::CCString::getCString(v11);
v18 = 0u;
*(_OWORD *)String = 0;
do
++v5;
while ( CString[v5] );
sub_14003D230(String, CString, v5);
CCTextInputNode::setString(a2, String);
}
else
{
if ( a2 != *(_QWORD **)(a1 + 480) )
goto LABEL_26;
v13 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a2[74] + 600LL) + 8LL))(a2[74] + 600LL);
*(_OWORD *)String = 0;
v18 = 0;
do
++v5;
while ( v13[v5] );
sub_14003D230(String, v13, v5);
v4 |= 0xAu;
v14 = (const char *)String;
if ( *((_QWORD *)&v18 + 1) > 0xFu )
v14 = String[0];
if ( atoi(v14) > 12 )
v15 = 1;
else
LABEL_26:
v15 = 0;
if ( (v4 & 2) != 0 && *((_QWORD *)&v18 + 1) > 0xFu )
{
v16 = String[0];
if ( (unsigned __int64)(*((_QWORD *)&v18 + 1) + 1LL) >= 0x1000 )
{
v16 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v16 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
if ( v15 )
{
*(_QWORD *)&v18 = 2;
*(_OWORD *)String = 0;
strcpy((char *)String, "12");
*((_QWORD *)&v18 + 1) = 15;
CCTextInputNode::setString(a2, String);
}
else if ( a2 == *(_QWORD **)(a1 + 472) || a2 == *(_QWORD **)(a1 + 480) || a2 == *(_QWORD **)(a1 + 488) )
{
ThreadSearchPopup::clampDayField(a1 - 544);
}
}
}