//
// cocos2d::CCTextFieldTTF::setPlaceHolder from 0x1800b5db0 to 0x1800b5ee7 (311 bytes)
//
// 3 xrefs:
// > ??> @ 0x180106bc8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8acc
//
// 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=1
void __fastcall cocos2d::CCTextFieldTTF::setPlaceHolder(cocos2d::CCTextFieldTTF *this, const char *a2)
{
std::string *m_pPlaceHolder; // rbx
unsigned __int64 m_capacity; // rdx
char *m_bigStorage; // rcx
std::string *v7; // rax
std::string *v8; // rbx
size_t v9; // r8
m_pPlaceHolder = this->m_pPlaceHolder;
if ( m_pPlaceHolder )
{
m_capacity = m_pPlaceHolder->m_data.m_capacity;
if ( m_capacity > 0xF )
{
m_bigStorage = m_pPlaceHolder->m_data.m_bigStorage;
if ( m_capacity + 1 >= 0x1000 )
{
if ( (unsigned __int64)&m_bigStorage[-*((_QWORD *)m_bigStorage - 1) - 8] > 0x1F )
invalid_parameter_noinfo_noreturn();
m_bigStorage = *((char **)m_bigStorage - 1);
}
j_j_free_0(m_bigStorage);
}
m_pPlaceHolder->m_data.m_size = 0;
m_pPlaceHolder->m_data.m_capacity = 15;
m_pPlaceHolder->m_data.m_smallStorage._Elems[0] = 0;
j_j_free_0(m_pPlaceHolder);
this->m_pPlaceHolder = nullptr;
}
v7 = (std::string *)operator new(0x20u);
v8 = v7;
if ( a2 )
{
if ( v7 )
{
v7->m_data.0 = 0;
v7->m_data.m_size = 0;
v7->m_data.m_capacity = 0;
v9 = -1;
do
++v9;
while ( a2[v9] );
sub_18000CE60(v7, a2, v9);
}
else
{
v8 = nullptr;
}
}
else if ( v7 )
{
v7->m_data.0 = 0;
v7->m_data.m_size = 0;
v7->m_data.m_capacity = 15;
v7->m_data.m_smallStorage._Elems[0] = 0;
}
else
{
v8 = nullptr;
}
this->m_pPlaceHolder = v8;
if ( !this->m_pInputText->m_data.m_size )
{
if ( v8->m_data.m_capacity > 0xF )
v8 = (std::string *)v8->m_data.m_bigStorage;
cocos2d::CCLabelTTF::setString(
(cocos2d::CCLabelTTF *)&this->cocos2d::CCLabelProtocol,
v8->m_data.m_smallStorage._Elems);
}
}