//
// ShareCommentLayer::onClear from 0x7e7f5c to 0x7e8100 (420 bytes)
//
// 3 xrefs:
// > ??> @ 0xb8620
// > ShareCommentLayer::init @ 0x7e7720
// > ??> @ 0x122e5f0
//
// 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 ShareCommentLayer::onClear(ShareCommentLayer *a1, cocos2d::CCObject *a2)
{
unsigned __int8 *v3; // x0
CCTextInputNode *m_commentInput; // x24
unsigned __int8 *v5; // x0
unsigned int *v6; // x1
int v7; // w2
unsigned int *v8; // x1
int v9; // w2
const unsigned __int8 *v10; // [xsp+50h] [xbp+50h] BYREF
sub_D153B8((int)&v10, &byte_F288A0);
ShareCommentLayer::updateDescText(a1, (__int64)&v10);
v3 = (unsigned __int8 *)(v10 - 24);
if ( v10 - 24 != (const unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v10 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *((_DWORD *)v10 - 2);
*((_DWORD *)v10 - 2) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v3);
}
m_commentInput = a1->m_commentInput;
sub_D153B8((int)&v10, &byte_F288A0);
CCTextInputNode::setString(m_commentInput, &v10);
v5 = (unsigned __int8 *)(v10 - 24);
if ( v10 - 24 != (const unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *((_DWORD *)v10 - 2);
*((_DWORD *)v10 - 2) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v5);
}
}