//
// sub_100004478 from 0x100004478 to 0x1000045a0 (296 bytes)
//
// 1 xrefs:
// > EditorUI::addObjectsToSmartTemplate @ 0x100478b48
//
// This function is hookable on this platform (idp: arm, 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 10:57:09 +0000
//
void __fastcall sub_100004478(std::string *a1, __int64 a2, const std::string *a3)
{
__int64 v6; // x22
__int64 v7; // x23
__int64 v8; // x0
__int64 v9; // x23
void *__p[2]; // [xsp+0h] [xbp-50h] BYREF
__int64 v11; // [xsp+10h] [xbp-40h]
std::string::assign(a1 + 7, "");
v6 = cocos2d::CCDictionary::objectForKey(a1[2].__r_.__value_.__l.__size_, a2);
if ( !v6 )
{
v6 = sub_1002E736C();
cocos2d::CCDictionary::setObject(a1[2].__r_.__value_.__l.__size_, v6, a2);
}
if ( (unsigned int)sub_1002E757C(v6) )
{
v7 = 0;
while ( 1 )
{
v8 = sub_1002E75A0(v6, v7);
if ( (sub_1000045BC(v8 + 80, a3) & 1) != 0 )
break;
v7 = (unsigned int)(v7 + 1);
if ( (unsigned int)v7 >= (unsigned int)sub_1002E757C(v6) )
goto LABEL_7;
}
}
else
{
LABEL_7:
v9 = GJSmartPrefab::create();
std::string::operator=((std::string *)(v9 + 80), a3);
std::string::operator=((std::string *)(v9 + 56), (const std::string *)a2);
sub_1002E74E0(v6, v9);
if ( *(char *)(a2 + 23) < 0 )
{
sub_1000097D0(__p, *(void **)a2);
}
else
{
*(_OWORD *)__p = *(_OWORD *)a2;
v11 = *(_QWORD *)(a2 + 16);
}
sub_100004698(a1, __p);
if ( SHIBYTE(v11) < 0 )
operator delete(__p[0]);
}
}