//
// cocos2d::CCFlipX3D::update from 0x18002d250 to 0x18002d577 (807 bytes)
//
// 3 xrefs:
// > ??> @ 0x1800e88f8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801afdc0
//
// 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::CCFlipX3D::update(cocos2d::CCFlipX3D *this, float a2)
{
float v3; // xmm9_4
float v4; // xmm10_4
const struct cocos2d::CCPoint *v5; // rax
struct cocos2d::_ccVertex3F *v6; // rax
__int64 v7; // xmm8_8
const struct cocos2d::CCPoint *v8; // rax
float x; // xmm7_4
float *v10; // rdx
float *v11; // rax
float *v12; // rax
float *v13; // rax
float *v14; // rax
float *v15; // rax
float *v16; // rax
GLfloat v17; // xmm7_4
float v18; // xmm6_4
struct cocos2d::_ccVertex3F *v19; // rax
struct cocos2d::_ccVertex3F *v20; // rax
struct cocos2d::_ccVertex3F *v21; // rax
float v22; // ecx
struct cocos2d::_ccVertex3F *v23; // rax
float v24; // edx
__int64 v25; // [rsp+28h] [rbp-59h] BYREF
GLfloat z; // [rsp+30h] [rbp-51h]
cocos2d::CCSize v27; // [rsp+38h] [rbp-49h] BYREF
cocos2d::CCSize v28; // [rsp+40h] [rbp-41h] BYREF
cocos2d::CCSize v29; // [rsp+48h] [rbp-39h] BYREF
cocos2d::CCSize v30; // [rsp+50h] [rbp-31h] BYREF
struct cocos2d::_ccVertex3F v31; // [rsp+58h] [rbp-29h] BYREF
struct cocos2d::_ccVertex3F v32; // [rsp+68h] [rbp-19h] BYREF
v3 = sinf(a2 * 3.1415927);
v4 = cosf((float)(a2 * 3.1415927) * 0.5);
v5 = (const struct cocos2d::CCPoint *)kmVec2Fill((float *)&v25, 1.0, 1.0);
v6 = cocos2d::CCGrid3DAction::originalVertex(this, &v32, v5);
v7 = *(_QWORD *)&v6->x;
z = v6->z;
v8 = (const struct cocos2d::CCPoint *)kmVec2Fill((float *)&v25, 0.0, 0.0);
x = cocos2d::CCGrid3DAction::originalVertex(this, &v32, v8)->x;
cocos2d::CCSize::CCSize(&v27);
cocos2d::CCSize::CCSize(&v28);
cocos2d::CCSize::CCSize(&v29);
cocos2d::CCSize::CCSize(&v30);
v25 = v7;
v10 = kmVec2Fill((float *)&v25, 0.0, 0.0);
if ( *(float *)&v7 <= x )
{
cocos2d::CCSize::operator=(&v29, v10);
v14 = kmVec2Fill((float *)&v25, 0.0, 1.0);
cocos2d::CCSize::operator=(&v30, v14);
v15 = kmVec2Fill((float *)&v25, 1.0, 0.0);
cocos2d::CCSize::operator=(&v27, v15);
v16 = kmVec2Fill((float *)&v25, 1.0, 1.0);
cocos2d::CCSize::operator=(&v28, v16);
*(float *)&v7 = x;
}
else
{
cocos2d::CCSize::operator=(&v27, v10);
v11 = kmVec2Fill((float *)&v25, 0.0, 1.0);
cocos2d::CCSize::operator=(&v28, v11);
v12 = kmVec2Fill((float *)&v25, 1.0, 0.0);
cocos2d::CCSize::operator=(&v29, v12);
v13 = kmVec2Fill((float *)&v25, 1.0, 1.0);
cocos2d::CCSize::operator=(&v30, v13);
}
v17 = *(float *)&v7 - (float)(*(float *)&v7 * v4);
v18 = fabs(floorf((float)(*(float *)&v7 * v3) * 0.25));
v19 = cocos2d::CCGrid3DAction::originalVertex(this, &v32, (const struct cocos2d::CCPoint *)&v27);
*(_QWORD *)&v31.x = *(_QWORD *)&v19->x;
*(GLfloat *)&v19 = v19->z;
v31.x = v17;
v31.z = *(float *)&v19 + v18;
cocos2d::CCGrid3DAction::setVertex(this, (const struct cocos2d::CCPoint *)&v27, &v31);
v20 = cocos2d::CCGrid3DAction::originalVertex(this, &v32, (const struct cocos2d::CCPoint *)&v28);
*(_QWORD *)&v31.x = *(_QWORD *)&v20->x;
*(GLfloat *)&v20 = v20->z;
v31.x = v17;
v31.z = *(float *)&v20 + v18;
cocos2d::CCGrid3DAction::setVertex(this, (const struct cocos2d::CCPoint *)&v28, &v31);
v21 = cocos2d::CCGrid3DAction::originalVertex(this, &v32, (const struct cocos2d::CCPoint *)&v29);
*(_QWORD *)&v31.x = *(_QWORD *)&v21->x;
v22 = v21->z;
v31.x = v31.x - v17;
v31.z = v22 - v18;
cocos2d::CCGrid3DAction::setVertex(this, (const struct cocos2d::CCPoint *)&v29, &v31);
v23 = cocos2d::CCGrid3DAction::originalVertex(this, &v32, (const struct cocos2d::CCPoint *)&v30);
*(_QWORD *)&v31.x = *(_QWORD *)&v23->x;
v24 = v23->z;
v31.x = v31.x - v17;
v31.z = v24 - v18;
cocos2d::CCGrid3DAction::setVertex(this, (const struct cocos2d::CCPoint *)&v30, &v31);
}