//
// cocos2d::CCFileUtils::setSearchResolutionsOrder from 0x100151aec to 0x100151c54 (360 bytes)
//
// 2 xrefs:
// > ??> @ 0x10079a430
// > ??> @ 0x1007c7d00
//
// 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::setSearchResolutionsOrder(
cocos2d::CCFileUtils *a1,
std::vector *const a2)
{
cocos2d::CCFileUtils *v3; // x21
const void **v4; // x19
std::__vector_base::pointer begin; // x22
char v6; // w24
__int128 v7; // q0
std::string::size_type size; // x8
int v9; // w9
std::string *p_p; // x9
std::string __p; // [xsp+0h] [xbp-50h] BYREF
v3 = a1 + 12;
sub_100017F2C((__int64)&a1[11], &a1[12].getClassTypeInfo);
v3->__vftable = nullptr;
v3[1].__vftable = nullptr;
v4 = (const void **)&v3[-10].__vftable;
v3[-1].__vftable = (cocos2d::CCFileUtils_vtbl *)v3;
sub_10001783C((void ***)&v3[-10]);
begin = a2->__begin_;
if ( a2->__begin_ == a2->__end_ )
{
LABEL_25:
sub_100009900(&__p, "");
sub_100065180(v4, (__int128 *)&__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
return;
}
v6 = 0;
do
{
if ( begin->m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(&__p, (void *)begin->m_data.m_long.capacitym1, begin->m_data.m_long.size);
}
else
{
v7 = *(_OWORD *)&begin->m_data.m_short.sizex2;
__p.__r_.__value_.__r.__words[2] = (std::string::size_type)begin->m_data.m_long.longStorage;
*(_OWORD *)&__p.__r_.__value_.__l.__data_ = v7;
}
size = HIBYTE(__p.__r_.__value_.__r.__words[2]);
if ( (v6 & 1) != 0 )
{
if ( (*((_BYTE *)&__p.__r_.__value_.__s + 23) & 0x80) != 0 )
{
size = __p.__r_.__value_.__l.__size_;
v9 = 1;
v6 = 1;
if ( !__p.__r_.__value_.__l.__size_ )
goto LABEL_21;
goto LABEL_15;
}
}
else if ( (*((_BYTE *)&__p.__r_.__value_.__s + 23) & 0x80) != 0 )
{
size = __p.__r_.__value_.__l.__size_;
v9 = 1;
if ( !__p.__r_.__value_.__l.__size_ )
{
LABEL_20:
v6 = 1;
goto LABEL_21;
}
v6 = 0;
goto LABEL_15;
}
if ( !*((_BYTE *)&__p.__r_.__value_.__s + 23) )
goto LABEL_20;
v9 = 0;
LABEL_15:
if ( v9 )
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
else
p_p = &__p;
if ( p_p->__r_.__value_.__s.__data_[size - 1] != 47 )
std::string::append(&__p, "/");
LABEL_21:
sub_100017238((__int64)v4);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
++begin;
}
while ( begin != a2->__end_ );
if ( (v6 & 1) == 0 )
goto LABEL_25;
}