//
// cocos2d::CCString::CCString from 0xd46244 to 0xd4632c (232 bytes)
//
// 6 xrefs:
// > cocos2d::CCString::create @ 0xd4660c
// > cocos2d::CCDictMaker::endElement @ 0xd75dd4
// > cocos2d::CCDictMaker::textHandler @ 0xd762c4
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary @ 0xd8b790
// > ??> @ 0x75bc8
// > ??> @ 0xeeb10
//
// This function is hookable on this platform (idp: arm, 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 13:07:34 +0000
//
// Alternative name is '_ZN7cocos2d8CCStringC2ERKNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE'
unsigned __int64 __fastcall cocos2d::CCString::CCString(_QWORD *a1, _QWORD *a2)
{
__int64 v3; // x3
unsigned __int64 result; // x0
size_t v5; // x21
const void *v6; // x23
unsigned __int64 v7; // x0
__int64 v8; // x22
__int64 v9; // x0
_BYTE *v10; // x3
cocos2d::CCObject::CCObject((__int64)a1);
*a1 = &off_15164B0;
a1[7] = 0;
a1[8] = 0;
a1[9] = 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
{
v3 = a2[1];
a1[7] = *a2;
a1[8] = v3;
result = a2[2];
a1[9] = result;
return result;
}
v5 = a2[1];
v6 = (const void *)a2[2];
if ( v5 <= 0x16 )
{
result = (unsigned int)(2 * v5);
*((_BYTE *)a1 + 56) = 2 * v5;
v10 = (char *)a1 + 57;
if ( !v5 )
{
*v10 = 0;
return result;
}
}
else
{
v7 = (v5 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v8 = v7 | 1;
v9 = operator new(v7);
a1[9] = v9;
a1[7] = v8;
v10 = (_BYTE *)v9;
a1[8] = v5;
}
result = (unsigned __int64)memcpy(v10, v6, v5);
*(_BYTE *)(result + v5) = 0;
return result;
}