//
// cocos2d::CCGLProgram::programLog from 0x100417d40 to 0x100417e4c (268 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:12 +0000
//
__int64 __fastcall cocos2d::CCGLProgram::programLog(__int64 a1)
{
GLuint v1; // r14d
GLint v2; // r15d
GLchar *v3; // rbx
size_t v4; // rax
size_t v5; // r14
char *v6; // r15
size_t v8; // r12
__int64 v9; // r14
_QWORD __dst[2]; // [rsp+0h] [rbp-40h] BYREF
void *__p; // [rsp+10h] [rbp-30h]
GLsizei length; // [rsp+18h] [rbp-28h] BYREF
GLint params[9]; // [rsp+1Ch] [rbp-24h] BYREF
v1 = *(_DWORD *)(a1 + 56);
params[0] = 0;
length = 0;
glGetProgramiv(v1, 0x8B84u, params);
v2 = params[0];
if ( params[0] <= 0 )
return 0;
v3 = (GLchar *)malloc(params[0]);
glGetProgramInfoLog(v1, v2, &length, v3);
v4 = strlen(v3);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v8 = 26;
if ( (v4 | 7) != 0x17 )
v8 = (v4 | 7) + 1;
v6 = (char *)operator new(v8);
__p = v6;
__dst[0] = v8 + 1;
__dst[1] = v5;
}
else
{
LOBYTE(__dst[0]) = 2 * v4;
v6 = (char *)__dst + 1;
if ( !v4 )
goto LABEL_11;
}
memcpy(v6, v3, v5);
LABEL_11:
v6[v5] = 0;
v9 = sub_10088E600(__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
free(v3);
return cocos2d::CCString::getCString(v9);
}