//
// GJSmartTemplate::generateRemapDict from 0x100413b50 to 0x100413f44 (1012 bytes)
//
// 0 xrefs:
//
// 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:10 +0000
//
_QWORD *GJSmartTemplate::generateRemapDict()
{
_QWORD *v0; // rbx
void *v1; // rax
__int64 v2; // r15
__int64 v3; // rsi
__int64 v4; // rax
const char *CString; // r13
size_t v6; // rax
std::string::size_type v7; // rbx
char *data; // r14
__int64 v9; // rax
size_t v10; // r12
std::string::value_type v11; // r13
std::string::value_type v12; // r15
std::string::value_type v13; // bl
std::string::value_type v14; // r14
int v15; // esi
std::string::reference v16; // rax
char v17; // cl
char v18; // r12
unsigned __int8 v19; // bl
unsigned __int8 v20; // r15
unsigned __int8 v21; // r14
const std::string::value_type *v22; // rsi
std::string::size_type v23; // rdx
__int64 v24; // rax
unsigned int v25; // eax
size_t v27[3]; // [rsp+18h] [rbp-D8h] BYREF
__int64 v28; // [rsp+30h] [rbp-C0h]
__int64 v29; // [rsp+38h] [rbp-B8h]
_QWORD *v30; // [rsp+40h] [rbp-B0h]
std::string v31; // [rsp+48h] [rbp-A8h] BYREF
std::string::value_type __s[16]; // [rsp+60h] [rbp-90h] BYREF
void *__p; // [rsp+70h] [rbp-80h]
std::string __dst; // [rsp+80h] [rbp-70h] BYREF
int v35; // [rsp+98h] [rbp-58h]
std::string::value_type v36; // [rsp+9Eh] [rbp-52h]
std::string::value_type v37; // [rsp+9Fh] [rbp-51h]
_BYTE v38[32]; // [rsp+A0h] [rbp-50h] BYREF
v30 = cocos2d::CCDictionary::create();
v0 = cocos2d::CCDictionary::create();
v1 = cocos2d::CCNode::create();
sub_10040E9B0(8u, (__int64)v38, 0, (__int64)v0, (__int64)v1);
v2 = cocos2d::CCDictionary::allKeys((__int64)v0);
if ( (unsigned int)sub_1007FEF90(v2) )
{
v3 = 0;
v29 = v2;
while ( 1 )
{
v28 = v3;
v4 = cocos2d::CCArray::stringAtIndex(v2, v3);
CString = (const char *)cocos2d::CCString::getCString(v4);
v6 = strlen(CString);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v7 = v6;
if ( v6 >= 0x17 )
break;
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v6);
data = __dst.__r_.__value_.__s.__data_;
if ( v6 )
goto LABEL_10;
LABEL_11:
data[v7] = 0;
v11 = *std::string::at(&__dst, 0);
LOBYTE(v35) = *std::string::at(&__dst, 1u);
v36 = *std::string::at(&__dst, 2u);
v37 = *std::string::at(&__dst, 3u);
v12 = *std::string::at(&__dst, 4u);
v13 = *std::string::at(&__dst, 5u);
v14 = *std::string::at(&__dst, 6u);
v15 = 7;
v16 = std::string::at(&__dst, 7u);
if ( v12 == 48 )
{
v15 = 0;
v17 = 0;
v18 = v35;
if ( v13 != 48 )
goto LABEL_13;
}
else
{
LOBYTE(v15) = v36 != 48 && v11 != 48;
v17 = !(_BYTE)v15;
v18 = v35;
if ( v13 != 48 )
{
LABEL_13:
v19 = v37 != 48 && v11 != 48;
v17 |= !v19;
if ( v14 != 48 )
goto LABEL_14;
goto LABEL_20;
}
}
v19 = 0;
if ( v14 != 48 )
{
LABEL_14:
v20 = v36 != 48 && v18 != 48;
v17 |= !v20;
if ( *v16 != 48 )
goto LABEL_15;
goto LABEL_21;
}
LABEL_20:
v20 = 0;
if ( *v16 != 48 )
{
LABEL_15:
v21 = v37 != 48 && v18 != 48;
if ( v17 & 1 | (v21 == 0) )
{
v35 = v15;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_23;
goto LABEL_17;
}
goto LABEL_33;
}
LABEL_21:
if ( (v17 & 1) != 0 )
{
v21 = 0;
v35 = v15;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
{
LABEL_23:
sub_10001AD30(__s, __dst.__r_.__value_.__l.__data_, __dst.__r_.__value_.__l.__size_);
goto LABEL_24;
}
LABEL_17:
__p = __dst.__r_.__value_.__l.__data_;
*(_OWORD *)__s = *(_OWORD *)&__dst.__r_.__value_.__l.0;
LABEL_24:
*(_WORD *)&v31.__r_.__value_.__l.0 = 12546;
v31.__r_.__value_.__s.__data_[1] = 0;
if ( (__s[0] & 1) != 0 )
{
v22 = (const std::string::value_type *)__p;
v23 = *(_QWORD *)&__s[8];
}
else
{
v23 = (unsigned __int8)__s[0] >> 1;
v22 = &__s[1];
}
std::string::append(&v31, v22, v23);
if ( (__s[0] & 1) != 0 )
operator delete(__p);
GJSmartTemplate::keyFromNeighborsOld(v27, v11 != 48, v18 != 48, v36 != 48, v37 != 48, v35, v19, v20, v21);
v24 = sub_10088E600(v27);
cocos2d::CCDictionary::setObject((__int64)v30, v24, (char *)&v31);
if ( (v27[0] & 1) != 0 )
operator delete((void *)v27[2]);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v31.__r_.__value_.__l.__data_);
}
LABEL_33:
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
v2 = v29;
v25 = sub_1007FEF90(v29);
v3 = (unsigned int)(v28 + 1);
if ( (unsigned int)v3 >= v25 )
return v30;
}
v9 = v6 | 7;
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = v9 + 1;
data = (char *)operator new(v10);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst.__r_.__value_.__r.__words[0] = v10 | 1;
__dst.__r_.__value_.__l.__size_ = v7;
LABEL_10:
memmove(data, CString, v7);
goto LABEL_11;
}
return v30;
}