//
// GameObject::objectFromVector from 0x654db0 to 0x656200 (5200 bytes)
//
// 3 xrefs:
// > PlayLayer::processCreateObjectsFromSetup @ 0x5dd4ec
// > LevelEditorLayer::addObjectFromVector @ 0x6709e0
// > ??> @ 0x855d8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GameObject *GameObject::objectFromVector(
std::vector *a1,
std::vector *a2,
GJBaseGameLayer *a3,
bool a4)
{
void **m_start; // x19
_BOOL4 v8; // w23
char v9; // w22
int v10; // w0
int v11; // w25
char *v12; // x24
GameObject *v14; // x19
ObjectToolbox *v15; // x0
char *v16; // x0
void **v17; // x28
double v18; // d0
float v19; // s11
float v20; // s8
double v21; // d0
float v22; // s9
int v23; // w1
void **v24; // x28
int v25; // w0
void *v26; // x1
GameObject_vtbl *v27; // x2
int (__fastcall *addToGroup)(GameObject *__hidden, int); // x22
__int64 v29; // x1
int (__fastcall *v30)(GameObject *__hidden, int); // x22
__int64 v31; // x1
void **v32; // x22
int v33; // w0
void *v34; // x1
bool v35; // w1
void *v36; // x0
int v37; // w0
__int16 v38; // w1
void *v39; // x0
__int16 v40; // w0
void *v41; // x1
long double v42; // q0
unsigned __int8 *v43; // x0
void **v44; // x28
bool v45; // w1
void *v46; // x0
bool v47; // w1
void *v48; // x0
void *v49; // x0
void **v50; // x27
double v51; // d0
float v52; // s10
float v53; // s12
double v54; // d0
float v55; // s10
void *v56; // x0
float m_scaleY; // w1
bool v58; // w1
void *v59; // x0
bool v60; // w1
void *v61; // x0
bool v62; // w1
void *v63; // x0
bool v64; // zf
void *v65; // x0
char v66; // w1
int v67; // w0
void *v68; // x1
int v69; // w0
void *v70; // x1
void *v71; // x0
char v72; // w1
void *v73; // x0
char v74; // w1
void *v75; // x0
char v76; // w1
void *v77; // x0
char v78; // w1
void *v79; // x0
char v80; // w1
void *v81; // x0
char v82; // w1
void *v83; // x0
char v84; // w1
void *v85; // x0
char v86; // w1
void *v87; // x0
char v88; // w1
void *v89; // x0
char v90; // w1
void *v91; // x0
char v92; // w1
__int16 v93; // w0
void *v94; // x1
bool v95; // w2
GameObject_vtbl *v96; // x1
char *v97; // x0
char *v98; // x0
void (__fastcall *setupCustomSprites)(GameObject *__hidden, std::string); // x26
long double v100; // q0
void *v101; // x0
void **v102; // x0
void *v103; // x0
bool v104; // w0
void **v105; // x0
float v106; // s9
float v107; // s10
void (__fastcall *setStartPos)(GameObject *__hidden, cocos2d::CCPoint); // x24
void **v109; // x24
std::string *v110; // x25
__int64 v111; // x0
__int64 v112; // x1
GJSpriteColor *m_baseColor; // x2
void *v114; // x0
std::string *v115; // x25
__int64 v116; // x0
__int64 v117; // x1
GJSpriteColor *m_detailColor; // x2
void *v119; // x0
int v120; // w0
unsigned int v121; // w0
int v122; // w0
GJSpriteColor *v123; // x1
void *v124; // x0
void *v125; // x0
void *v126; // x21
float v127; // s0
unsigned int *v128; // x20
int v129; // w0
int v130; // w0
GJSpriteColor *v131; // x1
int v132; // w0
GJSpriteColor *v133; // x1
float v134; // s0
GameObject_vtbl *v135; // x1
GJSpriteColor *v136; // x1
void *v137; // x0
void *v138; // x1
void *v139; // x1
void *v140; // x0
void *v141; // x0
void *v142; // x0
void *v143; // x0
void *v144; // x0
void *v145; // x0
void *v146; // x0
void *v147; // x0
void *v148; // x0
void *v149; // x0
void *v150; // x0
void *v151; // x1
void *v152; // x0
void *v153; // x1
unsigned int *v154; // x1
int v155; // w2
unsigned int *v156; // x1
int v157; // w2
unsigned int *v158; // x1
int v159; // w2
unsigned int *v160; // x1
int v161; // w2
unsigned int *v162; // x1
int v163; // w2
unsigned int *v164; // x1
int v165; // w2
unsigned int *v166; // x1
int v167; // w2
unsigned int *v168; // x1
int v169; // w2
unsigned int *v170; // x1
int v171; // w2
__int16 v172; // [xsp+A0h] [xbp+A0h]
__int16 v173; // [xsp+A4h] [xbp+A4h]
_BOOL4 v174; // [xsp+A8h] [xbp+A8h]
_BOOL4 v175; // [xsp+ACh] [xbp+ACh]
__int64 v176; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v177; // [xsp+C0h] [xbp+C0h] BYREF
unsigned __int8 *v178; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v179; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v180; // [xsp+D8h] [xbp+D8h] BYREF
char *v181; // [xsp+E0h] [xbp+E0h] BYREF
char *v182; // [xsp+E8h] [xbp+E8h] BYREF
cocos2d::CCPoint v183; // [xsp+F0h] [xbp+F0h] BYREF
m_start = a2->m_start;
v8 = a4;
if ( *((_QWORD *)a2->m_start + 103) && atoi((const char *)a1->m_start[103].m_data.m_data) )
{
v9 = 1;
if ( v8 )
return nullptr;
}
else
{
v9 = 0;
}
if ( !m_start[1] )
{
v11 = -1;
LODWORD(v12) = 0;
goto LABEL_18;
}
v10 = atoi((const char *)a1->m_start[1].m_data.m_data);
v11 = v10;
if ( v10 == 677 )
{
v11 = -1;
LODWORD(v12) = 1736;
goto LABEL_18;
}
if ( v10 <= 677 )
{
if ( v10 != 221 )
{
if ( v10 <= 221 )
{
LODWORD(v12) = 915;
if ( v10 == 104 )
goto LABEL_18;
}
else
{
if ( v10 == 675 )
{
v11 = -1;
LODWORD(v12) = 1734;
goto LABEL_18;
}
if ( v10 == 676 )
{
v11 = -1;
v12 = (char *)&elf_hash_bucket[307] + 3;
goto LABEL_18;
}
}
goto LABEL_316;
}
LABEL_185:
LODWORD(v12) = 899;
goto LABEL_18;
}
if ( v10 == 743 )
goto LABEL_185;
if ( v10 > 743 )
{
if ( v10 == 1008 )
{
v11 = -1;
LODWORD(v12) = 1292;
goto LABEL_18;
}
goto LABEL_316;
}
if ( (unsigned int)(v10 - 717) <= 1 )
goto LABEL_185;
LABEL_316:
if ( (unsigned int)(v10 - 1964) > 0x2F )
{
LODWORD(v12) = v10;
v11 = -1;
}
else
{
v11 = -1;
LODWORD(v12) = 1964;
}
LABEL_18:
v14 = GameObject::createWithKey((int)v12);
if ( !v14 )
return nullptr;
v15 = ObjectToolbox::sharedState();
v16 = (char *)ObjectToolbox::intKeyToFrame(v15, (int)v12);
sub_D153B8((int)&v176, v16);
v17 = a2->m_start;
if ( !*((_QWORD *)a2->m_start + 2) )
{
if ( !v17[3] )
{
v19 = 0.0;
v20 = 90.0;
LABEL_23:
if ( v17[4] )
goto LABEL_24;
LABEL_212:
v175 = 0;
if ( v17[5] )
goto LABEL_25;
goto LABEL_213;
}
v19 = 0.0;
v20 = atof((const char *)a1->m_start[3].m_data.m_data) + 90.0;
LABEL_22:
v17 = a2->m_start;
goto LABEL_23;
}
v18 = atof((const char *)a1->m_start[2].m_data.m_data);
v17 = a2->m_start;
v19 = v18;
if ( *((_QWORD *)a2->m_start + 3) )
{
v20 = atof((const char *)a1->m_start[3].m_data.m_data) + 90.0;
goto LABEL_22;
}
v20 = 90.0;
if ( !v17[4] )
goto LABEL_212;
LABEL_24:
v175 = atoi((const char *)a1->m_start[4].m_data.m_data) != 0;
if ( v17[5] )
{
LABEL_25:
v174 = atoi((const char *)a1->m_start[5].m_data.m_data) != 0;
goto LABEL_26;
}
LABEL_213:
v174 = 0;
LABEL_26:
if ( v17[6] )
{
v21 = atof((const char *)a1->m_start[6].m_data.m_data);
v17 = a2->m_start;
v22 = v21;
if ( *((_QWORD *)a2->m_start + 20) )
goto LABEL_28;
LABEL_209:
v173 = 0;
if ( v17[61] )
goto LABEL_29;
LABEL_210:
v172 = 0;
goto LABEL_30;
}
v22 = 0.0;
if ( !v17[20] )
goto LABEL_209;
LABEL_28:
v173 = atoi((const char *)a1->m_start[20].m_data.m_data);
if ( !v17[61] )
goto LABEL_210;
LABEL_29:
v172 = atoi((const char *)a1->m_start[61].m_data.m_data);
LABEL_30:
v14->m_objectID = (int)v12;
if ( (_DWORD)v12 == 9 || (_DWORD)v12 == 1715 )
{
v14->m_defaultZOrder = 2;
if ( v17[24] )
goto LABEL_33;
}
else if ( v17[24] )
{
LABEL_33:
v23 = atoi((const char *)a1->m_start[24].m_data.m_data);
goto LABEL_34;
}
v23 = 0;
LABEL_34:
GameObject::setCustomZLayer(v14, v23);
v24 = a2->m_start;
if ( *((_QWORD *)a2->m_start + 25) )
v25 = atoi((const char *)a1->m_start[25].m_data.m_data);
else
v25 = 0;
v26 = v24[26];
v27 = v14->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14->m_isHighDetail = v9;
v14->m_zOrder = v25;
addToGroup = v27->addToGroup;
if ( v26 )
v29 = (unsigned int)atoi((const char *)a1->m_start[26].m_data.m_data);
else
v29 = 0;
addToGroup(v14, v29);
v30 = v14->addToGroup;
if ( *((_QWORD *)a2->m_start + 33) )
v31 = (unsigned int)atoi((const char *)a1->m_start[33].m_data.m_data);
else
v31 = 0;
v30(v14, v31);
v32 = a2->m_start;
if ( *((_QWORD *)a2->m_start + 108) )
v33 = atoi((const char *)a1->m_start[108].m_data.m_data);
else
v33 = 0;
v34 = v32[121];
v14->m_linkedGroup = v33;
if ( v34 )
v35 = atoi((const char *)a1->m_start[121].m_data.m_data) != 0;
else
v35 = 0;
v36 = v32[343];
v14->m_isNoTouch = v35;
if ( !v36 )
{
v152 = v32[446];
v14->m_enterChannel = 0;
if ( v152 )
goto LABEL_49;
LABEL_257:
v153 = v32[57];
v14->m_objectMaterial = 0;
if ( v153 )
goto LABEL_50;
LABEL_258:
sub_D153B8((int)&v177, &byte_F288A0);
goto LABEL_51;
}
v37 = atoi((const char *)a1->m_start[343].m_data.m_data);
v38 = 100;
if ( v37 <= 100 )
{
v38 = v37;
if ( v37 <= 0 )
v38 = 0;
}
v39 = v32[446];
v14->m_enterChannel = v38;
if ( !v39 )
goto LABEL_257;
LABEL_49:
v40 = atoi((const char *)a1->m_start[446].m_data.m_data);
v41 = v32[57];
v14->m_objectMaterial = v40;
if ( !v41 )
goto LABEL_258;
LABEL_50:
sub_D18D28(&v177, &a1->m_start[57]);
LABEL_51:
*(__n128 *)&v42 = sub_D18D28(&v178, &v177);
GameObject::loadGroupsFromString(v14, &v178, v42);
v43 = v178 - 24;
if ( v178 - 24 != (unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v154 = (unsigned int *)(v178 - 8);
do
v155 = __ldaxr(v154);
while ( __stlxr(v155 - 1, v154) );
}
else
{
v155 = *((_DWORD *)v178 - 2);
*((_DWORD *)v178 - 2) = v155 - 1;
}
if ( v155 <= 0 )
operator delete(v43);
}
v44 = a2->m_start;
if ( *((_QWORD *)a2->m_start + 34) )
v45 = atoi((const char *)a1->m_start[34].m_data.m_data) != 0;
else
v45 = 0;
v46 = v44[279];
v14->m_hasGroupParent = v45;
if ( v46 )
v47 = atoi((const char *)a1->m_start[279].m_data.m_data) != 0;
else
v47 = 0;
v48 = v44[274];
v14->m_hasAreaParent = v47;
if ( v48 )
sub_D18D28(&v179, &a1->m_start[274]);
else
sub_D153B8((int)&v179, &byte_F288A0);
if ( a3 && *(_QWORD *)(v179 - 24) )
{
sub_D18D28(&v180, &v179);
GJBaseGameLayer::loadGroupParentsFromString(a3, v14, (std::string)&v180);
v49 = (void *)(v180 - 24);
if ( (__int64 *)(v180 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v170 = (unsigned int *)(v180 - 8);
do
v171 = __ldaxr(v170);
while ( __stlxr(v171 - 1, v170) );
}
else
{
v171 = *(_DWORD *)(v180 - 8);
*(_DWORD *)(v180 - 8) = v171 - 1;
}
if ( v171 <= 0 )
operator delete(v49);
}
v50 = a2->m_start;
if ( *((_QWORD *)a2->m_start + 128) )
goto LABEL_62;
LABEL_192:
if ( v50[129] )
{
v52 = 0.0;
v53 = atof((const char *)a1->m_start[129].m_data.m_data);
if ( v53 == 0.0 )
{
LABEL_65:
v50 = a2->m_start;
if ( v52 != 0.0 )
goto LABEL_70;
goto LABEL_66;
}
LABEL_194:
GameObject::updateCustomScaleY(v14, v53);
goto LABEL_69;
}
goto LABEL_66;
}
v50 = a2->m_start;
v14->m_hasGroupParentsString = 0;
if ( !v50[128] )
goto LABEL_192;
LABEL_62:
v51 = atof((const char *)a1->m_start[128].m_data.m_data);
v50 = a2->m_start;
v52 = v51;
if ( *((_QWORD *)a2->m_start + 129) )
{
v53 = atof((const char *)a1->m_start[129].m_data.m_data);
if ( v52 == 0.0 )
goto LABEL_64;
goto LABEL_207;
}
if ( v52 != 0.0 )
{
v53 = 0.0;
LABEL_207:
GameObject::updateCustomScaleX(v14, v52);
LABEL_64:
if ( v53 == 0.0 )
goto LABEL_65;
goto LABEL_194;
}
LABEL_66:
if ( !v50[32] )
goto LABEL_70;
v54 = atof((const char *)a1->m_start[32].m_data.m_data);
v55 = v54;
if ( v55 != 0.0 )
{
v127 = v54;
GameObject::updateCustomScaleX(v14, v127);
GameObject::updateCustomScaleY(v14, v55);
}
LABEL_69:
v50 = a2->m_start;
LABEL_70:
v56 = v50[64];
m_scaleY = v14->m_scaleY;
v14->m_startScaleX = v14->m_scaleX;
v14->m_startScaleY = m_scaleY;
if ( v56 )
v58 = atoi((const char *)a1->m_start[64].m_data.m_data) != 0;
else
v58 = 0;
v59 = v50[67];
v14->m_isDontFade = v58;
if ( v59 )
v60 = atoi((const char *)a1->m_start[67].m_data.m_data) != 0;
else
v60 = 0;
v61 = v50[116];
v14->m_isDontEnter = v60;
if ( v61 )
v62 = atoi((const char *)a1->m_start[116].m_data.m_data) != 0;
else
v62 = 0;
v63 = v50[507];
v14->m_hasNoEffects = v62;
if ( v63 )
{
v64 = atoi((const char *)a1->m_start[507].m_data.m_data) == 0;
v65 = v50[155];
v66 = !v64;
v14->m_hasNoParticles = v66;
if ( v65 )
{
LABEL_81:
v67 = atoi((const char *)a1->m_start[155].m_data.m_data);
v68 = v50[156];
v14->m_mainColorKeyIndex = v67;
if ( v68 )
goto LABEL_82;
goto LABEL_237;
}
}
else
{
v137 = v50[155];
v14->m_hasNoParticles = 0;
if ( v137 )
goto LABEL_81;
}
v138 = v50[156];
v14->m_mainColorKeyIndex = 0;
if ( v138 )
{
LABEL_82:
v69 = atoi((const char *)a1->m_start[156].m_data.m_data);
v70 = v50[134];
v14->m_detailColorKeyIndex = v69;
if ( v70 )
goto LABEL_83;
LABEL_238:
v140 = v50[135];
v14->m_isPassable = 0;
if ( v140 )
goto LABEL_87;
LABEL_239:
v141 = v50[136];
v14->m_isHide = 0;
if ( v141 )
goto LABEL_91;
LABEL_240:
v142 = v50[289];
v14->m_isNonStickX = 0;
if ( v142 )
goto LABEL_95;
LABEL_241:
v143 = v50[495];
v14->m_isNonStickY = 0;
if ( v143 )
goto LABEL_99;
LABEL_242:
v144 = v50[496];
v14->m_isExtraSticky = 0;
if ( v144 )
goto LABEL_103;
LABEL_243:
v145 = v50[509];
v14->m_isDontBoostY = 0;
if ( v145 )
goto LABEL_107;
LABEL_244:
v146 = v50[356];
v14->m_isDontBoostX = 0;
if ( v146 )
goto LABEL_111;
LABEL_245:
v147 = v50[137];
v14->m_isScaleStick = 0;
if ( v147 )
goto LABEL_115;
LABEL_246:
v148 = v50[193];
v14->m_isIceBlock = 0;
if ( v148 )
goto LABEL_119;
LABEL_247:
v149 = v50[372];
v14->m_isGripSlope = 0;
if ( v149 )
goto LABEL_123;
LABEL_248:
v150 = v50[497];
v14->m_hasNoAudioScale = 0;
if ( v150 )
goto LABEL_127;
LABEL_249:
v151 = v50[511];
v14->m_customColorType = 0;
if ( v151 )
goto LABEL_128;
LABEL_250:
v95 = 0;
goto LABEL_129;
}
LABEL_237:
v139 = v50[134];
v14->m_detailColorKeyIndex = 0;
if ( !v139 )
goto LABEL_238;
LABEL_83:
v64 = atoi((const char *)a1->m_start[134].m_data.m_data) == 0;
v71 = v50[135];
v72 = !v64;
v14->m_isPassable = v72;
if ( !v71 )
goto LABEL_239;
LABEL_87:
v64 = atoi((const char *)a1->m_start[135].m_data.m_data) == 0;
v73 = v50[136];
v74 = !v64;
v14->m_isHide = v74;
if ( !v73 )
goto LABEL_240;
LABEL_91:
v64 = atoi((const char *)a1->m_start[136].m_data.m_data) == 0;
v75 = v50[289];
v76 = !v64;
v14->m_isNonStickX = v76;
if ( !v75 )
goto LABEL_241;
LABEL_95:
v64 = atoi((const char *)a1->m_start[289].m_data.m_data) == 0;
v77 = v50[495];
v78 = !v64;
v14->m_isNonStickY = v78;
if ( !v77 )
goto LABEL_242;
LABEL_99:
v64 = atoi((const char *)a1->m_start[495].m_data.m_data) == 0;
v79 = v50[496];
v80 = !v64;
v14->m_isExtraSticky = v80;
if ( !v79 )
goto LABEL_243;
LABEL_103:
v64 = atoi((const char *)a1->m_start[496].m_data.m_data) == 0;
v81 = v50[509];
v82 = !v64;
v14->m_isDontBoostY = v82;
if ( !v81 )
goto LABEL_244;
LABEL_107:
v64 = atoi((const char *)a1->m_start[509].m_data.m_data) == 0;
v83 = v50[356];
v84 = !v64;
v14->m_isDontBoostX = v84;
if ( !v83 )
goto LABEL_245;
LABEL_111:
v64 = atoi((const char *)a1->m_start[356].m_data.m_data) == 0;
v85 = v50[137];
v86 = !v64;
v14->m_isScaleStick = v86;
if ( !v85 )
goto LABEL_246;
LABEL_115:
v64 = atoi((const char *)a1->m_start[137].m_data.m_data) == 0;
v87 = v50[193];
v88 = !v64;
v14->m_isIceBlock = v88;
if ( !v87 )
goto LABEL_247;
LABEL_119:
v64 = atoi((const char *)a1->m_start[193].m_data.m_data) == 0;
v89 = v50[372];
v90 = !v64;
v14->m_isGripSlope = v90;
if ( !v89 )
goto LABEL_248;
LABEL_123:
v64 = atoi((const char *)a1->m_start[372].m_data.m_data) == 0;
v91 = v50[497];
v92 = !v64;
v14->m_hasNoAudioScale = v92;
if ( !v91 )
goto LABEL_249;
LABEL_127:
v93 = atoi((const char *)a1->m_start[497].m_data.m_data);
v94 = v50[511];
v14->m_customColorType = v93;
if ( !v94 )
goto LABEL_250;
LABEL_128:
v95 = atoi((const char *)a1->m_start[511].m_data.m_data) != 0;
LABEL_129:
v96 = v14->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14->m_hasExtendedCollision = v95;
v96->customSetup(v14);
v14->customObjectSetup(v14, a1, a2);
sub_D18D28(&v181, &v176);
GameObject::addGlow((__int64)v14, &v181);
v97 = v181 - 24;
if ( v181 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v156 = (unsigned int *)(v181 - 8);
do
v157 = __ldaxr(v156);
while ( __stlxr(v157 - 1, v156) );
}
else
{
v157 = *((_DWORD *)v181 - 2);
*((_DWORD *)v181 - 2) = v157 - 1;
}
if ( v157 <= 0 )
operator delete(v97);
}
sub_D18D28(&v182, &v176);
GameObject::addColorSprite(v14, &v182);
v98 = v182 - 24;
if ( v182 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v160 = (unsigned int *)(v182 - 8);
do
v161 = __ldaxr(v160);
while ( __stlxr(v161 - 1, v160) );
}
else
{
v161 = *((_DWORD *)v182 - 2);
*((_DWORD *)v182 - 2) = v161 - 1;
}
if ( v161 <= 0 )
operator delete(v98);
}
setupCustomSprites = v14->setupCustomSprites;
*(__n128 *)&v100 = sub_D18D28(&v183, &v176);
((void (__fastcall *)(GameObject *, cocos2d::CCPoint *, long double))setupCustomSprites)(v14, &v183, v100);
v101 = (void *)(*(_QWORD *)&v183 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v183 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v158 = (unsigned int *)(*(_QWORD *)&v183 - 8LL);
do
v159 = __ldaxr(v158);
while ( __stlxr(v159 - 1, v158) );
}
else
{
v159 = *(_DWORD *)(*(_QWORD *)&v183 - 8LL);
*(_DWORD *)(*(_QWORD *)&v183 - 8LL) = v159 - 1;
}
if ( v159 <= 0 )
operator delete(v101);
}
v14->setFlipX(v14, v175);
v14->setFlipY(v14, v174);
v102 = a2->m_start;
v14->m_startFlipX = v175;
v103 = v102[96];
v14->m_editorLayer = v173;
v14->m_startFlipY = v174;
v14->m_editorLayer2 = v172;
if ( v103 )
v104 = atoi((const char *)a1->m_start[96].m_data.m_data) != 0;
else
v104 = 0;
v14->m_hasNoGlow = v104;
if ( !GameObject::canRotateFree(v14) && (int)v22 % 90 && !v14->m_isNoTouch )
v22 = 0.0;
v14->setRotation(v14, v22);
v105 = a2->m_start;
v14->m_startRotationX = v22;
v14->m_startRotationY = v22;
if ( v105[131] )
{
v106 = atof((const char *)a1->m_start[131].m_data.m_data);
if ( !*((_QWORD *)a2->m_start + 132) )
{
v107 = 0.0;
if ( v106 == 0.0 )
goto LABEL_141;
goto LABEL_217;
}
}
else
{
v106 = 0.0;
if ( !v105[132] )
goto LABEL_141;
}
v107 = atof((const char *)a1->m_start[132].m_data.m_data);
if ( v106 == v107 )
goto LABEL_141;
LABEL_217:
if ( GameObject::canRotateFree(v14) )
{
v14->setRotationX(v14, v106);
v134 = v14->getRotationX(v14);
v135 = v14->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14->m_startRotationX = v134;
v135->setRotationY(v14, v107);
v14->m_startRotationY = v14->getRotationY(v14);
if ( (_DWORD)v12 != 142 )
goto LABEL_142;
goto LABEL_219;
}
LABEL_141:
if ( (_DWORD)v12 != 142 )
goto LABEL_142;
LABEL_219:
EnhancedGameObject::updateUserCoin((EnhancedGameObject *)v14);
LABEL_142:
setStartPos = v14->setStartPos;
cocos2d::CCPoint::CCPoint(&v183, v19, v20);
((void (__fastcall *)(GameObject *, cocos2d::CCPoint *))setStartPos)(v14, &v183);
v14->getObjectTextureRect(v14);
if ( v11 != -1 )
{
if ( v11 == 717 )
{
v14->m_targetColor = 2;
}
else if ( v11 > 717 )
{
if ( v11 == 718 )
{
v14->m_targetColor = 3;
}
else if ( v11 == 743 )
{
v14->m_targetColor = 4;
}
}
else if ( v11 == 104 )
{
HIBYTE(v14[1].m_sAdditionalTransform.tx) = 1;
}
else if ( v11 == 221 )
{
v14->m_targetColor = 1;
}
}
v109 = a2->m_start;
if ( *((_QWORD *)a2->m_start + 41) )
{
v110 = a1->m_start;
if ( atoi((const char *)a1->m_start[41].m_data.m_data) )
{
if ( v109[43] )
sub_D18D28(&v183, &v110[43]);
else
sub_D153B8((int)&v183, &byte_F288A0);
v111 = GameToolbox::hsvFromString(&v183, &byte_F7A380);
if ( *(float *)&v111 != *(float *)&qword_1242070
|| *((float *)&v111 + 1) != *((float *)&qword_1242070 + 1)
|| *(float *)&v112 != *(float *)&qword_1242078
|| WORD2(v112) != WORD2(qword_1242078) )
{
m_baseColor = v14->m_baseColor;
*(_QWORD *)&m_baseColor->m_hsv.h = v111;
*(_QWORD *)&m_baseColor->m_hsv.v = v112;
m_baseColor->m_usesHSV = 1;
}
v114 = (void *)(*(_QWORD *)&v183 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v183 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v168 = (unsigned int *)(*(_QWORD *)&v183 - 8LL);
do
v169 = __ldaxr(v168);
while ( __stlxr(v169 - 1, v168) );
}
else
{
v169 = *(_DWORD *)(*(_QWORD *)&v183 - 8LL);
*(_DWORD *)(*(_QWORD *)&v183 - 8LL) = v169 - 1;
}
if ( v169 <= 0 )
operator delete(v114);
}
v109 = a2->m_start;
}
}
if ( v109[42] )
{
v115 = a1->m_start;
if ( atoi((const char *)a1->m_start[42].m_data.m_data) )
{
if ( v14->m_detailColor )
{
if ( v109[44] )
sub_D18D28(&v183, &v115[44]);
else
sub_D153B8((int)&v183, &byte_F288A0);
v116 = GameToolbox::hsvFromString(&v183, &byte_F7A380);
if ( *(float *)&v116 != *(float *)&qword_1242070
|| *((float *)&v116 + 1) != *((float *)&qword_1242070 + 1)
|| *(float *)&v117 != *(float *)&qword_1242078
|| WORD2(v117) != WORD2(qword_1242078) )
{
m_detailColor = v14->m_detailColor;
*(_QWORD *)&m_detailColor->m_hsv.h = v116;
*(_QWORD *)&m_detailColor->m_hsv.v = v117;
m_detailColor->m_usesHSV = 1;
}
v119 = (void *)(*(_QWORD *)&v183 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v183 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v166 = (unsigned int *)(*(_QWORD *)&v183 - 8LL);
do
v167 = __ldaxr(v166);
while ( __stlxr(v167 - 1, v166) );
}
else
{
v167 = *(_DWORD *)(*(_QWORD *)&v183 - 8LL);
*(_DWORD *)(*(_QWORD *)&v183 - 8LL) = v167 - 1;
}
if ( v167 <= 0 )
operator delete(v119);
}
v109 = a2->m_start;
}
}
}
if ( !v109[19] || (v120 = atoi((const char *)a1->m_start[19].m_data.m_data)) == 0 )
{
if ( v109[21] )
{
v130 = atoi((const char *)a1->m_start[21].m_data.m_data);
if ( v130 <= 1100 )
{
if ( v130 < 0 )
v130 = 0;
if ( !v130 )
goto LABEL_199;
v131 = v14->m_baseColor;
}
else
{
v131 = v14->m_baseColor;
v130 = 1101;
}
v131->m_colorID = v130;
}
LABEL_199:
if ( v109[22] )
{
v132 = atoi((const char *)a1->m_start[22].m_data.m_data);
if ( v132 <= 1100 )
{
if ( v132 < 0 )
v132 = 0;
if ( v132 )
{
v136 = v14->m_detailColor;
if ( v136 )
v136->m_colorID = v132;
}
}
else
{
v133 = v14->m_detailColor;
if ( v133 )
v133->m_colorID = 1101;
}
}
goto LABEL_180;
}
v121 = v120 - 1;
if ( v121 <= 7 )
{
v122 = dword_EC3680[v121];
if ( v122 )
{
v123 = v14->m_detailColor;
if ( !v123 )
v123 = v14->m_baseColor;
if ( v122 < 0 )
v122 = 0;
v123->m_colorID = v122;
}
}
LABEL_180:
v14->saveActiveColors(v14);
GameObject::resetRScaleForced(v14);
v124 = (void *)(v179 - 24);
if ( (__int64 *)(v179 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v164 = (unsigned int *)(v179 - 8);
do
v165 = __ldaxr(v164);
while ( __stlxr(v165 - 1, v164) );
}
else
{
v165 = *(_DWORD *)(v179 - 8);
*(_DWORD *)(v179 - 8) = v165 - 1;
}
if ( v165 <= 0 )
operator delete(v124);
}
v125 = (void *)(v177 - 24);
if ( (__int64 *)(v177 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v162 = (unsigned int *)(v177 - 8);
do
v163 = __ldaxr(v162);
while ( __stlxr(v163 - 1, v162) );
}
else
{
v163 = *(_DWORD *)(v177 - 8);
*(_DWORD *)(v177 - 8) = v163 - 1;
}
if ( v163 <= 0 )
operator delete(v125);
}
v126 = (void *)(v176 - 24);
if ( (__int64 *)(v176 - 24) == &qword_124B6B0 )
return v14;
if ( &pthread_create )
{
v128 = (unsigned int *)(v176 - 8);
do
v129 = __ldaxr(v128);
while ( __stlxr(v129 - 1, v128) );
}
else
{
v129 = *(_DWORD *)(v176 - 8);
*(_DWORD *)(v176 - 8) = v129 - 1;
}
if ( v129 > 0 )
return v14;
operator delete(v126);
return v14;
}