//
// cocos2d::CCShuffleTiles::startWithTarget from 0xd3a8c8 to 0xd3aaa8 (480 bytes)
//
// 2 xrefs:
// > ??> @ 0x48dd8
// > ??> @ 0x1514d78
//
// 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:07:25 +0000
//
__int64 __fastcall cocos2d::CCShuffleTiles::startWithTarget(cocos2d::CCShuffleTiles *this, cocos2d::CCNode *a2)
{
unsigned int v3; // w0
float v4; // s0
__int64 v5; // x0
unsigned int v6; // w2
unsigned int v7; // w3
unsigned int *v8; // x1
__int64 v9; // x23
__int64 v10; // x21
__int64 v11; // x20
__int64 v12; // x19
cocos2d::CCSize *v13; // x0
float v14; // s1
float v15; // s9
int v16; // w24
float v17; // s0
int v18; // w21
float v19; // s8
__int64 v20; // x0
_BYTE v22[8]; // [xsp+68h] [xbp+68h] BYREF
_BYTE v23[8]; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCGridAction::startWithTarget(this, a2);
v3 = *((_DWORD *)this + 25);
if ( v3 != -1 )
srand(v3);
v4 = *((float *)this + 23) * *((float *)this + 24);
*((_DWORD *)this + 26) = (unsigned int)v4;
v5 = operator new[](4LL * (unsigned int)v4);
*((_QWORD *)this + 14) = v5;
v6 = *((_DWORD *)this + 26);
if ( v6 )
{
v7 = 0;
while ( 1 )
{
*(_DWORD *)(v5 + 4LL * v7) = v7;
++v7;
v6 = *((_DWORD *)this + 26);
if ( v6 <= v7 )
break;
v5 = *((_QWORD *)this + 14);
}
v8 = *((unsigned int **)this + 14);
}
else
{
v8 = (unsigned int *)v5;
}
cocos2d::CCShuffleTiles::shuffle(this, v8, v6);
v9 = *((unsigned int *)this + 26);
v10 = v9 - 1;
v11 = operator new[](24 * v9);
v12 = v11;
if ( v9 )
{
do
{
--v10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v12 + 8));
v13 = (cocos2d::CCSize *)(v12 + 16);
v12 += 24;
cocos2d::CCSize::CCSize(v13);
}
while ( v10 != -1 );
}
v14 = *((float *)this + 23);
*((_QWORD *)this + 15) = v11;
if ( v14 > 0.0 )
{
v15 = 0.0;
v16 = 0;
v17 = *((float *)this + 24);
do
{
v18 = 0;
v19 = 0.0;
if ( v17 > 0.0 )
{
do
{
++v18;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, v15, v19);
cocos2d::CCPoint::operator=(v11, v23);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, v15, v19);
cocos2d::CCPoint::operator=(v11 + 8, v23);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v22, v15, v19);
cocos2d::CCShuffleTiles::getDelta(this, (const cocos2d::CCSize *)v22, (cocos2d::CCSize *)v23);
v20 = v11 + 16;
v11 += 24;
cocos2d::CCSize::operator=(v20, v23);
v19 = (float)v18;
v17 = *((float *)this + 24);
}
while ( (float)v18 < v17 );
v14 = *((float *)this + 23);
}
v15 = (float)++v16;
}
while ( (float)v16 < v14 );
}
return _stack_chk_guard;
}