//
// cocos2d::CCGLProgram::initWithVertexShaderFilename from 0xb10c98 to 0xb10e18 (384 bytes)
//
// 1 xrefs:
// > ??> @ 0x2b338
//
// 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
//
bool cocos2d::CCGLProgram::initWithVertexShaderFilename(cocos2d::CCGLProgram *a1, const char *a2, const char *a3)
{
cocos2d::CCFileUtils *v5; // x0
cocos2d::CCString *v6; // x0
const char *CString; // x22
int *p_m_unknown2; // x0
cocos2d::CCFileUtils *v9; // x0
cocos2d::CCString *v10; // x0
const char *v11; // x2
int *v12; // x0
unsigned int *p_m_sString; // x1
int m_data; // w2
unsigned int *v16; // x1
int v17; // w3
const char *v19; // [xsp+48h] [xbp+48h]
cocos2d::CCString *v20; // [xsp+60h] [xbp+60h] BYREF
v5 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(cocos2d::CCString **__return_ptr, cocos2d::CCFileUtils *, const char *, _QWORD))v5->createCCArrayWithContentsOfFile)(
&v20,
v5,
a2,
0);
v6 = cocos2d::CCString::createWithContentsOfFile((const char *)v20);
CString = cocos2d::CCString::getCString(v6);
p_m_unknown2 = &v20[-1].m_unknown2;
if ( &v20[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_sString = (unsigned int *)&v20[-1].m_sString;
do
m_data = __ldaxr(p_m_sString);
while ( __stlxr(m_data - 1, p_m_sString) );
}
else
{
m_data = (int)v20[-1].m_sString.m_data.m_data;
LODWORD(v20[-1].m_sString.m_data.m_data) = m_data - 1;
}
if ( m_data <= 0 )
operator delete(p_m_unknown2);
}
v9 = cocos2d::CCFileUtils::sharedFileUtils();
((void (__fastcall *)(cocos2d::CCString **__return_ptr, cocos2d::CCFileUtils *, const char *, _QWORD))v9->createCCArrayWithContentsOfFile)(
&v20,
v9,
a3,
0);
v10 = cocos2d::CCString::createWithContentsOfFile((const char *)v20);
v11 = cocos2d::CCString::getCString(v10);
v12 = &v20[-1].m_unknown2;
if ( &v20[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v16 = (unsigned int *)&v20[-1].m_sString;
do
v17 = __ldaxr(v16);
while ( __stlxr(v17 - 1, v16) );
}
else
{
v17 = (int)v20[-1].m_sString.m_data.m_data;
LODWORD(v20[-1].m_sString.m_data.m_data) = v17 - 1;
}
if ( v17 <= 0 )
{
v19 = v11;
operator delete(v12);
v11 = v19;
}
}
return cocos2d::CCGLProgram::initWithVertexShaderByteArray(a1, CString, v11);
}