//
// cocos2d::ccDrawQuadBezier from 0x180011860 to 0x180011ac3 (611 bytes)
//
// 4 xrefs:
// > ??> @ 0x180132668
// > ??> @ 0x1801326b4
// > ??> @ 0x1801438a8
// > ??> @ 0x1801ae2e4
//
// 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::ccDrawQuadBezier(
cocos2d *this,
const struct cocos2d::CCPoint *a2,
const struct cocos2d::CCPoint *a3,
const struct cocos2d::CCPoint *a4)
{
unsigned int v7; // esi
GLsizei v8; // r13d
_DWORD *v9; // rax
_DWORD *v10; // rbx
float v11; // xmm9_4
__int64 v12; // rdi
__int64 v13; // rbp
float v14; // xmm0_4
float *v15; // rsi
float v16; // xmm10_4
float v17; // xmm7_4
float v18; // xmm8_4
float v19; // xmm0_4
cocos2d::CCGLProgram *v20; // rcx
unsigned int v21; // edx
v7 = (unsigned int)a4;
cocos2d::ccDrawInit(this);
v8 = v7 + 1;
v9 = operator new(saturated_mul(v7 + 1, 8u));
v10 = v9;
v11 = 0.0;
v12 = v7;
if ( v7 )
{
v13 = v7;
v14 = (float)(int)v7;
v15 = (float *)v9;
v16 = 1.0 / v14;
do
{
v17 = v11 * v11;
v18 = (float)((float)(1.0 - v11) + (float)(1.0 - v11)) * v11;
*v15 = (float)((float)(powf(1.0 - v11, 2.0) * *(float *)this) + (float)(v18 * a2->x))
+ (float)((float)(v11 * v11) * a3->x);
v19 = powf(1.0 - v11, 2.0);
v11 = v11 + v16;
v15[1] = (float)((float)(v19 * *((float *)this + 1)) + (float)(v18 * a2->y)) + (float)(v17 * a3->y);
v15 += 2;
--v13;
}
while ( v13 );
}
v20 = (cocos2d::CCGLProgram *)qword_1801A8338;
v10[2 * v12] = LODWORD(a3->x);
v10[2 * v12 + 1] = LODWORD(a3->y);
cocos2d::CCGLProgram::use(v20);
cocos2d::CCGLProgram::setUniformsForBuiltins((cocos2d::CCGLProgram *)qword_1801A8338);
cocos2d::CCGLProgram::setUniformLocationWith4fv(
(cocos2d::CCGLProgram *)qword_1801A8338,
dword_1801A2B58,
&flt_1801A2B60,
1u);
cocos2d::ccGLEnableVertexAttribs((cocos2d *)1, v21);
_glewVertexAttribPointer(0, 2, 5126);
glDrawArrays(3u, 0, v8);
if ( v10 )
j_j_free_0(v10);
++g_uNumberOfDraws;
}