//
// cocos2d::CCGLProgram::logForOpenGLObject from 0x10042ad40 to 0x10042ae4b (267 bytes)
//
// 0 xrefs:
//
// 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 *__fastcall cocos2d::CCGLProgram::logForOpenGLObject(
cocos2d::CCGLProgram *a1,
unsigned int a2,
cocos2d::GLInfoFunction a3,
cocos2d::GLLogFunction a4)
{
double v4; // xmm0_8
unsigned int v6; // r12d
char *v7; // rbx
size_t v8; // rax
size_t v9; // r14
char *v10; // r15
size_t v12; // r12
cocos2d::CCString *v13; // r14
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
int v16; // [rsp+18h] [rbp-28h] BYREF
int v17[9]; // [rsp+1Ch] [rbp-24h] BYREF
v17[0] = 0;
v16 = 0;
((void (__fastcall *)(_QWORD, __int64, int *))a3)(a2, 35716, v17);
v6 = v17[0];
if ( v17[0] <= 0 )
return nullptr;
v7 = (char *)malloc(v17[0]);
((void (__fastcall *)(_QWORD, _QWORD, int *, char *))a4)(a2, v6, &v16, v7);
v8 = strlen(v7);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v4);
v9 = v8;
if ( v8 >= 0x17 )
{
v12 = 26;
if ( (v8 | 7) != 0x17 )
v12 = (v8 | 7) + 1;
v10 = (char *)operator new(v12);
__p = v10;
__dst[0] = v12 + 1;
__dst[1] = v9;
}
else
{
LOBYTE(__dst[0]) = 2 * v8;
v10 = (char *)__dst + 1;
if ( !v8 )
goto LABEL_11;
}
memcpy(v10, v7, v9);
LABEL_11:
v10[v9] = 0;
v13 = (cocos2d::CCString *)sub_1007AB360(__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
free(v7);
return cocos2d::CCString::getCString(v13);
}