//
// cocos2d::CCFileUtils::getNewFilename from 0x180072290 to 0x1800723e1 (337 bytes)
//
// 4 xrefs:
// > ??> @ 0x180106a48
// > ??> @ 0x1801077f8
// > ??> @ 0x18014cf68
// > ??> @ 0x1801be5b4
//
// This function is hookable on this platform (idp: pc, 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 11:21:57 +0000
//
// Hidden C++ exception states: #wind=1
_QWORD *__fastcall cocos2d::CCFileUtils::getNewFilename(__int64 a1, _QWORD *a2, const char *a3)
{
const char *CString; // rsi
char v6; // bp
size_t v7; // rax
cocos2d::CCString *v8; // rdi
void *v9; // rcx
size_t v10; // rax
void *Block[2]; // [rsp+40h] [rbp-48h] BYREF
__m128i si128; // [rsp+50h] [rbp-38h]
CString = a3;
v6 = 0;
if ( *(_QWORD *)(a1 + 8) )
{
*(_OWORD *)Block = 0;
si128 = 0;
v7 = strlen(a3);
sub_18000CEF0(Block, CString, v7);
v6 = 1;
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 8), (__int64)Block);
}
else
{
v8 = nullptr;
}
if ( (v6 & 1) != 0 )
{
if ( si128.m128i_i64[1] > 0xFuLL )
{
v9 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v9);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);
LOBYTE(Block[0]) = 0;
}
if ( v8 && (unsigned int)cocos2d::CCString::length(v8) )
CString = cocos2d::CCString::getCString(v8);
*(_OWORD *)a2 = 0;
a2[2] = 0;
a2[3] = 0;
v10 = strlen(CString);
sub_18000CEF0(a2, CString, v10);
return a2;
}