//
// ThreadSearchPopup::clampDayField from 0x74e0b4 to 0x74e1c6 (274 bytes)
//
// 2 xrefs:
// > ThreadSearchPopup::init @ 0x74e7a2
// > ThreadSearchPopup::textChanged @ 0x74ea36
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:48 +0000
//
int __fastcall ThreadSearchPopup::clampDayField(int this, int a2, char *a3, int a4)
{
int v4; // r4
char *v5; // r6
char *v6; // r0
int v7; // r5
int v8; // r5
const char *v9; // r6
char *v10; // r0
int v11; // r8
int v12; // r4
cocos2d::CCString *v13; // r0
const char *CString; // r0
const char *v15; // r6
size_t v16; // r0
int v17; // [sp+0h] [bp-10h] BYREF
int v18; // [sp+4h] [bp-Ch]
char *v19; // [sp+8h] [bp-8h]
int v20; // [sp+Ch] [bp-4h]
v17 = this;
v18 = a2;
v19 = a3;
v20 = a4;
v4 = this;
if ( !*(_DWORD *)(this + 728) )
return this;
v5 = ThreadSearchPopup::fieldValue(
(ThreadSearchPopup *)this,
*(CCTextInputNode **)(this + 720),
(char *)&stru_7CC.st_value,
*(char **)(this + 732));
v6 = ThreadSearchPopup::fieldValue(
(ThreadSearchPopup *)v4,
*(CCTextInputNode **)(v4 + 724),
(_BYTE *)&dword_0 + 1,
&byte_9[3]);
v7 = (int)v6;
if ( v6 == (_BYTE *)&dword_0 + 2 )
{
if ( !((_DWORD)v5 << 30) && ((int)v5 % 100 || !((int)v5 % 400)) )
{
v9 = (_BYTE *)(&dword_1C + 1);
goto LABEL_14;
}
goto LABEL_8;
}
if ( (int)v6 > 1 )
{
LABEL_8:
if ( (int)v6 >= 12 )
v7 = 12;
v8 = v7 - 1;
goto LABEL_12;
}
v8 = 0;
LABEL_12:
v9 = *(const char **)&word_BF0730[2 * v8 + 8];
LABEL_14:
CCTextInputNode::setWheelRange(*(_DWORD *)(v4 + 728), 1.0, (float)(int)v9);
CCTextInputNode::getString((CCTextInputNode *)&v17, *(_DWORD *)(v4 + 728));
if ( (v17 & 1) != 0 )
v10 = v19;
else
v10 = (char *)&v17 + 1;
v11 = atoi(v10);
this = std::string::~string((int)&v17);
if ( v11 > (int)v9 )
{
v12 = *(_DWORD *)(v4 + 728);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v9);
CString = (const char *)cocos2d::CCString::getCString(v13);
v17 = 0;
v18 = 0;
v19 = nullptr;
v15 = CString;
v16 = strlen(CString);
std::string::__init(&v17, v15, v16);
CCTextInputNode::setString(v12, (int)&v17);
return std::string::~string((int)&v17);
}
return this;
}