//
// cocos2d::CCTurnOffTiles::startWithTarget from 0x18003b710 to 0x18003b7bf (175 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800ea690
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b0f24
//
// 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
//
void __fastcall cocos2d::CCTurnOffTiles::startWithTarget(cocos2d::CCTurnOffTiles *this, struct cocos2d::CCNode *a2)
{
unsigned int v3; // ecx
float v4; // xmm0_4
void *v5; // rax
unsigned int v6; // ebx
__int64 v7; // rdx
__int64 v8; // rsi
__int64 i; // rdi
int v10; // eax
int v11; // r8d
__int64 v12; // rdx
cocos2d::CCGridAction::startWithTarget(this, a2);
v3 = *((_DWORD *)this + 26);
if ( v3 != -1 )
srand(v3);
v4 = *((float *)this + 25) * *((float *)this + 24);
*((_DWORD *)this + 27) = (int)v4;
v5 = operator new(saturated_mul((unsigned int)(int)v4, 4u));
v6 = *((_DWORD *)this + 27);
v7 = 0;
for ( *((_QWORD *)this + 14) = v5; (unsigned int)v7 < v6; v6 = *((_DWORD *)this + 27) )
{
*(_DWORD *)(*((_QWORD *)this + 14) + 4 * v7) = v7;
v7 = (unsigned int)(v7 + 1);
}
v8 = *((_QWORD *)this + 14);
for ( i = (int)(v6 - 1); i >= 0; *(_DWORD *)(v8 + 4 * v12) = v11 )
{
v10 = rand();
v11 = *(_DWORD *)(v8 + 4 * i);
v12 = (unsigned int)(v10 >> 31);
LODWORD(v12) = v10 % (int)v6--;
*(_DWORD *)(v8 + 4 * i--) = *(_DWORD *)(v8 + 4 * v12);
}
}