//
// cocos2d::CCComponent::setName from 0x7fdb74 to 0x7fdc28 (180 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:01:17 +0000
//
void __fastcall cocos2d::CCComponent::setName(cocos2d::CCComponent *this, const char *a2)
{
unsigned int v4; // r0
size_t v5; // r5
char *v6; // r6
unsigned int v7; // r8
unsigned int v8; // r3
unsigned int v9; // r3
unsigned int v10; // r4
_BYTE *v11; // r0
_BYTE *v12; // r10
v4 = strlen(a2);
v5 = v4;
if ( (*((_BYTE *)this + 56) & 1) == 0 )
{
v6 = (char *)this + 57;
if ( v4 <= 0xA )
goto LABEL_3;
v7 = 10;
LABEL_10:
v8 = 2 * v7;
if ( 2 * v7 < v4 )
v8 = v4;
if ( v8 <= 0xA )
v9 = 10;
else
v9 = ((v8 + 16) & 0xFFFFFFF0) - 1;
goto LABEL_14;
}
v6 = *((char **)this + 16);
v7 = (*((_DWORD *)this + 14) & 0xFFFFFFFE) - 1;
if ( v7 >= v4 )
{
LABEL_3:
if ( v4 )
memmove(v6, a2, v4);
v6[v5] = 0;
if ( (*((_BYTE *)this + 56) & 1) != 0 )
*((_DWORD *)this + 15) = v5;
else
*((_BYTE *)this + 56) = 2 * v5;
return;
}
if ( v7 <= 0x7FFFFFE6 )
goto LABEL_10;
v9 = -18;
LABEL_14:
v10 = v9 + 1;
v11 = (_BYTE *)operator new(v9 + 1);
v12 = v11;
if ( v5 )
memcpy(v11, a2, v5);
if ( v7 != 10 )
operator delete(v6);
*((_DWORD *)this + 16) = v12;
*((_DWORD *)this + 15) = v5;
*((_DWORD *)this + 14) = v10 | 1;
v12[v5] = 0;
}