//
// cocos2d::CCTiledGrid3D::calculateVertexPoints from 0x180023360 to 0x18002366d (781 bytes)
//
// 6 xrefs:
// > ??> @ 0x1800ed350
// > ??> @ 0x18013cfdc
// > ??> @ 0x18013d010
// > ??> @ 0x18013d020
// > ??> @ 0x18014cf68
// > ??> @ 0x1801b90ac
//
// 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:29 +0000
//
void __fastcall cocos2d::CCTiledGrid3D::calculateVertexPoints(cocos2d::CCTiledGrid3D *this)
{
float v2; // xmm7_4
float v3; // xmm8_4
const struct cocos2d::CCSize *ContentSizeInPixels; // rax
int v5; // ebp
void *v6; // rcx
float v7; // xmm6_4
int v8; // r14d
void *v9; // rcx
void *v10; // rcx
void *v11; // rcx
__int64 v12; // rdi
char *v13; // rax
float v14; // xmm0_4
__int64 v15; // rcx
char *v16; // r9
int v17; // r8d
float *v18; // rax
float v19; // xmm9_4
int v20; // edx
float v21; // xmm1_4
float v22; // xmm4_4
float v23; // xmm5_4
float v24; // xmm0_4
float v25; // xmm2_4
float v26; // xmm3_4
float v27; // xmm4_4
float v28; // xmm2_4
float v29; // xmm5_4
float v30; // xmm3_4
char *v31; // r8
__int16 v32; // dx
v2 = (float)(*(int (__fastcall **)(_QWORD))(**((_QWORD **)this + 9) + 80LL))(*((_QWORD *)this + 9));
v3 = (float)(*(int (__fastcall **)(_QWORD))(**((_QWORD **)this + 9) + 88LL))(*((_QWORD *)this + 9));
ContentSizeInPixels = cocos2d::CCTexture2D::getContentSizeInPixels(*((cocos2d::CCTexture2D **)this + 9));
v5 = 0;
v6 = *((void **)this + 16);
v7 = *((float *)ContentSizeInPixels + 1);
v8 = (int)(float)(*((float *)this + 17) * *((float *)this + 16));
if ( v6 )
{
free(v6);
*((_QWORD *)this + 16) = 0;
}
v9 = *((void **)this + 17);
if ( v9 )
{
free(v9);
*((_QWORD *)this + 17) = 0;
}
v10 = *((void **)this + 15);
if ( v10 )
{
free(v10);
*((_QWORD *)this + 15) = 0;
}
v11 = *((void **)this + 18);
if ( v11 )
{
free(v11);
*((_QWORD *)this + 18) = 0;
}
v12 = 4 * v8;
*((_QWORD *)this + 16) = malloc(12 * v12);
*((_QWORD *)this + 17) = malloc(12 * v12);
*((_QWORD *)this + 15) = malloc(8 * v12);
v13 = (char *)malloc(12LL * v8);
v14 = *((float *)this + 16);
v15 = *((_QWORD *)this + 16);
v16 = v13;
v17 = 0;
*((_QWORD *)this + 18) = v13;
v18 = *((float **)this + 15);
if ( v14 > 0.0 )
{
v19 = 0.0;
do
{
v20 = 0;
if ( *((float *)this + 17) > 0.0 )
{
v21 = 0.0;
do
{
v22 = *((float *)this + 20) * v19;
v23 = v22 + *((float *)this + 20);
v24 = *((float *)this + 21);
*(float *)v15 = v22;
v25 = v24 * v21;
*(_DWORD *)(v15 + 8) = 0;
*(float *)(v15 + 24) = v22;
*(float *)(v15 + 12) = v23;
*(float *)(v15 + 4) = v24 * v21;
v26 = (float)(v24 * v21) + v24;
*(float *)(v15 + 16) = v24 * v21;
*(float *)(v15 + 36) = v23;
*(_DWORD *)(v15 + 20) = 0;
*(_DWORD *)(v15 + 32) = 0;
*(_DWORD *)(v15 + 44) = 0;
*(float *)(v15 + 28) = v26;
*(float *)(v15 + 40) = v26;
v15 += 48;
if ( *((_BYTE *)this + 96) )
{
v25 = v7 - v25;
v26 = v7 - v26;
}
v27 = v22 / v2;
++v20;
v28 = v25 / v3;
*v18 = v27;
v29 = v23 / v2;
v30 = v26 / v3;
v18[1] = v28;
v18[2] = v29;
v18[3] = v28;
v18[4] = v27;
v18[5] = v30;
v18[6] = v29;
v18[7] = v30;
v18 += 8;
v21 = (float)v20;
}
while ( *((float *)this + 17) > (float)v20 );
}
v19 = (float)++v17;
}
while ( *((float *)this + 16) > (float)v17 );
}
if ( v8 > 0 )
{
v31 = v16 + 4;
do
{
v31 += 12;
v32 = 4 * v5++;
*((_WORD *)v31 - 8) = v32;
*((_WORD *)v31 - 7) = v32 + 1;
*((_WORD *)v31 - 6) = v32 + 2;
*((_WORD *)v31 - 3) = v32 + 3;
*((_WORD *)v31 - 5) = v32 + 1;
*((_WORD *)v31 - 4) = v32 + 2;
}
while ( v5 < v8 );
}
memcpy(*((void **)this + 17), *((const void **)this + 16), 48LL * v8);
}