//
// cocos2d::CCFileUtils::addSearchResolutionsOrder from 0x18006da20 to 0x18006daf2 (210 bytes)
//
// 4 xrefs:
// > ??> @ 0x180100390
// > ??> @ 0x1801010b8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b4134
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCFileUtils::addSearchResolutionsOrder(cocos2d::CCFileUtils *this, const char *a2)
{
size_t v3; // r8
_OWORD *v4; // rdx
unsigned __int64 v5; // rdx
void *v6; // rcx
void *Block[2]; // [rsp+20h] [rbp-38h] BYREF
__int128 v8; // [rsp+30h] [rbp-28h]
*(_OWORD *)Block = 0;
v8 = 0;
v3 = -1;
do
++v3;
while ( a2[v3] );
sub_18000CE60(Block, a2, v3);
v4 = *((_OWORD **)this + 3);
if ( v4 == *((_OWORD **)this + 4) )
{
sub_18000D000((__int64 *)this + 2, (__int64)v4, (__int64)Block);
v5 = *((_QWORD *)&v8 + 1);
}
else
{
*v4 = *(_OWORD *)Block;
v4[1] = v8;
v5 = 15;
LOBYTE(Block[0]) = 0;
*((_QWORD *)this + 3) += 32LL;
}
if ( v5 > 0xF )
{
v6 = Block[0];
if ( v5 + 1 >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v6);
}
}