//
// cocos2d::CCGLProgram::initWithVertexShaderByteArray from 0x1001b3530 to 0x1001b35d4 (164 bytes)
//
// 7 xrefs:
// > cocos2d::CCShaderCache::loadDefaultShader @ 0x10015234c
// > cocos2d::CCShaderCache::loadDefaultShader @ 0x100152394
// > cocos2d::CCShaderCache::loadDefaultShader @ 0x1001523c8
// > cocos2d::CCShaderCache::loadDefaultShader @ 0x1001523fc
// > cocos2d::CCShaderCache::loadDefaultShader @ 0x100152444
// > sub_1002384D8 @ 0x100238580
// > sub_10030BA7C @ 0x10030bb4c
//
// 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:00:09 +0000
//
__int64 __fastcall cocos2d::CCGLProgram::initWithVertexShaderByteArray(__int64 a1, __int64 a2, __int64 a3)
{
__int64 result; // x0
GLuint *v7; // x22
GLuint *v8; // x20
LODWORD(result) = glCreateProgram();
*(_DWORD *)(a1 + 60) = 0;
v7 = (GLuint *)(a1 + 60);
*(_DWORD *)(a1 + 56) = result;
*(_DWORD *)(a1 + 64) = 0;
v8 = (GLuint *)(a1 + 64);
if ( !a2 || (result = cocos2d::CCGLProgram::compileShader(result, (int)a1 + 60, 0x8B31u), (_DWORD)result) )
{
if ( !a3 || (result = cocos2d::CCGLProgram::compileShader(result, (int)a1 + 64, 0x8B30u), (_DWORD)result) )
{
if ( *v7 )
glAttachShader(*(_DWORD *)(a1 + 56), *v7);
if ( *v8 )
glAttachShader(*(_DWORD *)(a1 + 56), *v8);
*(_QWORD *)(a1 + 104) = 0;
return 1;
}
}
return result;
}