//
// GJBaseGameLayer::positionUIObjects from 0x9cca1c to 0x9ccf6c (1360 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateSpecialGroupData @ 0x9f3c90
// > ??> @ 0xcd378
//
// 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 12:58:37 +0000
//
__int64 __fastcall GJBaseGameLayer::positionUIObjects(GJBaseGameLayer *this)
{
cocos2d::CCDirector *v2; // x0
cocos2d::CCArray *v3; // x0
__int64 v4; // kr00_8
__int64 v5; // x0
__int64 v6; // x24
cocos2d::CCArray *v7; // x21
unsigned int *v8; // x25
__int64 *v9; // x27
__int64 v10; // x4
char *v11; // x26
float v12; // s13
__int64 *v13; // x28
float v14; // s12
__int64 v15; // x27
cocos2d::CCObject *GroupParent; // x22
__int64 MainObject; // x0
__int64 v19; // x5
cocos2d::CCArray *v20; // x24
unsigned int *v21; // x0
GameObject **v22; // x23
__int64 v23; // x24
char *v24; // x1
GameObject **v25; // x24
GameObject *v26; // x23
unsigned __int64 v27; // x22
unsigned int v28; // w1
int v29; // w0
long double v30; // q0
unsigned int *v31; // x0
GameObject **v32; // x2
GameObject **v33; // x5
GameObject *v34; // x20
GameObject **v35; // x23
float v36; // s0
float v37; // s0
float v38; // s0
float v39; // s1
float v40; // s0
float v41; // s1
float v42; // s1
float v43; // s0
GameObject **v44; // [xsp+98h] [xbp+98h]
void (__fastcall *v45)(GameObject *, __int64 *); // [xsp+A0h] [xbp+A0h]
cocos2d::CCObject *v46; // [xsp+B0h] [xbp+B0h]
GJBaseGameLayer *v47; // [xsp+D8h] [xbp+D8h]
GJBaseGameLayer *v48; // [xsp+D8h] [xbp+D8h]
GJBaseGameLayer *v49; // [xsp+D8h] [xbp+D8h]
cocos2d::CCObject *Group; // [xsp+E8h] [xbp+E8h]
__int64 v51; // [xsp+F8h] [xbp+F8h] BYREF
char v52[8]; // [xsp+100h] [xbp+100h] BYREF
float v53; // [xsp+108h] [xbp+108h]
float v54; // [xsp+10Ch] [xbp+10Ch]
float v55; // [xsp+110h] [xbp+110h] BYREF
float v56; // [xsp+114h] [xbp+114h]
float v57; // [xsp+118h] [xbp+118h] BYREF
float v58; // [xsp+11Ch] [xbp+11Ch]
__int64 v59; // [xsp+120h] [xbp+120h] BYREF
char v60[8]; // [xsp+128h] [xbp+128h] BYREF
__int64 v61; // [xsp+130h] [xbp+130h] BYREF
v2 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v51, v2);
v3 = (cocos2d::CCArray *)cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v52,
*(float *)&v51 * 0.5,
*((float *)&v51 + 1) * 0.5);
v4 = v51;
v5 = cocos2d::CCArray::create(v3);
v6 = *((_QWORD *)this + 410);
v7 = (cocos2d::CCArray *)v5;
if ( v6 )
{
v8 = *(unsigned int **)(v6 + 56);
if ( *v8 )
{
v9 = *((__int64 **)v8 + 2);
v10 = 8LL * *v8 - 8;
v11 = (char *)v9 + v10;
if ( v9 <= (__int64 *)((char *)v9 + v10) )
{
if ( *v9 )
{
v12 = (float)(*(float *)&v4 * 0.5) / 240.0;
v13 = *((__int64 **)v8 + 2);
v14 = (float)(*((float *)&v4 + 1) * 0.5) / 160.0;
v15 = *v9;
while ( 1 )
{
if ( *(_DWORD *)(v15 + 1028) == 3613 )
{
Group = GJBaseGameLayer::getGroup(this, *(_DWORD *)(v15 + 1464));
GroupParent = (cocos2d::CCObject *)GJBaseGameLayer::getGroupParent(
(cocos2d::CCDictionary **)this,
*(_DWORD *)(v15 + 1464));
MainObject = GJBaseGameLayer::tryGetMainObject((cocos2d::CCDictionary **)this, *(_DWORD *)(v15 + 1468));
v19 = MainObject;
if ( GroupParent )
{
v47 = (GJBaseGameLayer *)MainObject;
v20 = v7;
cocos2d::CCArray::removeAllObjects(v7);
cocos2d::CCArray::addObject(v7, GroupParent);
v19 = (__int64)v47;
}
else
{
v20 = Group;
}
if ( v20 )
{
if ( v19 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 1816LL))(v19);
v21 = *((unsigned int **)v20 + 7);
if ( *v21 )
{
v22 = *((GameObject ***)v21 + 2);
v23 = 8LL * *v21 - 8;
v24 = (char *)v22 + v23;
if ( v22 <= (GameObject **)((char *)v22 + v23) )
{
if ( *v22 )
{
v25 = *((GameObject ***)v21 + 2);
v26 = *v22;
v46 = GroupParent;
v27 = (unsigned __int64)v24;
if ( !*((_BYTE *)v26 + 1345) )
goto LABEL_21;
while ( v27 >= (unsigned __int64)++v25 )
{
v26 = *v25;
if ( !*v25 )
break;
if ( !*((_BYTE *)v26 + 1345) )
{
LABEL_21:
GJBaseGameLayer::addUIObject((cocos2d::CCArray **)this, v26);
(*(void (__fastcall **)(GameObject *))(*(_QWORD *)v26 + 1816LL))(v26);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v57, (const cocos2d::CCPoint *)&v55);
v28 = *(_DWORD *)(v15 + 1840);
v29 = *(_DWORD *)(v15 + 1844);
if ( v28 <= 1 )
{
v38 = v55;
v39 = v53;
if ( v55 >= v53 )
{
if ( !v29 || v29 == 5 )
{
if ( v56 >= v54 )
v29 = 8;
else
v29 = 7;
goto LABEL_69;
}
LABEL_70:
v42 = v38 - (float)(v39 + 240.0);
if ( *(_BYTE *)(v15 + 1848) )
v42 = v42 * v12;
v40 = *(float *)&v51 + v42;
}
else
{
if ( !v29 || v29 == 5 )
{
if ( v56 >= v54 )
v29 = 8;
else
v29 = 7;
goto LABEL_63;
}
LABEL_54:
v40 = v38 - (float)(v39 - 240.0);
if ( *(_BYTE *)(v15 + 1848) )
v40 = v40 * v12;
}
v57 = v40;
goto LABEL_27;
}
if ( !v29 || v29 == 5 )
{
if ( v56 >= v54 )
v29 = 8;
else
v29 = 7;
}
if ( v28 != 2 )
{
if ( v28 != 3 )
{
if ( v28 != 4 )
goto LABEL_27;
LABEL_69:
v38 = v55;
v39 = v53;
goto LABEL_70;
}
LABEL_63:
v38 = v55;
v39 = v53;
goto LABEL_54;
}
v36 = v55 - v53;
if ( *(_BYTE *)(v15 + 1848) )
v36 = v36 * v12;
v57 = v36 + (float)(*(float *)&v4 * 0.5);
LABEL_27:
if ( v29 == 6 )
{
v37 = v56 - v54;
if ( *(_BYTE *)(v15 + 1849) )
v37 = v37 * v14;
v58 = v37 + (float)(*((float *)&v4 + 1) * 0.5);
}
else
{
if ( v29 == 7 )
{
v41 = v56 - (float)(v54 - 160.0);
if ( *(_BYTE *)(v15 + 1849) )
v41 = v41 * v14;
}
else
{
if ( v29 != 8 )
goto LABEL_30;
v43 = v56 - (float)(v54 + 160.0);
if ( *(_BYTE *)(v15 + 1849) )
v43 = v43 * v14;
v41 = *((float *)&v51 + 1) + v43;
}
v58 = v41;
}
LABEL_30:
v48 = *(GJBaseGameLayer **)(*(_QWORD *)v26 + 1368LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v61, (const cocos2d::CCPoint *)&v57);
((void (__fastcall *)(GameObject *, __int64 *))v48)(v26, &v61);
if ( v26 == v46 )
{
if ( Group )
{
cocos2d::CCPoint::operator-(&v59, &v57, &v55, v30);
v31 = *((unsigned int **)Group + 7);
if ( *v31 )
{
v32 = *((GameObject ***)v31 + 2);
v33 = &v32[*v31 - 1];
if ( v32 <= v33 )
{
if ( *v32 )
{
v49 = this;
v34 = *v32;
v35 = *((GameObject ***)v31 + 2);
do
{
if ( !*((_BYTE *)v34 + 1345) )
{
v44 = v33;
GJBaseGameLayer::addUIObject((cocos2d::CCArray **)v49, v34);
v45 = *(void (__fastcall **)(GameObject *, __int64 *))(*(_QWORD *)v34 + 1368LL);
(*(void (__fastcall **)(GameObject *))(*(_QWORD *)v34 + 1816LL))(v34);
cocos2d::CCPoint::operator+(&v61, v60);
v45(v34, &v61);
v33 = v44;
}
if ( v33 < ++v35 )
break;
v34 = *v35;
}
while ( *v35 );
this = v49;
}
}
}
}
}
}
}
}
}
}
}
}
}
if ( v11 >= (char *)++v13 )
{
v15 = *v13;
if ( *v13 )
continue;
}
return _stack_chk_guard;
}
}
}
}
}
return _stack_chk_guard;
}