//
// GJBaseGameLayer::addGuideArt from 0x140245ed0 to 0x1402466b6 (2022 bytes)
//
// 3 xrefs:
// > PlayLayer::addObject @ 0x1403ae650
// > PlayLayer::addObject @ 0x1403ae686
// > ??> @ 0x1406ce634
//
// 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
//
// Hidden C++ exception states: #wind=7
bool GJBaseGameLayer::addGuideArt(GJBaseGameLayer *a1, GameObject *a2)
{
float v2; // xmm0_4
int m_objectID; // ebx
ObjectToolbox *v7; // rax
_QWORD *v8; // rax
size_t v9; // rdi
size_t v10; // r8
void **v11; // rdx
char *v12; // rax
size_t v13; // r8
double v14; // xmm0_8
__int64 v15; // rax
struct cocos2d::CCSprite *v16; // r12
cocos2d::CCSprite_vtbl *v17; // rbx
const cocos2d::CCPoint *v18; // rax
void **v19; // rdx
char *v20; // rax
double v21; // xmm0_8
__int64 v22; // rax
struct cocos2d::CCSprite *v23; // rdi
__int64 v24; // rax
void *v25; // rcx
ObjectToolbox *v26; // rax
_QWORD *v27; // rax
size_t v28; // rdi
size_t v29; // r8
void **v30; // rdx
char *v31; // rax
size_t v32; // r8
double v33; // xmm0_8
__int64 v34; // rax
struct cocos2d::CCSprite *v35; // r12
cocos2d::CCSprite_vtbl *v36; // rbx
const cocos2d::CCPoint *v37; // rax
void **v38; // rdx
char *v39; // rax
double v40; // xmm0_8
__int64 v41; // rax
struct cocos2d::CCSprite *v42; // rdi
__int64 v43; // rax
ObjectToolbox *v44; // rax
_QWORD *v45; // rax
size_t v46; // rdi
size_t v47; // r8
void **v48; // rdx
char *v49; // rax
double v50; // xmm0_8
__int64 v51; // rax
struct cocos2d::CCSprite *v52; // rdi
cocos2d::CCSprite_vtbl *v53; // rbx
const cocos2d::CCPoint *v54; // rax
int v55; // [rsp+20h] [rbp-A9h] BYREF
__int128 *v56; // [rsp+28h] [rbp-A1h] BYREF
__int128 *v57; // [rsp+30h] [rbp-99h]
float v58; // [rsp+38h] [rbp-91h]
__int128 v59; // [rsp+40h] [rbp-89h] BYREF
__int64 v60; // [rsp+50h] [rbp-79h]
__int64 v61; // [rsp+58h] [rbp-71h]
cocos2d::CCPoint v62; // [rsp+60h] [rbp-69h] BYREF
__int128 v63; // [rsp+68h] [rbp-61h] BYREF
__int64 v64; // [rsp+78h] [rbp-51h]
__int64 v65; // [rsp+80h] [rbp-49h]
cocos2d::CCPoint v66; // [rsp+88h] [rbp-41h] BYREF
void *Block[2]; // [rsp+90h] [rbp-39h] BYREF
__int128 v68; // [rsp+A0h] [rbp-29h]
char v69[32]; // [rsp+B0h] [rbp-19h] BYREF
char v70[32]; // [rsp+D0h] [rbp+7h] BYREF
m_objectID = a2->m_objectID;
if ( m_objectID <= 660 )
{
if ( m_objectID != 660 )
{
switch ( m_objectID )
{
case 10:
case 11:
goto LABEL_14;
case 12:
case 13:
case 47:
case 111:
break;
case 84:
goto LABEL_9;
default:
return 0;
}
}
LABEL_35:
if ( a1->m_portalIndicators )
{
cocos2d::CCPoint::CCPoint(v2, 17.0);
v55 = m_objectID;
v26 = ObjectToolbox::sharedState();
v27 = (_QWORD *)sub_1401D0660((__int64 *)&v26->m_allKeys, &v55);
if ( v27[3] > 0xFu )
v27 = (_QWORD *)*v27;
*(_OWORD *)Block = 0;
v68 = 0;
v28 = -1;
v29 = -1;
do
++v29;
while ( *((_BYTE *)v27 + v29) );
sub_14003A930(Block, v27, v29);
v57 = &v59;
v30 = Block;
if ( *((_QWORD *)&v68 + 1) > 0xFu )
v30 = (void **)Block[0];
v31 = sub_140049190(v69, v30, "front", "extra");
if ( *((_QWORD *)v31 + 3) > 0xFu )
v31 = *(char **)v31;
v59 = 0;
v60 = 0;
v61 = 0;
v32 = -1;
do
++v32;
while ( v31[v32] );
sub_14003A930(&v59, v31, v32);
v33 = cocos2d::CCPoint::CCPoint(&v62);
v35 = GameObject::addCustomChild((__int64)a2, (const char *)&v59, v34, 0x64u);
sub_14003A830((__int64)v69);
v36 = v35->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v33, (float)(a2->m_obRect.size.width * 0.5) + v58);
v36->setPosition_0(v35, v37);
v35->setTag(v35, 91);
v57 = &v63;
v38 = Block;
if ( *((_QWORD *)&v68 + 1) > 0xFu )
v38 = (void **)Block[0];
v39 = sub_140049190(v70, v38, "front", "extra_2");
if ( *((_QWORD *)v39 + 3) > 0xFu )
v39 = *(char **)v39;
v63 = 0;
v64 = 0;
v65 = 0;
do
++v28;
while ( v39[v28] );
sub_14003A930(&v63, v39, v28);
v40 = cocos2d::CCPoint::CCPoint(&v66);
v42 = GameObject::addCustomChild((__int64)a2, (const char *)&v63, v41, 0x65u);
sub_14003A830((__int64)v70);
cocos2d::CCPoint::CCPoint(*(float *)&v40, -2.0);
v43 = (__int64)v35->getPosition_0(v35);
cocos2d::CCPoint::operator+(v43, &v56);
v42->setPosition_0(v42, (const cocos2d::CCPoint *)&v56);
cocos2d::CCArray::addObject(a1->m_indicatorSprites, v42);
if ( *((_QWORD *)&v68 + 1) <= 0xFu )
return 1;
v25 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v68 + 1) + 1LL) >= 0x1000 )
{
v25 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v25 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
goto LABEL_56;
}
return 0;
}
if ( m_objectID <= 1331 )
{
if ( m_objectID == 1331 || m_objectID == 745 )
goto LABEL_35;
if ( m_objectID != 1022 && m_objectID != 1330 )
return 0;
LABEL_9:
if ( a1->m_orbIndicators )
{
v55 = a2->m_objectID;
v44 = ObjectToolbox::sharedState();
v45 = (_QWORD *)sub_1401D0660((__int64 *)&v44->m_allKeys, &v55);
if ( v45[3] > 0xFu )
v45 = (_QWORD *)*v45;
*(_OWORD *)Block = 0;
v68 = 0;
v46 = -1;
v47 = -1;
do
++v47;
while ( *((_BYTE *)v45 + v47) );
sub_14003A930(Block, v45, v47);
v57 = &v59;
v48 = Block;
if ( *((_QWORD *)&v68 + 1) > 0xFu )
v48 = (void **)Block[0];
v49 = sub_140049190(v69, v48, "_001", "_extra_001");
if ( *((_QWORD *)v49 + 3) > 0xFu )
v49 = *(char **)v49;
v59 = 0;
v60 = 0;
v61 = 0;
do
++v46;
while ( v49[v46] );
sub_14003A930(&v59, v49, v46);
v50 = cocos2d::CCPoint::CCPoint(&v62);
v52 = GameObject::addCustomChild((__int64)a2, (const char *)&v59, v51, 0x64u);
sub_14003A830((__int64)v69);
v53 = v52->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v50, a2->m_obRect.size.width * 0.5);
v53->setPosition_0(v52, v54);
cocos2d::CCArray::addObject(a1->m_indicatorSprites, v52);
sub_14003A830((__int64)Block);
return 1;
}
return 0;
}
if ( m_objectID == 1333 )
goto LABEL_9;
if ( m_objectID == 1933 )
goto LABEL_35;
if ( m_objectID != 2926 )
return 0;
LABEL_14:
if ( !a1->m_portalIndicators )
return 0;
cocos2d::CCPoint::CCPoint(v2, 19.0);
v55 = m_objectID;
v7 = ObjectToolbox::sharedState();
v8 = (_QWORD *)sub_1401D0660((__int64 *)&v7->m_allKeys, &v55);
if ( v8[3] > 0xFu )
v8 = (_QWORD *)*v8;
*(_OWORD *)Block = 0;
v68 = 0;
v9 = -1;
v10 = -1;
do
++v10;
while ( *((_BYTE *)v8 + v10) );
sub_14003A930(Block, v8, v10);
v56 = &v63;
v11 = Block;
if ( *((_QWORD *)&v68 + 1) > 0xFu )
v11 = (void **)Block[0];
v12 = sub_140049190(v70, v11, "front", "extra");
if ( *((_QWORD *)v12 + 3) > 0xFu )
v12 = *(char **)v12;
v63 = 0;
v64 = 0;
v65 = 0;
v13 = -1;
do
++v13;
while ( v12[v13] );
sub_14003A930(&v63, v12, v13);
v14 = cocos2d::CCPoint::CCPoint(&v66);
v16 = GameObject::addCustomChild((__int64)a2, (const char *)&v63, v15, 0x64u);
sub_14003A830((__int64)v70);
v17 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v14, (float)(a2->m_obRect.size.width * 0.5) + v58);
v17->setPosition_0(v16, v18);
v16->setTag(v16, 91);
v56 = &v59;
v19 = Block;
if ( *((_QWORD *)&v68 + 1) > 0xFu )
v19 = (void **)Block[0];
v20 = sub_140049190(v69, v19, "front", "extra_2");
if ( *((_QWORD *)v20 + 3) > 0xFu )
v20 = *(char **)v20;
v59 = 0;
v60 = 0;
v61 = 0;
do
++v9;
while ( v20[v9] );
sub_14003A930(&v59, v20, v9);
v21 = cocos2d::CCPoint::CCPoint(&v62);
v23 = GameObject::addCustomChild((__int64)a2, (const char *)&v59, v22, 0x65u);
sub_14003A830((__int64)v69);
cocos2d::CCPoint::CCPoint(*(float *)&v21, -1.5);
v24 = (__int64)v16->getPosition_0(v16);
cocos2d::CCPoint::operator+(v24, &v56);
v23->setPosition_0(v23, (const cocos2d::CCPoint *)&v56);
cocos2d::CCArray::addObject(a1->m_indicatorSprites, v23);
if ( *((_QWORD *)&v68 + 1) <= 0xFu )
return 1;
v25 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v68 + 1) + 1LL) >= 0x1000 )
{
v25 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v25 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
LABEL_56:
j_j_free(v25);
return 1;
}