//
// cocos2d::CCGLProgram::logForOpenGLObject from 0x1004179b0 to 0x100417abb (267 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 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 12:30:11 +0000
//
__int64 __fastcall cocos2d::CCGLProgram::logForOpenGLObject(
__int64 a1,
unsigned int a2,
void (__fastcall *a3)(_QWORD, __int64, int *),
void (__fastcall *a4)(_QWORD, _QWORD, int *, char *))
{
unsigned int v5; // r12d
char *v6; // rbx
size_t v7; // rax
size_t v8; // r14
char *v9; // r15
size_t v11; // r12
__int64 v12; // r14
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
int v15; // [rsp+18h] [rbp-28h] BYREF
int v16[9]; // [rsp+1Ch] [rbp-24h] BYREF
v16[0] = 0;
v15 = 0;
a3(a2, 35716, v16);
v5 = v16[0];
if ( v16[0] <= 0 )
return 0;
v6 = (char *)malloc(v16[0]);
a4(a2, v5, &v15, v6);
v7 = strlen(v6);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v8 = v7;
if ( v7 >= 0x17 )
{
v11 = 26;
if ( (v7 | 7) != 0x17 )
v11 = (v7 | 7) + 1;
v9 = (char *)operator new(v11);
__p = v9;
__dst[0] = v11 + 1;
__dst[1] = v8;
}
else
{
LOBYTE(__dst[0]) = 2 * v7;
v9 = (char *)__dst + 1;
if ( !v7 )
goto LABEL_11;
}
memcpy(v9, v6, v8);
LABEL_11:
v9[v8] = 0;
v12 = sub_10088E600(__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
free(v6);
return cocos2d::CCString::getCString(v12);
}