//
// cocos2d::CCTurnOffTiles::startWithTarget from 0x18003be40 to 0x18003beed (173 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800f06f0
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bb050
//
// This function is hookable on this platform (idp: pc, 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 11:21:37 +0000
//
void __fastcall cocos2d::CCTurnOffTiles::startWithTarget(cocos2d::CCTurnOffTiles *this, struct cocos2d::CCNode *a2)
{
unsigned int v3; // ecx
float v4; // xmm0_4
__int64 v5; // rax
unsigned int v6; // ebx
__int64 v7; // rdx
__int64 v8; // rsi
__int64 i; // rdi
int v10; // eax
int v11; // ecx
__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 = sub_1800E4C6C(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);
}
}