//
// cocos2d::CCFileUtilsMac::getWritablePath from 0x1006e5140 to 0x1006e5222 (226 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b93f88
//
// 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:35:46 +0000
//
std::string *__fastcall cocos2d::CCFileUtilsMac::getWritablePath(std::string *this)
{
NSArray *v1; // rax
id v2; // rax
const char *v3; // r15
size_t v4; // rax
std::string::size_type v5; // r14
char *data; // r12
size_t v7; // r13
v1 = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, 1u, 1);
v2 = -[NSArray objectAtIndex:](v1, "objectAtIndex:", 0);
v3 = (const char *)objc_msgSend(v2, "UTF8String");
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);
this->__r_.__value_.__r.__words[2] = (std::string::size_type)data;
this->__r_.__value_.__r.__words[0] = v7 + 1;
this->__r_.__value_.__l.__size_ = v5;
}
else
{
this->__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v4);
data = this->__r_.__value_.__s.__data_;
if ( !v4 )
goto LABEL_9;
}
memmove(data, v3, v5);
LABEL_9:
data[v5] = 0;
std::string::append(this, "/");
return this;
}