//
// cocos2d::CCFileUtils::setSearchPaths from 0xd7984c to 0xd79b9c (848 bytes)
//
// 3 xrefs:
// > ??> @ 0x6b128
// > ??> @ 0x152d940
// > ??> @ 0x152de00
//
// 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::setSearchPaths(__int64 *a1, __int64 *a2)
{
__int64 v4; // x19
__int64 i; // x0
__int64 v6; // x0
__int64 v7; // x21
_BOOL4 v8; // w24
__int64 *v9; // x25
__int64 v10; // x2
unsigned __int8 (__fastcall *v11)(__int64 *, __int64); // x2
const void *v12; // x1
size_t v13; // x2
char *v14; // x2
int v15; // w4
__int64 v16; // x0
unsigned __int8 v17; // w2
size_t v18; // x2
__int64 v19; // x1
unsigned __int64 v20; // x0
unsigned __int64 v21; // x0
_QWORD *v22; // x1
unsigned __int8 *v24; // x0
unsigned __int8 *v25; // x1
unsigned __int8 *v26; // x4
unsigned __int8 *v27; // x2
int v28; // t1
__int64 v29[2]; // [xsp+60h] [xbp+60h] BYREF
void *v30; // [xsp+70h] [xbp+70h]
unsigned __int64 v31; // [xsp+78h] [xbp+78h] BYREF
unsigned __int64 v32; // [xsp+80h] [xbp+80h]
unsigned __int8 *v33; // [xsp+88h] [xbp+88h]
unsigned __int64 v34[2]; // [xsp+90h] [xbp+90h] BYREF
char *v35; // [xsp+A0h] [xbp+A0h]
std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::clear(a1 + 11);
v4 = a1[5];
for ( i = a1[6]; v4 != i; i = a1[6] )
{
v6 = i - 24;
a1[6] = v6;
std::string::~string(v6);
}
v7 = *a2;
if ( *a2 == a2[1] )
{
LABEL_34:
v21 = a1[6];
v22 = a1 + 8;
if ( v21 == a1[7] )
{
std::vector::__push_back_slow_path(a1 + 5, v22);
}
else
{
if ( v21 )
{
std::string::basic_string(v21, v22);
v21 = a1[6];
}
a1[6] = v21 + 24;
}
return _stack_chk_guard;
}
v8 = 0;
v9 = a1 + 8;
do
{
v10 = *a1;
v29[0] = 0;
v29[1] = 0;
v11 = *(unsigned __int8 (__fastcall **)(__int64 *, __int64))(v10 + 168);
v30 = nullptr;
v31 = 0;
v32 = 0;
v33 = nullptr;
if ( !v11(a1, v7) && v29 != v9 )
{
if ( (*(_BYTE *)v9 & 1) != 0 )
{
v12 = (const void *)a1[10];
v13 = a1[9];
}
else
{
v12 = (char *)a1 + 65;
v13 = *(_BYTE *)v9 >> 1;
}
std::string::assign(v29, v12, v13);
}
std::operator+((__int64)v29, v7, v34);
if ( (v31 & 1) != 0 )
{
*v33 = 0;
v32 = 0;
}
else
{
LOWORD(v31) = 0;
}
std::string::reserve((__int64 *)&v31, 0);
v14 = v35;
v32 = v34[1];
v31 = v34[0];
v15 = v34[0] & 1;
v33 = (unsigned __int8 *)v35;
if ( !v15 )
{
if ( !((int)LOBYTE(v34[0]) >> 1) )
{
if ( v8 )
goto LABEL_24;
v17 = v34[0];
v15 = 0;
goto LABEL_44;
}
v14 = (char *)&v31 + 1;
v16 = ((int)LOBYTE(v34[0]) >> 1) - 1LL;
LABEL_15:
if ( v14[v16] != 47 )
std::string::append((__int64)&v31, (char *)&word_11BA098);
if ( v8 )
goto LABEL_24;
v17 = v31;
v15 = v31 & 1;
if ( (v31 & 1) != 0 )
{
v15 = 1;
LABEL_20:
v18 = v32;
LABEL_21:
v19 = *(_BYTE *)v9 >> 1;
if ( (*(_BYTE *)v9 & 1) != 0 )
v19 = a1[9];
v8 = 0;
if ( v18 == v19 )
{
v24 = (unsigned __int8 *)&v31 + 1;
if ( v15 )
v24 = v33;
v25 = (unsigned __int8 *)a1 + 65;
if ( (*(_BYTE *)v9 & 1) != 0 )
v25 = (unsigned __int8 *)a1[10];
if ( !v15 )
{
if ( v18 )
{
if ( *v24 != *v25 )
{
LABEL_62:
v8 = 0;
goto LABEL_24;
}
v26 = v24 + 1;
v27 = &v24[v18];
while ( 1 )
{
++v25;
if ( v26 == v27 )
break;
v28 = *v26++;
if ( *v25 != v28 )
goto LABEL_62;
}
}
v8 = 1;
goto LABEL_24;
}
v8 = 1;
if ( v18 )
v8 = memcmp(v24, v25, v18) == 0;
}
LABEL_24:
v20 = a1[6];
if ( v20 == a1[7] )
goto LABEL_47;
goto LABEL_25;
}
LABEL_44:
v18 = v17 >> 1;
goto LABEL_21;
}
if ( v32 )
{
v16 = v32 - 1;
goto LABEL_15;
}
if ( !v8 )
goto LABEL_20;
v20 = a1[6];
if ( v20 == a1[7] )
{
LABEL_47:
std::vector::__push_back_slow_path(a1 + 5, &v31);
goto LABEL_28;
}
LABEL_25:
if ( v20 )
{
std::string::basic_string(v20, &v31);
v20 = a1[6];
}
a1[6] = v20 + 24;
LABEL_28:
if ( (v31 & 1) != 0 )
operator delete(v33);
if ( (v29[0] & 1) != 0 )
operator delete(v30);
v7 += 24;
}
while ( a2[1] != v7 );
if ( !v8 )
goto LABEL_34;
return _stack_chk_guard;
}