//
// cocos2d::CCParticleSystemQuad::initTexCoordsWithRect from 0x1002f094c to 0x1002f0ab8 (364 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0x1002f0b28
// > cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x1002f1180
//
// 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 11:02:55 +0000
//
__int64 __fastcall cocos2d::CCParticleSystemQuad::initTexCoordsWithRect(__int64 a1, float *a2)
{
float v4; // s1
float v5; // s0
float v6; // s8
__int64 v7; // x0
float v8; // s8
float v9; // s9
__int64 v10; // x0
float v11; // s9
float v12; // s10
__int64 v13; // x0
float v14; // s10
float v15; // s11
__int64 v16; // x0
float v17; // s0
__int64 v18; // x0
unsigned int v19; // w20
float32x2_t v20; // d8
float32x2_t v21; // d9
float32x2_t v22; // d10
__int64 v23; // x8
__int64 result; // x0
unsigned int v25; // w9
float32x2_t v26; // d0
float32x2_t v27; // d1
unsigned __int64 v28; // x9
__int64 v29; // x8
float32x2_t v30[2]; // [xsp+0h] [xbp-40h] BYREF
sub_1000264EC((_QWORD *)(a1 + 812), (__int64)a2);
v4 = a2[3];
v5 = 1.0;
if ( v4 > 0.0 )
v5 = a2[2] / v4;
*(float *)(a1 + 828) = v5;
v6 = *a2;
v7 = cocos2d::CCDirector::sharedDirector();
v8 = v6 * sub_100207B64(v7);
v9 = a2[1];
v10 = cocos2d::CCDirector::sharedDirector();
v11 = v9 * sub_100207B64(v10);
v12 = a2[2];
v13 = cocos2d::CCDirector::sharedDirector();
v14 = v12 * sub_100207B64(v13);
v15 = a2[3];
v16 = cocos2d::CCDirector::sharedDirector();
v17 = sub_100207B64(v16);
sub_1000262CC((float *)v30, v8, v11, v14, v15 * v17);
v18 = *(_QWORD *)(a1 + 664);
if ( v18 )
{
v19 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v18 + 88LL))(v18);
v20 = vcvt_f32_u32((uint32x2_t)__PAIR64__(
(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 664) + 96LL))(*(_QWORD *)(a1 + 664)),
v19));
}
else
{
v20 = *(float32x2_t *)(a2 + 2);
}
v21 = v30[0];
v22 = v30[1];
v23 = *(_QWORD *)(a1 + 432);
if ( v23 )
{
result = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v23 + 328) + 112LL))(*(_QWORD *)(v23 + 328));
LODWORD(v23) = *(_DWORD *)(a1 + 440);
v25 = *(_DWORD *)(a1 + 660) + v23;
}
else
{
result = *(_QWORD *)(a1 + 784);
v25 = *(_DWORD *)(a1 + 660);
}
if ( (unsigned int)v23 < v25 )
{
v26 = vdiv_f32(v21, v20);
v27 = vadd_f32(v26, vdiv_f32(v22, v20));
v28 = v25 - (unsigned __int64)(unsigned int)v23;
v29 = result + 96LL * (unsigned int)v23 + 44;
do
{
*(_DWORD *)(v29 - 4) = v26.i32[0];
*(_DWORD *)v29 = v27.i32[1];
*(float32x2_t *)(v29 + 44) = v27;
*(float32x2_t *)(v29 - 28) = v26;
*(_DWORD *)(v29 + 20) = v27.i32[0];
*(_DWORD *)(v29 + 24) = v26.i32[1];
v29 += 96;
--v28;
}
while ( v28 );
}
return result;
}