//
// cocos2d::CCRenderTexture::draw from 0x100467888 to 0x100467a14 (396 bytes)
//
// 1 xrefs:
// > ??> @ 0x10096adb8
//
// 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 11:05:33 +0000
//
__int64 __fastcall cocos2d::CCRenderTexture::draw(__int64 result)
{
__int64 v1; // x19
GLbitfield v2; // w0
int v3; // w8
__int64 v4; // x8
unsigned int *v5; // x9
__int64 v6; // x8
__int64 *v7; // x20
unsigned __int64 v8; // x21
__int64 v9; // x0
GLint s[2]; // [xsp+0h] [xbp-40h] BYREF
GLfloat params[2]; // [xsp+8h] [xbp-38h] BYREF
__int64 v12; // [xsp+10h] [xbp-30h]
if ( *(_BYTE *)(result + 400) != 1 )
return result;
v1 = result;
cocos2d::CCRenderTexture::begin(result);
v2 = *(_DWORD *)(v1 + 372);
if ( !v2 )
goto LABEL_11;
*(_QWORD *)params = 0;
v12 = 0;
*(_QWORD *)s = 0;
if ( (v2 & 0x4000) == 0 )
{
if ( (v2 & 0x100) == 0 )
goto LABEL_5;
LABEL_21:
glGetFloatv(0xB73u, (GLfloat *)&s[1]);
glClearDepthf(*(GLclampf *)(v1 + 392));
v2 = *(_DWORD *)(v1 + 372);
if ( (v2 & 0x400) == 0 )
goto LABEL_7;
goto LABEL_6;
}
glGetFloatv(0xC22u, params);
glClearColor(*(GLfloat *)(v1 + 376), *(GLfloat *)(v1 + 380), *(GLfloat *)(v1 + 384), *(GLfloat *)(v1 + 388));
v2 = *(_DWORD *)(v1 + 372);
if ( (v2 & 0x100) != 0 )
goto LABEL_21;
LABEL_5:
if ( (v2 & 0x400) != 0 )
{
LABEL_6:
glGetIntegerv(0xB91u, s);
glClearStencil(*(_DWORD *)(v1 + 396));
v2 = *(_DWORD *)(v1 + 372);
}
LABEL_7:
glClear(v2);
v3 = *(_DWORD *)(v1 + 372);
if ( (v3 & 0x4000) != 0 )
{
glClearColor(params[0], params[1], *(GLfloat *)&v12, *((GLfloat *)&v12 + 1));
v3 = *(_DWORD *)(v1 + 372);
if ( (v3 & 0x100) == 0 )
{
LABEL_9:
if ( (v3 & 0x400) == 0 )
goto LABEL_11;
goto LABEL_10;
}
}
else if ( (v3 & 0x100) == 0 )
{
goto LABEL_9;
}
glClearDepthf(*(GLclampf *)&s[1]);
if ( (*(_DWORD *)(v1 + 372) & 0x400) != 0 )
LABEL_10:
glClearStencil(s[0]);
LABEL_11:
(*(void (__fastcall **)(__int64))(*(_QWORD *)v1 + 600LL))(v1);
v4 = *(_QWORD *)(v1 + 208);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
v6 = *v5;
if ( (_DWORD)v6 )
{
v7 = *((__int64 **)v5 + 2);
v8 = (unsigned __int64)&v7[v6 - 1];
do
{
v9 = *v7;
if ( !*v7 )
break;
if ( v9 != *(_QWORD *)(v1 + 320) )
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 752LL))(v9);
++v7;
}
while ( (unsigned __int64)v7 <= v8 );
}
}
return cocos2d::CCRenderTexture::end(v1);
}