//
// cocos2d::CCFileUtils::fullPathFromRelativeFile from 0xb05014 to 0xb05278 (612 bytes)
//
// 3 xrefs:
// > ??> @ 0x314e8
// > ??> @ 0x1217ae0
// > ??> @ 0x1217fa0
//
// 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
//
const char *cocos2d::CCFileUtils::fullPathFromRelativeFile(cocos2d::CCFileUtils *a1, const char *a2, const char *a3)
{
cocos2d::CCString *v5; // x23
void *v6; // x0
__int64 v7; // x0
void *v8; // x0
void *v9; // x0
const char *CString; // x22
void *v11; // x0
unsigned int *v13; // x1
int v14; // w2
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
__int64 v21; // [xsp+68h] [xbp+68h] BYREF
__int64 v22; // [xsp+70h] [xbp+70h] BYREF
sub_D153B8((int)&v21, (char *)a3);
sub_D153B8((int)&v22, &byte_F288A0);
v5 = (cocos2d::CCString *)cocos2d::CCString::create();
v6 = (void *)(v22 - 24);
if ( (__int64 *)(v22 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v22 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *(_DWORD *)(v22 - 8);
*(_DWORD *)(v22 - 8) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v6);
}
v7 = sub_D16898(&v21, 47, -1);
sub_D14F84(&v22, &v21, 0, v7 + 1);
sub_D163D4(&v5->m_sString, &v22);
v8 = (void *)(v22 - 24);
if ( (__int64 *)(v22 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v22 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v22 - 8);
*(_DWORD *)(v22 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v8);
}
((void (__fastcall *)(__int64 *__return_ptr, cocos2d::CCFileUtils *, const char *))a1->setFilenameLookupDictionary)(
&v22,
a1,
a2);
sub_D15E14(&v5->m_sString, &v22);
v9 = (void *)(v22 - 24);
if ( (__int64 *)(v22 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v22 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *(_DWORD *)(v22 - 8);
*(_DWORD *)(v22 - 8) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v9);
}
CString = cocos2d::CCString::getCString(v5);
v11 = (void *)(v21 - 24);
if ( (__int64 *)(v21 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v21 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(v21 - 8);
*(_DWORD *)(v21 - 8) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v11);
}
return CString;
}