//
// ThreadSearchPopup::clampDayField from 0x1400fbb00 to 0x1400fbce4 (484 bytes)
//
// 5 xrefs:
// > ThreadSearchPopup::init @ 0x1400fb87d
// > ThreadSearchPopup::textChanged @ 0x1400fbf66
// > ??> @ 0x140894e68
// > ??> @ 0x140894e78
// > ??> @ 0x1409154c4
//
// 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::clampDayField(__int64 a1)
{
__int64 v2; // rsi
int v3; // edi
int v4; // ebx
__int64 v5; // rcx
int v6; // eax
int v7; // edi
__int64 v8; // rax
__int64 v9; // rcx
_BYTE *v10; // rax
size_t v11; // rbx
size_t v12; // r8
const char *v13; // rcx
int v14; // esi
char *v15; // r8
cocos2d::CCString *v16; // rax
const char *CString; // rax
char *String[2]; // [rsp+38h] [rbp-40h] BYREF
__int128 v19; // [rsp+48h] [rbp-30h]
if ( *(_QWORD *)(a1 + 1032) )
{
v2 = *(_QWORD *)(a1 + 1016);
v3 = *(_DWORD *)(a1 + 1040);
v4 = ThreadSearchPopup::fieldValue(a1, *(_QWORD *)(a1 + 1024), 1u, 12);
v6 = ThreadSearchPopup::fieldValue(v5, v2, 0x7D0u, v3);
v7 = sub_1400FAF60(v6, v4);
v8 = *(_QWORD *)(a1 + 1032);
*(_BYTE *)(v8 + 676) = 1;
*(_DWORD *)(v8 + 680) = 1065353216;
*(float *)(v8 + 684) = (float)v7;
v9 = *(_QWORD *)(*(_QWORD *)(a1 + 1032) + 592LL) + 600LL;
v10 = (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 8LL))(v9);
v11 = -1;
*(_OWORD *)String = 0;
v12 = -1;
v19 = 0;
do
++v12;
while ( v10[v12] );
sub_14003D230(String, v10, v12);
v13 = (const char *)String;
if ( *((_QWORD *)&v19 + 1) > 0xFu )
v13 = String[0];
v14 = atoi(v13);
if ( *((_QWORD *)&v19 + 1) > 0xFu )
{
v15 = String[0];
if ( (unsigned __int64)(*((_QWORD *)&v19 + 1) + 1LL) >= 0x1000 )
{
v15 = *((char **)String[0] - 1);
if ( (unsigned __int64)(String[0] - v15 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v15);
}
if ( v14 > v7 )
{
v16 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v7);
CString = cocos2d::CCString::getCString(v16);
v19 = 0u;
*(_OWORD *)String = 0;
do
++v11;
while ( CString[v11] );
sub_14003D230(String, CString, v11);
CCTextInputNode::setString(*(_QWORD **)(a1 + 1032), String);
}
}
}