//
// cocos2d::CCFileUtils::setSearchPaths from 0x100151ce8 to 0x100151ec8 (480 bytes)
//
// 2 xrefs:
// > ??> @ 0x10079a448
// > ??> @ 0x1007c7d18
//
// 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
//
void __fastcall cocos2d::CCFileUtils::setSearchPaths(cocos2d::CCFileUtils *a1, std::vector *const a2)
{
cocos2d::CCFileUtils *v4; // x22
__int64 v5; // x21
std::string *begin; // x22
bool v7; // w26
std::string::size_type size; // x9
std::string *p_p; // x8
size_t v10; // x2
cocos2d::CCFileUtils_vtbl *v11; // x10
int v12; // w9
std::string *v13; // x0
cocos2d::CCFileUtils_vtbl *v14; // x1
std::string v15; // [xsp+8h] [xbp-88h] BYREF
std::string __p; // [xsp+20h] [xbp-70h] BYREF
std::string v17; // [xsp+38h] [xbp-58h] BYREF
v4 = a1 + 12;
sub_100017F2C((__int64)&a1[11], &a1[12].getClassTypeInfo);
v4->__vftable = nullptr;
v4[1].__vftable = nullptr;
v5 = (__int64)&v4[-7];
v4[-1].__vftable = (cocos2d::CCFileUtils_vtbl *)v4;
sub_10001783C((void ***)&v4[-7]);
begin = a2->__begin_;
if ( a2->__begin_ == a2->__end_ )
{
LABEL_38:
sub_100017238(v5);
return;
}
v7 = 0;
do
{
memset(&v17, 0, sizeof(v17));
memset(&__p, 0, sizeof(__p));
if ( (((__int64 (__fastcall *)(cocos2d::CCFileUtils *, std::string *))a1->loadFilenameLookupDictionaryFromFile)(
a1,
begin)
& 1) == 0 )
std::string::operator=(&v17, (const std::string *)&a1[8]);
sub_100151EF8(&v15, &v17, begin);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
__p = v15;
if ( (SHIBYTE(v15.__r_.__value_.__r.__words[2]) & 0x8000000000000000LL) != 0 )
{
size = __p.__r_.__value_.__l.__size_;
if ( !__p.__r_.__value_.__l.__size_ )
goto LABEL_16;
}
else
{
if ( !*((_BYTE *)&v15.__r_.__value_.__s + 23) )
goto LABEL_16;
size = SHIBYTE(v15.__r_.__value_.__r.__words[2]);
}
if ( (v15.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( p_p->__r_.__value_.__s.__data_[size - 1] != 47 )
std::string::append(&__p, "/");
LABEL_16:
if ( v7 )
{
v7 = 1;
}
else
{
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v10 = HIBYTE(__p.__r_.__value_.__r.__words[2]);
else
v10 = __p.__r_.__value_.__l.__size_;
v11 = (cocos2d::CCFileUtils_vtbl *)HIBYTE(a1[10].__vftable);
v12 = (char)v11;
if ( (char)v11 < 0 )
v11 = a1[9].__vftable;
if ( (cocos2d::CCFileUtils_vtbl *)v10 == v11 )
{
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v13 = &__p;
else
v13 = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( v12 >= 0 )
v14 = (cocos2d::CCFileUtils_vtbl *)&a1[8];
else
v14 = a1[8].__vftable;
v7 = memcmp(v13, v14, v10) == 0;
}
else
{
v7 = 0;
}
}
sub_100017238(v5);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( SHIBYTE(v17.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v17.__r_.__value_.__l.__data_);
++begin;
}
while ( begin != a2->__end_ );
if ( !v7 )
goto LABEL_38;
}