//
// CustomizeObjectLayer::onClear from 0x83fcf8 to 0x83feb0 (440 bytes)
//
// 4 xrefs:
// > CustomizeObjectLayer::textInputOpened @ 0x83ffcc
// > ??> @ 0x6b970
// > CustomizeObjectLayer::init @ 0x843a3c
// > ??> @ 0x122b870
//
// 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
//
void CustomizeObjectLayer::onClear(CustomizeObjectLayer *a1, cocos2d::CCObject *a2)
{
__int64 *m_targetObject; // x21
char *v4; // x0
CCTextInputNode *m_textInput; // x25
char *v6; // x0
unsigned int *v7; // x1
int v8; // w2
unsigned int *v9; // x1
int v10; // w2
_DWORD *v11; // [xsp+60h] [xbp+60h] BYREF
m_targetObject = (__int64 *)a1->m_targetObject;
if ( m_targetObject )
{
a1->m_disableTextDelegate = 1;
sub_D153B8((int)&v11, &byte_F288A0);
TextGameObject::updateTextObject(m_targetObject, (const void **)&v11, 0);
v4 = (char *)(v11 - 6);
if ( v11 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = v11 - 2;
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *(v11 - 2);
*(v11 - 2) = v10 - 1;
}
if ( v10 <= 0 )
operator delete(v4);
}
m_textInput = a1->m_textInput;
sub_D153B8((int)&v11, &byte_F288A0);
CCTextInputNode::setString(m_textInput, (const unsigned __int8 **)&v11);
v6 = (char *)(v11 - 6);
if ( v11 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = v11 - 2;
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(v11 - 2);
*(v11 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
a1->m_disableTextDelegate = 0;
}
}