//
// GJSmartTemplate::generateRemapDict from 0xb121c8 to 0xb12618 (1104 bytes)
//
// 1 xrefs:
// > ??> @ 0xe5390
//
// 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 13:01:29 +0000
//
cocos2d::CCDictionary *__fastcall GJSmartTemplate::generateRemapDict(GJSmartTemplate *this)
{
unsigned int v1; // w21
cocos2d::CCNode *v2; // x22
cocos2d::CCNode *v3; // x0
cocos2d::CCString *v4; // x0
const char *CString; // x0
size_t v6; // x0
int v7; // w1
char *v8; // x25
unsigned int v9; // w23
unsigned int v10; // w27
_BOOL4 v11; // w28
_BOOL4 v12; // w22
_BOOL4 v13; // w24
_BOOL4 v14; // w26
_BOOL4 v15; // w0
_BOOL4 v16; // w25
cocos2d::CCObject *v18; // x0
int v19; // w25
bool v20; // [xsp+0h] [xbp+0h]
cocos2d::CCDictionary *v21; // [xsp+60h] [xbp+60h]
cocos2d::CCArray *v22; // [xsp+70h] [xbp+70h]
char *v23; // [xsp+78h] [xbp+78h]
_BOOL4 v24; // [xsp+78h] [xbp+78h]
__int64 v25; // [xsp+80h] [xbp+80h] BYREF
size_t v26; // [xsp+88h] [xbp+88h]
void *v27; // [xsp+90h] [xbp+90h]
_BYTE v28[16]; // [xsp+98h] [xbp+98h] BYREF
void *v29; // [xsp+A8h] [xbp+A8h]
__int64 v30; // [xsp+B0h] [xbp+B0h] BYREF
size_t v31; // [xsp+B8h] [xbp+B8h]
void *v32; // [xsp+C0h] [xbp+C0h]
int v33[8]; // [xsp+C8h] [xbp+C8h] BYREF
v1 = 0;
v21 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(_stack_chk_guard);
v2 = (cocos2d::CCNode *)cocos2d::CCDictionary::create(v21);
v3 = (cocos2d::CCNode *)cocos2d::CCNode::create(v2);
generateAllBinaryStrings(8, v33, 0, v2, v3);
v22 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v2);
if ( (unsigned int)cocos2d::CCArray::count(v22) )
{
while ( 1 )
{
v4 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v22, v1);
CString = (const char *)cocos2d::CCString::getCString(v4);
v25 = 0;
v26 = 0;
v27 = nullptr;
v23 = (char *)CString;
v6 = strlen(CString);
std::string::__init(&v25, v23, v6);
v7 = v25 & 1;
if ( v7 )
{
if ( !v26 )
goto LABEL_52;
v8 = (char *)v27;
v9 = *(unsigned __int8 *)v27 != 48;
if ( v26 <= 1 )
goto LABEL_59;
v10 = *((unsigned __int8 *)v27 + 1) != 48;
if ( v26 == 2 )
goto LABEL_58;
v24 = *((unsigned __int8 *)v27 + 2) != 48;
if ( v26 == 3 )
goto LABEL_57;
v11 = *((unsigned __int8 *)v27 + 3) != 48;
if ( v26 == 4 )
goto LABEL_56;
v12 = *((unsigned __int8 *)v27 + 4) != 48;
if ( v26 == 5 )
goto LABEL_55;
v13 = *((unsigned __int8 *)v27 + 5) != 48;
if ( v26 == 6 )
goto LABEL_54;
v14 = *((unsigned __int8 *)v27 + 6) != 48;
if ( v26 == 7 )
goto LABEL_53;
}
else
{
v19 = (int)(unsigned __int8)v25 >> 1;
if ( !v19 )
LABEL_52:
sub_B0BD50();
v9 = BYTE1(v25) != 48;
if ( v19 == 1 )
LABEL_59:
sub_B0BD50();
v10 = BYTE2(v25) != 48;
if ( v19 == 2 )
LABEL_58:
sub_B0BD50();
v24 = BYTE3(v25) != 48;
if ( v19 == 3 )
LABEL_57:
sub_B0BD50();
v11 = BYTE4(v25) != 48;
if ( v19 == 4 )
LABEL_56:
sub_B0BD50();
v12 = BYTE5(v25) != 48;
if ( v19 == 5 )
LABEL_55:
sub_B0BD50();
v13 = BYTE6(v25) != 48;
if ( v19 == 6 )
LABEL_54:
sub_B0BD50();
v14 = HIBYTE(v25) != 48;
if ( v19 == 7 )
LABEL_53:
sub_B0BD50();
v8 = (char *)&v25 + 1;
}
v15 = 0;
v16 = v8[7] != 48;
if ( v12 )
{
v15 = !v24 >= v9;
if ( !v24 >= v9 )
LOBYTE(v12) = 0;
}
if ( v13 && !v11 >= v9 )
{
v15 = 1;
LOBYTE(v13) = 0;
}
if ( v14 && !v24 >= v10 )
break;
if ( v16 )
goto LABEL_21;
if ( !v15 )
{
LABEL_23:
if ( v7 )
goto LABEL_27;
goto LABEL_24;
}
LABEL_29:
v30 = 0;
v31 = 0;
v32 = nullptr;
if ( v7 )
{
std::string::__init(&v30, v27, v26);
}
else
{
v32 = v27;
v30 = v25;
v31 = v26;
}
prefabKeyFromBinary((__int64)&v30, (__int64)v28);
if ( (v30 & 1) != 0 )
operator delete(v32);
GJSmartTemplate::keyFromNeighborsOld((GJSmartTemplate *)v9, v10, v24, v11, v12, v13, v14, v16, &v30, v20);
v18 = (cocos2d::CCObject *)cocos2d::CCString::create(&v30);
cocos2d::CCDictionary::setObject((int)v21, v18);
if ( (v30 & 1) != 0 )
operator delete(v32);
if ( (v28[0] & 1) != 0 )
operator delete(v29);
if ( (v25 & 1) != 0 )
{
LABEL_27:
++v1;
operator delete(v27);
goto LABEL_25;
}
LABEL_24:
++v1;
LABEL_25:
if ( v1 >= (unsigned int)cocos2d::CCArray::count(v22) )
return v21;
}
LOBYTE(v14) = 0;
if ( !v16 )
goto LABEL_29;
v15 = 1;
LOBYTE(v14) = 0;
LABEL_21:
if ( !v11 >= v10 )
{
LOBYTE(v16) = 0;
}
else
{
LOBYTE(v16) = 1;
if ( !v15 )
goto LABEL_23;
}
goto LABEL_29;
}
return v21;
}