//
// LabelGameObject::removeLabel from 0x1001c10e0 to 0x1001c1200 (288 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::updateLevelFont @ 0x1000f128e
// > LabelGameObject::createLabel @ 0x1001c0fdd
//
// 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 __fastcall LabelGameObject::removeLabel(LabelGameObject *a1)
{
double v1; // xmm0_8
cocos2d::CCLabelBMFont *m_label; // rdi
const char *v4; // r15
size_t v5; // rax
std::string::size_type v6; // r14
char *data; // r12
size_t v8; // r13
std::string __dst[2]; // [rsp+0h] [rbp-40h] BYREF
m_label = a1->m_label;
if ( m_label )
{
v4 = (const char *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_label->getString)(m_label);
v5 = strlen(v4);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v1);
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = 26;
if ( (v5 | 7) != 0x17 )
v8 = (v5 | 7) + 1;
data = (char *)operator new(v8);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v8 + 1;
__dst[0].__r_.__value_.__l.__size_ = v6;
}
else
{
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v5);
data = __dst[0].__r_.__value_.__s.__data_;
if ( !v5 )
{
__dst[0].__r_.__value_.__s.__data_[0] = 0;
if ( a1->m_updateLabel )
goto LABEL_6;
goto LABEL_14;
}
}
memmove(data, v4, v6);
data[v6] = 0;
if ( a1->m_updateLabel )
{
LABEL_6:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_8:
((void (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_label->removeMeAndCleanup)(a1->m_label);
a1->m_label = nullptr;
return;
}
LABEL_7:
operator delete(__dst[0].__r_.__value_.__l.__data_);
goto LABEL_8;
}
LABEL_14:
std::string::operator=((std::string *)&a1->m_labelString, __dst);
a1->m_labelDirty = 1;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_8;
goto LABEL_7;
}
}