//
// cocos2d::CCFileUtils::removeSearchPath from 0xd79b9c to 0xd79eb0 (788 bytes)
//
// 3 xrefs:
// > ??> @ 0x78838
// > ??> @ 0x152d950
// > ??> @ 0x152de10
//
// This function is hookable on this platform (idp: arm, 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 13:08:05 +0000
//
__int64 __fastcall cocos2d::CCFileUtils::removeSearchPath(cocos2d::CCFileUtils *this, char *a2)
{
size_t v3; // x0
char *v4; // x1
size_t v5; // x2
char *v6; // x1
unsigned __int64 v7; // x0
_QWORD *v8; // x19
_QWORD *v9; // x20
size_t v10; // x21
int v11; // w24
char *v12; // x25
unsigned __int8 *v13; // x0
unsigned __int8 *v14; // x1
int v15; // t1
_QWORD *v16; // x21
__int64 v17; // x1
__int64 v18; // x0
char *v19; // x1
_QWORD *v21; // x0
_QWORD *v22; // x24
__int64 v24[2]; // [xsp+70h] [xbp+70h] BYREF
void *v25; // [xsp+80h] [xbp+80h]
unsigned __int64 v26; // [xsp+88h] [xbp+88h] BYREF
unsigned __int64 v27; // [xsp+90h] [xbp+90h]
void *v28; // [xsp+98h] [xbp+98h]
unsigned __int64 v29[2]; // [xsp+A0h] [xbp+A0h] BYREF
char *v30; // [xsp+B0h] [xbp+B0h]
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
v26 = 0;
v27 = 0;
v28 = nullptr;
v3 = strlen(a2);
std::string::__init((__int64 *)&v26, a2, v3);
if ( !(*(unsigned __int8 (__fastcall **)(cocos2d::CCFileUtils *, unsigned __int64 *))(*(_QWORD *)this + 168LL))(
this,
&v26)
&& v24 != (__int64 *)((char *)this + 64) )
{
if ( (*((_BYTE *)this + 64) & 1) != 0 )
{
v4 = *((char **)this + 10);
v5 = *((_QWORD *)this + 9);
}
else
{
v4 = (char *)this + 65;
v5 = *((_BYTE *)this + 64) >> 1;
}
std::string::assign(v24, v4, v5);
}
std::operator+((__int64)v24, (__int64)&v26, v29);
if ( (v26 & 1) != 0 )
{
*(_BYTE *)v28 = 0;
v27 = 0;
}
else
{
LOWORD(v26) = 0;
}
std::string::reserve((__int64 *)&v26, 0);
v26 = v29[0];
v6 = v30;
v27 = v29[1];
v28 = v30;
if ( (v29[0] & 1) == 0 )
{
LODWORD(v7) = (int)LOBYTE(v29[0]) >> 1;
if ( !(_DWORD)v7 )
goto LABEL_10;
v7 = (int)v7;
v6 = (char *)&v26 + 1;
LABEL_38:
if ( v6[v7 - 1] != 47 )
std::string::append((__int64)&v26, (char *)&word_11BA098);
goto LABEL_10;
}
v7 = v27;
if ( v27 )
goto LABEL_38;
LABEL_10:
v8 = *((_QWORD **)this + 5);
v9 = *((_QWORD **)this + 6);
if ( v8 == v9 )
goto LABEL_26;
v10 = (unsigned __int8)v26 >> 1;
v11 = v26 & 1;
if ( (v26 & 1) != 0 )
v10 = v27;
v12 = (char *)v28;
while ( 1 )
{
while ( (*(_BYTE *)v8 & 1) != 0 )
{
if ( v8[1] != v10 )
goto LABEL_15;
if ( v11 )
v19 = v12;
else
v19 = (char *)&v26 + 1;
if ( !v10 || !memcmp((const void *)v8[2], v19, v10) )
goto LABEL_26;
v8 += 3;
if ( v9 == v8 )
{
LABEL_46:
v16 = v9 + 3;
LABEL_31:
while ( 1 )
{
if ( (*(_BYTE *)v8 & 1) != 0 )
{
*(_BYTE *)v8[2] = 0;
v8[1] = 0;
}
else
{
*((_BYTE *)v8 + 1) = 0;
*(_BYTE *)v8 = 0;
}
v22 = v16;
std::string::reserve(v8, 0);
v17 = v16[1];
*v8 = *v16;
v8[1] = v17;
v8[2] = v16[2];
v8[3] = 0;
v8[4] = 0;
v8[5] = 0;
if ( v9 == v8 + 6 )
break;
v8 = v16;
v16 += 3;
}
goto LABEL_33;
}
}
if ( *(_BYTE *)v8 >> 1 == v10 )
{
if ( v11 )
v13 = (unsigned __int8 *)v12;
else
v13 = (unsigned __int8 *)&v26 + 1;
if ( !v10 )
goto LABEL_26;
if ( *((unsigned __int8 *)v8 + 1) == *v13 )
break;
}
LABEL_15:
v8 += 3;
if ( v9 == v8 )
goto LABEL_46;
}
v14 = (unsigned __int8 *)v8 + 2;
while ( 1 )
{
++v13;
if ( v14 == (unsigned __int8 *)((char *)v8 + v10 + 1) )
break;
v15 = *v14++;
if ( *v13 != v15 )
goto LABEL_15;
}
LABEL_26:
v16 = v8 + 3;
if ( v9 != v8 + 3 )
goto LABEL_31;
v21 = v9;
v22 = v8;
while ( v21 != v22 )
{
v18 = (__int64)(v21 - 3);
*((_QWORD *)this + 6) = v18;
std::string::~string(v18);
LABEL_33:
v21 = *((_QWORD **)this + 6);
}
if ( (v26 & 1) != 0 )
operator delete(v28);
if ( (v24[0] & 1) != 0 )
operator delete(v25);
return _stack_chk_guard;
}