//
// CCSpritePart::createWithSpriteFrameName from 0x10035d910 to 0x10035da64 (340 bytes)
//
// 1 xrefs:
// > CCPartAnimSprite::initWithAnimDesc @ 0x10035d492
//
// 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:28:55 +0000
//
char *__fastcall CCSpritePart::createWithSpriteFrameName(char *__s)
{
char *v1; // r15
char *v2; // r14
char *v3; // rbx
size_t v4; // rax
std::string::size_type v5; // r12
std::string *v6; // r14
char *data; // r13
size_t v8; // r15
std::string __dst[2]; // [rsp+10h] [rbp-40h] BYREF
v1 = __s;
v2 = (char *)operator new(0x290u);
v3 = v2;
cocos2d::CCSprite::CCSprite((__int64)v2);
*(_OWORD *)(v2 + 600) = 0;
*(_DWORD *)(v2 + 615) = 0;
*(_QWORD *)v2 = off_100B25F48;
*((_QWORD *)v2 + 40) = off_100B26440;
*((_QWORD *)v2 + 43) = off_100B264C0;
v2[619] = 0;
*((_OWORD *)v2 + 39) = 0;
*((_OWORD *)v2 + 40) = 0;
if ( !(unsigned __int8)CCSpritePlus::initWithSpriteFrameName(v2, __s) )
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v2 + 16LL))(v2);
return nullptr;
}
v4 = strlen(__s);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
v6 = (std::string *)(v2 + 624);
if ( v4 >= 0x17 )
{
v8 = 26;
if ( (v4 | 7) != 0x17 )
v8 = (v4 | 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;
v1 = __s;
__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 )
goto LABEL_11;
}
memcpy(data, v1, v5);
LABEL_11:
data[v5] = 0;
std::string::operator=(v6, __dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
cocos2d::CCObject::autorelease(v3);
return v3;
}