//
// cocos2d::CCDrawNode::drawCubicBezier from 0x1800124d0 to 0x180012791 (705 bytes)
//
// 3 xrefs:
// > cocos2d::CCDrawNode::drawPreciseCubicBezier @ 0x180014276
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ae3b0
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCDrawNode::drawCubicBezier(
cocos2d::CCDrawNode *this,
const struct cocos2d::CCPoint *a2,
const struct cocos2d::CCPoint *a3,
const struct cocos2d::CCPoint *a4,
const struct cocos2d::CCPoint *a5,
signed int a6,
const struct cocos2d::_ccColor4F *a7,
float a8)
{
cocos2d::CCDrawNode *v8; // r12
unsigned int v9; // ebp
unsigned __int64 v10; // rbx
unsigned __int64 v11; // rax
cocos2d::CCSize *v12; // rax
struct cocos2d::CCPoint *v13; // r14
unsigned int v14; // edi
cocos2d::CCSize *v15; // rsi
float v16; // xmm10_4
float *v17; // r15
__int64 v18; // r13
float v19; // xmm9_4
float v20; // xmm8_4
float v21; // xmm6_4
const struct cocos2d::CCPoint *v22; // rdx
const struct cocos2d::CCPoint *v23; // rbx
v8 = this;
v9 = a6;
v10 = (unsigned int)(a6 + 1);
v11 = 8 * v10;
if ( !is_mul_ok(v10, 8u) )
v11 = -1;
v12 = (cocos2d::CCSize *)operator new(v11, (const struct std::nothrow_t *)&unk_180122909);
v13 = (struct cocos2d::CCPoint *)v12;
v14 = 0;
if ( v12 )
{
v15 = v12;
if ( a6 != -1 )
{
do
{
cocos2d::CCSize::CCSize(v15++);
--v10;
}
while ( v10 );
}
}
else
{
v13 = nullptr;
}
if ( v13 )
{
v16 = 0.0;
if ( a6 )
{
v17 = (float *)v13;
v18 = (unsigned int)a6;
do
{
v19 = (float)(powf(1.0 - v16, 2.0) * 3.0) * v16;
v20 = (float)((float)((float)(1.0 - v16) * 3.0) * v16) * v16;
v21 = (float)(v16 * v16) * v16;
*v17 = (float)((float)((float)(powf(1.0 - v16, 3.0) * a2->x) + (float)(v19 * a3->x)) + (float)(v20 * a4->x))
+ (float)(v21 * a5->x);
v17[1] = (float)((float)((float)(powf(1.0 - v16, 3.0) * a2->y) + (float)(v19 * a3->y)) + (float)(v20 * a4->y))
+ (float)(v21 * a5->y);
v16 = v16 + (float)(1.0 / (float)a6);
v17 += 2;
--v18;
}
while ( v18 );
v14 = 0;
v9 = a6;
v8 = this;
}
v13[a6] = *a5;
if ( v9 )
{
v22 = v13;
do
{
v23 = v22 + 1;
cocos2d::CCDrawNode::drawSegmentEx(v8, v22, v22 + 1, a8, a7, v14 == 0, v14 == v9 - 1);
++v14;
v22 = v23;
}
while ( v14 < v9 );
}
j_j_free_0(v13);
}
}