//
// sub_1004BCF00 from 0x1004bcf00 to 0x1004bd07a (378 bytes)
//
// 1 xrefs:
// > sub_1004F5360 @ 0x1004f5369
//
// 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:31:03 +0000
//
std::string *__fastcall sub_1004BCF00(std::string *a1)
{
NSArray *v1; // rax
id v2; // rax
id v3; // r14
NSFileManager *v4; // rax
NSFileManager *v5; // rax
const char *v6; // r15
size_t v7; // rax
std::string::size_type v8; // r14
char *data; // r12
size_t v10; // r13
std::string *v11; // rax
std::string __dst[2]; // [rsp+0h] [rbp-40h] BYREF
v1 = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, 1u, 1);
v2 = -[NSArray objectAtIndex:](v1, "objectAtIndex:", 0);
v3 = objc_msgSend(v2, "stringByAppendingPathComponent:", CFSTR("GeometryDash"));
v4 = +[NSFileManager defaultManager](&OBJC_CLASS___NSFileManager, "defaultManager");
if ( !-[NSFileManager fileExistsAtPath:](v4, "fileExistsAtPath:", v3) )
{
v5 = +[NSFileManager defaultManager](&OBJC_CLASS___NSFileManager, "defaultManager");
-[NSFileManager createDirectoryAtPath:withIntermediateDirectories:attributes:error:](
v5,
"createDirectoryAtPath:withIntermediateDirectories:attributes:error:",
v3,
0,
0,
0);
}
v6 = (const char *)objc_msgSend(v3, "UTF8String");
v7 = strlen(v6);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v8 = v7;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
data = (char *)operator new(v10);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v10 + 1;
__dst[0].__r_.__value_.__l.__size_ = v8;
goto LABEL_10;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v7 )
LABEL_10:
memmove(data, v6, v8);
data[v8] = 0;
v11 = std::string::append(__dst, "/");
*a1 = *v11;
*(_OWORD *)&v11->__r_.__value_.__l.0 = 0;
v11->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
return a1;
}