//
// TouchControlEditLayer::buildNodes from 0xd064dc to 0xd068c0 (996 bytes)
//
// 4 xrefs:
// > TouchControlEditLayer::init @ 0xd06978
// > TouchControlEditLayer::reloadNodes @ 0xd06e20
// > TouchControlEditLayer::valueDidChange @ 0xd07430
// > ??> @ 0x93970
//
// 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:06:56 +0000
//
__int64 __fastcall TouchControlEditLayer::buildNodes(TouchControlEditLayer *this)
{
cocos2d::CCDirector *v2; // x0
int v3; // w19
__int64 v4; // x23
__int64 v5; // x21
signed int v6; // w19
__int64 v7; // x0
int v8; // w20
__int64 v9; // x1
int v10; // w24
__int64 v11; // kr00_8
char *v12; // x26
int v13; // w9
int v14; // w10
char v15; // w8
int v16; // w6
char v17; // w7
char v18; // w5
char v19; // w1
char *v20; // x0
char **v21; // x0
char *v22; // x1
int v23; // w19
__int64 *v24; // x0
__int64 *v25; // x0
__int64 v26; // x0
float v28; // s8
void (__fastcall *v29)(char *, char *); // x24
float v30; // s0
char *v31; // x20
float v32; // s8
float v33; // s0
__int64 v34; // [xsp+98h] [xbp+98h]
int v35; // [xsp+ACh] [xbp+ACh]
__int64 v36; // [xsp+B8h] [xbp+B8h] BYREF
char *v37; // [xsp+C0h] [xbp+C0h] BYREF
char v38[8]; // [xsp+C8h] [xbp+C8h] BYREF
_DWORD v39[4]; // [xsp+D0h] [xbp+D0h]
__int64 v40; // [xsp+E0h] [xbp+E0h] BYREF
int v41; // [xsp+E8h] [xbp+E8h]
int v42; // [xsp+ECh] [xbp+ECh]
int v43; // [xsp+F0h] [xbp+F0h]
int v44; // [xsp+F4h] [xbp+F4h]
char v45; // [xsp+F8h] [xbp+F8h]
char v46; // [xsp+F9h] [xbp+F9h]
int v47; // [xsp+FCh] [xbp+FCh] BYREF
char v48; // [xsp+104h] [xbp+104h]
char v49; // [xsp+105h] [xbp+105h]
char v50; // [xsp+106h] [xbp+106h]
v2 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v36, v2);
if ( *((_BYTE *)this + 1012) )
{
v39[1] = 2;
v3 = 1;
v39[3] = 4;
v39[2] = 3;
v35 = 4;
}
else
{
v3 = 0;
v35 = 1;
}
v4 = 0;
v5 = 0;
v39[0] = v3;
v6 = 0;
do
{
v7 = *((_QWORD *)this + 127);
v8 = v39[v5];
if ( v7 && (v9 = *(_QWORD *)(v7 + 152), v6 < (int)(-286331153 * ((*(_QWORD *)(v7 + 160) - v9) >> 2))) )
{
v10 = 0;
LevelControlConfig::resolveSlot(v7, v9 + v4, (float *)&v36, (__int64)&v40);
}
else
{
v10 = 1;
v34 = TouchControlEditLayer::globalDpad(this, v8);
v40 = *(_QWORD *)v34;
v41 = *(_DWORD *)(v34 + 8);
v42 = *(_DWORD *)(v34 + 12);
v43 = *(_DWORD *)(v34 + 16);
v44 = *(_DWORD *)(v34 + 20);
v45 = *(_BYTE *)(v34 + 24);
v46 = *(_BYTE *)(v34 + 25);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v47, (const cocos2d::CCPoint *)(v34 + 28));
v48 = *(_BYTE *)(v34 + 36);
v49 = *(_BYTE *)(v34 + 37);
v50 = *(_BYTE *)(v34 + 38);
}
v11 = v40;
v12 = (char *)this + 40 * v8;
v13 = v43;
v14 = v42;
v15 = v45;
v16 = v44;
*((_DWORD *)v12 + 258) = v41;
v17 = v46;
*((_QWORD *)v12 + 128) = v11;
++v6;
*((_DWORD *)v12 + 260) = v13;
v12[1048] = v15;
v12[1049] = v17;
*((_DWORD *)v12 + 259) = v14;
*((_DWORD *)v12 + 261) = v16;
cocos2d::CCPoint::operator=(v12 + 1052, &v47);
v18 = v49;
v19 = v50;
v12[1060] = v48;
v12[1061] = v18;
v12[1062] = v19;
v20 = (char *)GJUINode::create((__int64)&v40);
v37 = v20;
v20[380] = 1;
(*(void (__fastcall **)(char *, _QWORD))(*(_QWORD *)v20 + 72LL))(v20, (unsigned int)v6);
if ( v10 && *((_BYTE *)this + 1012) && ((v8 - 2) & 0xFFFFFFFD) == 0 )
{
v28 = *(float *)&v36;
v29 = *(void (__fastcall **)(char *, char *))(*(_QWORD *)v37 + 184LL);
v30 = (*(float (__fastcall **)(char *))(*(_QWORD *)v37 + 224LL))(v37);
v31 = v37;
v32 = v28 - v30;
v33 = (*(float (__fastcall **)(char *))(*(_QWORD *)v37 + 240LL))(v37);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v32, v33);
v29(v31, v38);
}
(*(void (__fastcall **)(TouchControlEditLayer *, char *, __int64))(*(_QWORD *)this + 464LL))(this, v37, 100);
v21 = *((char ***)this + 154);
if ( *((char ***)this + 155) == v21 )
{
std::vector::__push_back_slow_path((__int64)this + 1224, &v37);
}
else
{
v22 = v37;
if ( v21 )
{
*v21 = v37;
v21 = *((char ***)this + 154);
}
*((_QWORD *)this + 154) = v21 + 1;
}
++v5;
v4 += 60;
}
while ( v6 != v35 );
v23 = 4;
do
{
v40 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"warpBtn_02_001.png", v22);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v40 + 160LL))(v40, 0.7);
(*(void (__fastcall **)(TouchControlEditLayer *, __int64, __int64))(*(_QWORD *)this + 464LL))(this, v40, 110);
v24 = *((__int64 **)this + 158);
if ( v24 == *((__int64 **)this + 159) )
{
std::vector::__push_back_slow_path((__int64)this + 1256, &v40);
}
else
{
v22 = (char *)v40;
if ( v24 )
{
*v24 = v40;
v24 = *((__int64 **)this + 158);
}
*((_QWORD *)this + 158) = v24 + 1;
}
--v23;
}
while ( v23 );
v25 = *((__int64 **)this + 153);
if ( v25 == *((__int64 **)this + 154) )
v26 = 0;
else
v26 = *v25;
*((_QWORD *)this + 156) = v26;
return _stack_chk_guard;
}