//
// cocos2d::CCGLProgram::logForOpenGLObject from 0xb10e80 to 0xb10fb4 (308 bytes)
//
// 4 xrefs:
// > cocos2d::CCGLProgram::vertexShaderLog @ 0xb10fc8
// > cocos2d::CCGLProgram::fragmentShaderLog @ 0xb10fe0
// > cocos2d::CCGLProgram::programLog @ 0xb10ff8
// > ??> @ 0x93cf0
//
// 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
//
const char *cocos2d::CCGLProgram::logForOpenGLObject(
cocos2d::CCGLProgram *a1,
unsigned int a2,
cocos2d::GLInfoFunction a3,
cocos2d::GLLogFunction a4)
{
char *v6; // x21
cocos2d::CCString *v7; // x20
void *v8; // x0
unsigned int *v10; // x2
int v11; // w1
int v12; // [xsp+58h] [xbp+58h] BYREF
int v13; // [xsp+5Ch] [xbp+5Ch] BYREF
__int64 v14; // [xsp+60h] [xbp+60h] BYREF
v12 = 0;
v13 = 0;
((void (__fastcall *)(_QWORD, __int64, int *))a3)(a2, 35716, &v12);
if ( v12 <= 0 )
return nullptr;
v6 = (char *)malloc(v12);
((void (__fastcall *)(_QWORD, _QWORD, int *, char *))a4)(a2, (unsigned int)v12, &v13, v6);
sub_D153B8((int)&v14, v6);
v7 = (cocos2d::CCString *)cocos2d::CCString::create();
v8 = (void *)(v14 - 24);
if ( (__int64 *)(v14 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v14 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v14 - 8);
*(_DWORD *)(v14 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v8);
}
free(v6);
return cocos2d::CCString::getCString(v7);
}