//
// cocos2d::CCDrawNode::ensureCapacity from 0xd4bcac to 0xd4bd00 (84 bytes)
//
// 5 xrefs:
// > cocos2d::CCDrawNode::init @ 0xd4bd50
// > sub_D4BE18 @ 0xd4be6c
// > cocos2d::CCDrawNode::drawDot @ 0xd4c5e4
// > cocos2d::CCDrawNode::drawPolygon @ 0xd4d3dc
// > ??> @ 0x102d30
//
// 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 13:07:38 +0000
//
_DWORD *__fastcall cocos2d::CCDrawNode::ensureCapacity(_DWORD *this, unsigned int a2)
{
unsigned int v2; // w2
_DWORD *v3; // x19
void *v4; // x0
__int64 v5; // x2
v2 = *(this + 87);
if ( a2 + *(this + 88) > v2 )
{
v3 = this;
if ( a2 < v2 )
a2 = *(this + 87);
v4 = *((void **)this + 45);
v5 = a2 + v2;
v3[87] = v5;
this = realloc(v4, 20 * v5);
*((_QWORD *)v3 + 45) = this;
}
return this;
}