//
// cocos2d::CCFileUtilsMac::getWritablePath from 0x10060b960 to 0x10060ba42 (226 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009805b8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
std::string *__fastcall cocos2d::CCFileUtilsMac::getWritablePath(std::string *this, double a2)
{
NSArray *v2; // rax
id v3; // rax
const char *v4; // r15
size_t v5; // rax
std::string::size_type v6; // r14
char *data; // r12
size_t v8; // r13
v2 = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, 1u, 1);
v3 = -[NSArray objectAtIndex:](v2, "objectAtIndex:", 0);
v4 = (const char *)objc_msgSend(v3, "UTF8String");
v5 = strlen(v4);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a2);
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = 26;
if ( (v5 | 7) != 0x17 )
v8 = (v5 | 7) + 1;
data = (char *)operator new(v8);
this->__r_.__value_.__r.__words[2] = (std::string::size_type)data;
this->__r_.__value_.__r.__words[0] = v8 + 1;
this->__r_.__value_.__l.__size_ = v6;
}
else
{
this->__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v5);
data = this->__r_.__value_.__s.__data_;
if ( !v5 )
goto LABEL_9;
}
memmove(data, v4, v6);
LABEL_9:
data[v6] = 0;
std::string::append(this, "/");
return this;
}