//
// sub_1800101E0 from 0x1800101e0 to 0x180010355 (373 bytes)
//
// 74 xrefs:
// > cocos2d::CCString::operator= @ 0x1800100f7
// > cocos2d::CCString::initWithFormatAndValist @ 0x18001080e
// > DS_Dictionary::loadRootSubDictFromCompressedFile @ 0x18001b9f8
// > DS_Dictionary::saveRootSubDictToCompressedFile @ 0x18001d5a1
// > DS_Dictionary::saveRootSubDictToFile @ 0x18001dd8a
// > DS_Dictionary::setRectArrayForKey @ 0x18001fa77
// > DS_Dictionary::setVec2ArrayForKey @ 0x180020990
// > sub_180021920 @ 0x1800219ef
// > cocos2d::CCActionTween::initWithDuration @ 0x18003d7f3
// > cocos2d::CCLabelAtlas::setString @ 0x180047f49
// > cocos2d::CCLabelBMFont::initWithString @ 0x18004a060
// > cocos2d::CCBMFontConfiguration::parseImageFileName @ 0x18004cf1f
// > cocos2d::CCLabelBMFont::setFntFile @ 0x18004e1ab
// > cocos2d::CCLabelBMFont::setString @ 0x18004e55e
// > cocos2d::CCLabelTTF::_prepareTextDefinition @ 0x18004f79c
// > cocos2d::CCLabelTTF::getTextDefinition @ 0x18004ffb7
// > cocos2d::CCLabelTTF::setString @ 0x180050604
// > cocos2d::CCMenuItemFont::initWithString @ 0x18005d1c3
// > cocos2d::CCMenuItemFont::setFontName @ 0x18005d919
// > cocos2d::CCMenuItemFont::setFontNameObj @ 0x18005d955
// > cocos2d::CCFileUtils::addSearchPath @ 0x18006f936
// > cocos2d::CCFileUtils::getFullPathForDirectoryAndFilename @ 0x180072276
// > cocos2d::CCFileUtils::removeSearchPath @ 0x1800730f7
// > cocos2d::CCFileUtils::setSearchPaths @ 0x1800735c9
// > sub_180074280 @ 0x180074500
// > sub_18007C950 @ 0x18007ca99
// > sub_18007C950 @ 0x18007cb0b
// > cocos2d::CCFileUtils::operator= @ 0x18007d001
// > cocos2d::CCFileUtils::operator= @ 0x18007d07a
// > cocos2d::CCFileUtilsWin32::init @ 0x18007ddd9
// > cocos2d::CCFileUtilsWin32::utf8Togbk @ 0x18007e465
// > sub_180080A90 @ 0x180080d77
// > sub_180080A90 @ 0x18008118f
// > cocos2d::CCSpriteFrame::initWithTextureFilename @ 0x1800931e6
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x180094a79
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x180094af5
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x180094c14
// > cocos2d::CCProfiler::createAndAddTimerWithName @ 0x180097ede
// > cocos2d::CCComponent::setName @ 0x180099b1c
// > cocos2d::CCTMXLayer::initWithTilesetInfo @ 0x1800afa11
// > cocos2d::CCTextFieldTTF::setString @ 0x1800b9c5d
// > cocos2d::CCTextFieldTTF::setString @ 0x1800b9d75
// > cocos2d::CCActionTween::operator= @ 0x1800cfe05
// > cocos2d::CCApplication::operator= @ 0x1800d00ae
// > cocos2d::CCApplication::operator= @ 0x1800d00d1
// > cocos2d::CCBMFontConfiguration::operator= @ 0x1800d034c
// > cocos2d::CCComponent::operator= @ 0x1800d091e
// > cocos2d::CCLabelAtlas::operator= @ 0x1800d1bc9
// > cocos2d::CCLabelBMFont::operator= @ 0x1800d1c7b
// > cocos2d::CCLabelBMFont::operator= @ 0x1800d1cb2
// > cocos2d::CCLabelTTF::operator= @ 0x1800d1e4e
// > cocos2d::CCMenuItemFont::operator= @ 0x1800d2355
// > cocos2d::CCParticleSystem::operator= @ 0x1800d2983
// > cocos2d::CCPrettyPrinter::operator= @ 0x1800d2f84
// > cocos2d::CCPrettyPrinter::operator= @ 0x1800d2fa7
// > cocos2d::CCSpriteFrame::operator= @ 0x1800d3c3f
// > cocos2d::CCSpriteFrame::operator= @ 0x1800d3c68
// > cocos2d::CCTMXLayer::operator= @ 0x1800d3e29
// > cocos2d::CCTMXLayerInfo::operator= @ 0x1800d3f2e
// > cocos2d::CCTMXMapInfo::operator= @ 0x1800d406b
// > cocos2d::CCTMXMapInfo::operator= @ 0x1800d4094
// > cocos2d::CCTMXMapInfo::operator= @ 0x1800d40bd
// > cocos2d::CCTMXObjectGroup::operator= @ 0x1800d4183
// > cocos2d::CCTMXTilesetInfo::operator= @ 0x1800d4296
// > cocos2d::CCTMXTilesetInfo::operator= @ 0x1800d42d8
// > cocos2d::CCFileUtils::setAndroidPath @ 0x1800d6654
// > cocos2d::CCBMFontConfiguration::setAtlasName @ 0x1800d66ac
// > cocos2d::CCSpriteFrame::setFrameName @ 0x1800d6847
// > cocos2d::CCTMXLayer::setLayerName @ 0x1800d694f
// > cocos2d::CCTMXMapInfo::setTMXFileName @ 0x1800d6baf
// > ??> @ 0x18013b214
// > ??> @ 0x18013b224
// > ??> @ 0x18013b238
// > ??> @ 0x1801b814c
//
// 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:22 +0000
//
void **__fastcall sub_1800101E0(void **a1, void *Src, size_t Size)
{
unsigned __int64 v3; // r15
void *v7; // rdi
size_t v8; // rdi
unsigned __int64 v9; // rdx
size_t v10; // rcx
_QWORD *v11; // r14
size_t v12; // rax
__int64 v13; // rax
void *v14; // rcx
v3 = (unsigned __int64)a1[3];
if ( Size > v3 )
{
v8 = 0x7FFFFFFFFFFFFFFFLL;
if ( Size > 0x7FFFFFFFFFFFFFFFLL )
std::vector::_Xlen();
if ( (Size | 0xF) > 0x7FFFFFFFFFFFFFFFLL || (v9 = v3 >> 1, v3 > 0x7FFFFFFFFFFFFFFFLL - (v3 >> 1)) )
{
v12 = 0x8000000000000027uLL;
}
else
{
v8 = Size | 0xF;
if ( (Size | 0xF) < v3 + v9 )
v8 = v3 + v9;
v10 = v8 + 1;
if ( v8 == -1 )
{
v11 = nullptr;
goto LABEL_19;
}
if ( v10 < 0x1000 )
{
v11 = (_QWORD *)sub_1800E4AC0(v10);
goto LABEL_19;
}
v12 = v8 + 40;
if ( v8 + 40 < v8 + 1 )
Concurrency::cancel_current_task();
}
v13 = sub_1800E4AC0(v12);
if ( !v13 )
goto LABEL_26;
v11 = (_QWORD *)((v13 + 39) & 0xFFFFFFFFFFFFFFE0uLL);
*(v11 - 1) = v13;
LABEL_19:
a1[2] = (void *)Size;
a1[3] = (void *)v8;
memcpy(v11, Src, Size);
*((_BYTE *)v11 + Size) = 0;
if ( v3 <= 0xF )
{
LABEL_24:
*a1 = v11;
return a1;
}
v14 = *a1;
if ( v3 + 1 < 0x1000 )
{
LABEL_23:
j_j_free_0(v14);
goto LABEL_24;
}
if ( (unsigned __int64)v14 - *((_QWORD *)v14 - 1) - 8 <= 0x1F )
{
v14 = *((void **)v14 - 1);
goto LABEL_23;
}
LABEL_26:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
v7 = a1;
if ( v3 > 0xF )
v7 = *a1;
a1[2] = (void *)Size;
memmove(v7, Src, Size);
*((_BYTE *)v7 + Size) = 0;
return a1;
}