//
// cocos2d::CCFileUtils::getFullPathForDirectoryAndFilename from 0x10043db00 to 0x10043dc4c (332 bytes)
//
// 1 xrefs:
// > ??> @ 0x100938070
//
// 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::CCFileUtils::getFullPathForDirectoryAndFilename(
std::string *this,
__int64 a2,
unsigned __int8 *a3,
unsigned __int8 *a4,
double a5)
{
unsigned int v6; // edi
size_t v7; // r14
unsigned int v8; // eax
size_t v9; // r12
std::string::size_type v10; // r15
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v11; // r15
std::string::value_type *v12; // rax
size_t v13; // r13
std::string::size_type v14; // r13
std::string::value_type *data; // r13
const void *v16; // rdx
char *v17; // r13
const void *v18; // rsi
unsigned __int8 *v22; // [rsp+18h] [rbp-38h]
char v23; // [rsp+20h] [rbp-30h]
v6 = *a3;
if ( (v6 & 1) != 0 )
{
v7 = *((_QWORD *)a3 + 1);
v8 = *a4;
if ( (v8 & 1) == 0 )
{
LABEL_3:
v9 = v8 >> 1;
goto LABEL_6;
}
}
else
{
v7 = v6 >> 1;
v8 = *a4;
if ( (v8 & 1) == 0 )
goto LABEL_3;
}
v9 = *((_QWORD *)a4 + 1);
LABEL_6:
v10 = v9 + v7;
if ( v9 + v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a5);
v23 = v8;
if ( v10 > 0x16 )
{
v13 = 26;
if ( (v10 | 7) != 0x17 )
v13 = (v10 | 7) + 1;
v22 = a3;
v12 = (std::string::value_type *)operator new(v13);
a3 = v22;
v14 = v13 + 1;
this->__r_.__value_.__r.__words[0] = v14;
this->__r_.__value_.__r.__words[2] = (std::string::size_type)v12;
this->__r_.__value_.__l.__size_ = v10;
v11 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)v14;
}
else
{
*(_OWORD *)&this->__r_.__value_.__l.0 = 0;
this->__r_.__value_.__r.__words[2] = 0;
v11 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v10);
this->__r_.__value_.__s.0 = v11;
v12 = nullptr;
}
data = this->__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v11 & 1) != 0 )
data = v12;
if ( v7 )
{
if ( (v6 & 1) != 0 )
v16 = *((const void **)a3 + 2);
else
v16 = a3 + 1;
memmove(data, v16, v7);
}
v17 = &data[v7];
if ( v9 )
{
if ( (v23 & 1) != 0 )
v18 = *((const void **)a4 + 2);
else
v18 = a4 + 1;
memmove(v17, v18, v9);
}
v17[v9] = 0;
if ( !(*(unsigned __int8 (__fastcall **)(__int64, std::string *, unsigned __int8 *))(*(_QWORD *)a2 + 160LL))(
a2,
this,
a3) )
std::string::assign(this, "");
return this;
}