//
// cocos2d::CCPointArray::copyWithZone from 0xab5cc4 to 0xab5dec (296 bytes)
//
// 2 xrefs:
// > ??> @ 0x31560
// > ??> @ 0x11fb7c0
//
// 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
//
cocos2d::CCObject *cocos2d::CCPointArray::copyWithZone(cocos2d::CCPointArray *a1, cocos2d::CCZone *a2)
{
std::vector *v3; // x19
cocos2d::CCPointArray_vtbl *v4; // x0
void (__fastcall *copyWithZone)(cocos2d::CCPointArray *__hidden); // x20
cocos2d::CCPoint *v6; // x21
cocos2d::CCPoint **m_finish; // x0
cocos2d::CCPointArray *v8; // x20
float v10; // [xsp+40h] [xbp+40h]
float v11; // [xsp+50h] [xbp+50h]
cocos2d::CCPoint *v12; // [xsp+60h] [xbp+60h] BYREF
v3 = (std::vector *)operator new(0x18u);
v4 = a1[1].__vftable;
v3->m_start = nullptr;
v3->m_finish = nullptr;
v3->m_reserveEnd = nullptr;
copyWithZone = (void (__fastcall *)(cocos2d::CCPointArray *__hidden))v4->copyWithZone;
if ( v4->copyWithZone != (cocos2d::CCObject *(__fastcall *)(cocos2d::CCPointArray *__hidden, cocos2d::CCZone *))v4->~CCPointArray )
{
do
{
v10 = **(float **)copyWithZone;
v11 = *(float *)(*(_QWORD *)copyWithZone + 4LL);
v6 = (cocos2d::CCPoint *)operator new(8u);
cocos2d::CCPoint::CCPoint(v6, v10, v11);
v12 = v6;
m_finish = v3->m_finish;
if ( m_finish == v3->m_reserveEnd )
{
std::vector::_M_emplace_back_aux((__int64)v3, &v12);
}
else
{
if ( m_finish )
{
*m_finish = v6;
m_finish = v3->m_finish;
}
v3->m_finish = m_finish + 1;
}
copyWithZone = (void (__fastcall *)(cocos2d::CCPointArray *__hidden))((char *)copyWithZone + 8);
}
while ( a1[1].~CCPointArray != copyWithZone );
}
v8 = (cocos2d::CCPointArray *)operator new(0x40u);
cocos2d::CCPointArray::CCPointArray(v8);
cocos2d::CCPointArray::initWithCapacity(v8, 0xAu);
cocos2d::CCPointArray::setControlPoints(v8, v3);
return v8;
}