//
// cocos2d::CCSpriteBatchNode::draw from 0xd88510 to 0xd885f8 (232 bytes)
//
// 5 xrefs:
// > ??> @ 0x100000
// > ??> @ 0x14151f8
// > ??> @ 0x1518668
// > ??> @ 0x152ec28
// > ??> @ 0x1530c88
//
// 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:08:14 +0000
//
__int64 __fastcall cocos2d::CCSpriteBatchNode::draw(cocos2d::CCSpriteBatchNode *this)
{
__int64 result; // x0
cocos2d::CCGLProgram *v3; // x0
unsigned int v4; // w1
cocos2d::CCGLProgram *v5; // x0
__int64 v6; // x0
unsigned int *v7; // x1
__int64 *v8; // x20
__int64 *v9; // x21
__int64 v10; // x0
result = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 41) + 80LL))(*((_QWORD *)this + 41));
if ( (_DWORD)result )
{
cocos2d::ccGLEnable();
(*(void (__fastcall **)(cocos2d::CCSpriteBatchNode *))(*(_QWORD *)this + 656LL))(this);
v3 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(cocos2d::CCSpriteBatchNode *))(*(_QWORD *)this + 656LL))(this);
cocos2d::CCGLProgram::use(v3, v4);
v5 = (cocos2d::CCGLProgram *)(*(__int64 (__fastcall **)(cocos2d::CCSpriteBatchNode *))(*(_QWORD *)this + 656LL))(this);
cocos2d::CCGLProgram::setUniformsForBuiltins(v5);
v6 = *((_QWORD *)this + 26);
if ( v6 )
{
v7 = *(unsigned int **)(v6 + 56);
if ( *v7 )
{
v8 = *((__int64 **)v7 + 2);
v9 = &v8[*v7 - 1];
while ( v9 >= v8 )
{
v10 = *v8;
if ( !*v8 )
break;
++v8;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v10 + 792LL))(v10);
}
}
}
cocos2d::ccGLBlendFunc(*((unsigned int *)this + 84), *((_DWORD *)this + 85));
return cocos2d::CCTextureAtlas::drawQuads(*((cocos2d::CCTextureAtlas **)this + 41));
}
return result;
}