//
// sub_10040E9B0 from 0x10040e9b0 to 0x10040ea69 (185 bytes)
//
// 4 xrefs:
// > sub_10040E9B0 @ 0x10040ea07
// > GJSmartTemplate::generateRemapDict @ 0x100413b9c
// > GJSmartTemplate::logTemplateStatus @ 0x100414031
// > GJSmartTemplate::getTemplateState @ 0x10041464e
//
// 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 12:30:08 +0000
//
void __fastcall sub_10040E9B0(unsigned int a1, __int64 a2, int a3, __int64 a4, __int64 a5)
{
_DWORD *v5; // rbx
unsigned int v6; // r13d
int v7; // eax
size_t v8[3]; // [rsp+0h] [rbp-50h] BYREF
__int64 v9; // [rsp+18h] [rbp-38h]
__int64 v10; // [rsp+20h] [rbp-30h]
v9 = a5;
v10 = a4;
if ( a3 != a1 )
{
v5 = (_DWORD *)(a2 + 4LL * a3);
v6 = a3 + 1;
do
{
*v5 = 0;
sub_10040E9B0(a1, a2, v6, v10, v9);
*v5++ = 1;
v7 = v6 - a1 + 1;
++v6;
}
while ( v7 != 1 );
}
sub_10040E790(v8, a2, a1);
cocos2d::CCDictionary::setObject(v10, v9, (char *)v8);
if ( (v8[0] & 1) != 0 )
operator delete((void *)v8[2]);
}