//
// LabelGameObject::removeLabel from 0x1001a19b0 to 0x1001a1ad0 (288 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::updateLevelFont @ 0x1000c49de
// > LabelGameObject::createLabel @ 0x1001a18ad
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:25:59 +0000
//
void __fastcall LabelGameObject::removeLabel(__int64 a1)
{
__int64 v2; // rdi
const char *v3; // r15
size_t v4; // rax
std::string::size_type v5; // r14
char *data; // r12
size_t v7; // r13
std::string __dst[2]; // [rsp+0h] [rbp-40h] BYREF
v2 = *(_QWORD *)(a1 + 1840);
if ( v2 )
{
v3 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 944LL))(v2);
v4 = strlen(v3);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
data = (char *)operator new(v7);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v7 + 1;
__dst[0].__r_.__value_.__l.__size_ = v5;
}
else
{
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v4);
data = __dst[0].__r_.__value_.__s.__data_;
if ( !v4 )
{
__dst[0].__r_.__value_.__s.__data_[0] = 0;
if ( *(_BYTE *)(a1 + 1904) )
goto LABEL_6;
goto LABEL_14;
}
}
memmove(data, v3, v5);
data[v5] = 0;
if ( *(_BYTE *)(a1 + 1904) )
{
LABEL_6:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_8:
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1840) + 536LL))(*(_QWORD *)(a1 + 1840));
*(_QWORD *)(a1 + 1840) = 0;
return;
}
LABEL_7:
operator delete(__dst[0].__r_.__value_.__l.__data_);
goto LABEL_8;
}
LABEL_14:
std::string::operator=((std::string *)(a1 + 1856), __dst);
*(_BYTE *)(a1 + 1848) = 1;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_8;
goto LABEL_7;
}
}