//
// cocos2d::CCLabelAtlas::setString from 0x7d284c to 0x7d295e (274 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'cocos2d::CCLabelAtlas::setString @ 0x7d2968
//
// 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:00:36 +0000
//
int __fastcall cocos2d::CCLabelAtlas::setString(cocos2d::CCTextureAtlas **this, const char *a2)
{
size_t v4; // r7
size_t v5; // r0
int v6; // r3
size_t v7; // r5
unsigned int v8; // r1
char *v9; // r3
int v10; // r3
int result; // r0
float v12[2]; // [sp+14h] [bp-Ch] BYREF
v4 = strlen(a2);
if ( v4 > (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 76) + 40))(*(this + 76)) )
cocos2d::CCTextureAtlas::resizeCapacity(*(this + 76), v4);
if ( (*(_BYTE *)(this + 84) & 1) != 0 )
{
*(_BYTE *)*(this + 86) = 0;
*(this + 85) = nullptr;
}
else
{
*((_BYTE *)this + 337) = 0;
*((_BYTE *)this + 336) = 0;
}
v5 = strlen(a2);
v6 = *((unsigned __int8 *)this + 336);
v7 = v5;
if ( (v6 & 1) == 0 )
{
if ( v5 <= 0xA )
{
v9 = (char *)this + 337;
goto LABEL_11;
}
v10 = v6 >> 1;
v8 = 10;
LABEL_17:
std::string::__grow_by_and_replace((int)(this + 84), v8, v5 - v8, v10, 0, v10, v5, a2);
goto LABEL_18;
}
v8 = ((unsigned int)*(this + 84) & 0xFFFFFFFE) - 1;
if ( v8 < v5 )
{
v10 = (int)*(this + 85);
goto LABEL_17;
}
v9 = (char *)*(this + 86);
LABEL_11:
if ( v5 )
v9 = (char *)memmove(v9, a2, v5);
v9[v7] = 0;
if ( (*(_BYTE *)(this + 84) & 1) != 0 )
*(this + 85) = (cocos2d::CCTextureAtlas *)v7;
else
*((_BYTE *)this + 336) = 2 * v7;
LABEL_18:
(*((void (__fastcall **)(cocos2d::CCTextureAtlas **))*this + 132))(this);
cocos2d::CCSize::CCSize(v12, (float)((unsigned int)*(this + 73) * v4), (float)(unsigned int)*(this + 74));
result = (*((int (__fastcall **)(cocos2d::CCTextureAtlas **, float *))*this + 40))(this, v12);
*(this + 80) = (cocos2d::CCTextureAtlas *)v4;
return result;
}