//
// sub_100951820 from 0x100951820 to 0x100951a8d (621 bytes)
//
// 2 xrefs:
// > ThreadSearchPopup::init @ 0x1009511f2
// > ThreadSearchPopup::textChanged @ 0x100951f15
//
// 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 12:38:39 +0000
//
void __fastcall sub_100951820(__int64 a1)
{
__int64 v1; // rsi
int v2; // r13d
int v3; // r14d
unsigned int v4; // r12d
__int64 v5; // rsi
int v6; // eax
char *v7; // r15
int v8; // r14d
char *v9; // r15
int v10; // ecx
int v11; // r14d
char *v12; // r15
int v13; // r12d
_QWORD *v14; // rbx
char *v15; // rax
const char *CString; // r15
size_t v17; // rax
size_t v18; // r14
char *v19; // r12
size_t v20; // r13
_QWORD __dst[2]; // [rsp+8h] [rbp-58h] BYREF
void *__p; // [rsp+18h] [rbp-48h]
char *v23[2]; // [rsp+20h] [rbp-40h] BYREF
char *v24; // [rsp+30h] [rbp-30h]
if ( *(_QWORD *)(a1 + 1048) )
{
v1 = *(_QWORD *)(a1 + 1032);
if ( v1 )
{
v2 = *(_DWORD *)(a1 + 1056);
CCTextInputNode::getString(v23, v1);
if ( ((__int64)v23[0] & 1) != 0 )
{
v7 = v24;
v3 = atoi(v24);
operator delete(v7);
}
else
{
v3 = atoi((const char *)v23 + 1);
}
if ( v3 < v2 )
v2 = v3;
v4 = 2000;
if ( v2 >= 2001 )
v4 = v2;
v5 = *(_QWORD *)(a1 + 1040);
if ( v5 )
{
LABEL_13:
CCTextInputNode::getString(v23, v5);
if ( ((__int64)v23[0] & 1) != 0 )
{
v9 = v24;
v8 = atoi(v24);
operator delete(v9);
}
else
{
v8 = atoi((const char *)v23 + 1);
}
v10 = 12;
if ( v8 < 12 )
v10 = v8;
v6 = 1;
if ( v10 >= 2 )
v6 = v10;
if ( !(v8 ^ 2 | v4 & 3) )
{
v11 = 29;
if ( __ROR4__(-1030792151 * v4, 2) > 0x28F5C28u || (v6 = 2, !(v4 % 0x190)) )
{
LABEL_24:
sub_100068D00(*(_QWORD *)(a1 + 1048), 1.0, (float)v11);
CCTextInputNode::getString(v23, *(_QWORD *)(a1 + 1048));
if ( ((__int64)v23[0] & 1) != 0 )
{
v12 = v24;
v13 = atoi(v24);
operator delete(v12);
if ( v13 <= v11 )
return;
}
else if ( atoi((const char *)v23 + 1) <= v11 )
{
return;
}
v14 = *(_QWORD **)(a1 + 1048);
v15 = sub_10088E820("%i", v11);
CString = (const char *)cocos2d::CCString::getCString((__int64)v15);
v17 = strlen(CString);
if ( v17 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v18 = v17;
if ( v17 >= 0x17 )
{
v20 = 26;
if ( (v17 | 7) != 0x17 )
v20 = (v17 | 7) + 1;
v19 = (char *)operator new(v20);
__p = v19;
__dst[0] = v20 + 1;
__dst[1] = v18;
}
else
{
LOBYTE(__dst[0]) = 2 * v17;
v19 = (char *)__dst + 1;
if ( !v17 )
{
LABEL_36:
v19[v18] = 0;
CCTextInputNode::setString(v14, (__int64)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
return;
}
}
memmove(v19, CString, v18);
goto LABEL_36;
}
}
LABEL_23:
v11 = dword_100A144D0[v6 - 1];
goto LABEL_24;
}
}
else
{
v4 = 2000;
v5 = *(_QWORD *)(a1 + 1040);
if ( v5 )
goto LABEL_13;
}
v6 = 1;
goto LABEL_23;
}
}