//
// cocos2d::CCGLProgram::reset from 0x1001b41d8 to 0x1001b4318 (320 bytes)
//
// 1 xrefs:
// > sub_10030BA7C @ 0x10030bae0
//
// This function is hookable on this platform (idp: arm, 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 11:00:09 +0000
//
void __fastcall cocos2d::CCGLProgram::reset(__int64 a1)
{
_QWORD *v1; // x19
__int64 v2; // x20
__int64 v3; // x9
__int64 v4; // x21
__int64 v5; // x8
__int64 v6; // x10
__int64 v7; // x11
__int64 v8; // x10
_QWORD *v9; // x11
__int64 v10; // x8
__int64 v11; // x9
__int64 v12; // x9
__int64 v13; // x10
v1 = (_QWORD *)(a1 + 104);
v2 = *(_QWORD *)(a1 + 104);
*(_OWORD *)(a1 + 84) = 0u;
*(_OWORD *)(a1 + 56) = 0u;
*(_OWORD *)(a1 + 72) = 0u;
if ( v2 )
{
while ( 1 )
{
v3 = *(_QWORD *)(v2 + 24);
v4 = *(_QWORD *)(v2 + 32);
if ( v3 )
break;
v5 = *v1;
if ( v4 )
goto LABEL_5;
free(**(void ***)(v5 + 16));
free(*(void **)(*v1 + 16LL));
*v1 = 0;
LABEL_18:
free(*(void **)v2);
free((void *)v2);
v2 = v4;
if ( !v4 )
goto LABEL_21;
}
v5 = *v1;
LABEL_5:
v6 = *(_QWORD *)(v5 + 16);
v7 = *(_QWORD *)(v6 + 32);
if ( v2 == *(_QWORD *)(v6 + 24) - v7 )
*(_QWORD *)(v6 + 24) = v7 + v3;
v8 = *(_QWORD *)(v2 + 32);
v9 = (_QWORD *)(v7 + v3 + 16);
if ( !v3 )
{
v9 = v1;
v5 = *(_QWORD *)(v2 + 32);
}
*v9 = v8;
v10 = *(_QWORD *)(v5 + 16);
if ( v8 )
*(_QWORD *)(*(_QWORD *)(v10 + 32) + v8 + 8) = v3;
v11 = *(_QWORD *)v10 + 16LL * ((unsigned int)(*(_DWORD *)(v10 + 8) - 1) & *(_DWORD *)(v2 + 68));
--*(_DWORD *)(v11 + 8);
if ( *(_QWORD *)v11 == v2 + 16 )
*(_QWORD *)v11 = *(_QWORD *)(v2 + 48);
v12 = *(_QWORD *)(v2 + 40);
v13 = *(_QWORD *)(v2 + 48);
if ( v12 )
*(_QWORD *)(v12 + 32) = v13;
if ( v13 )
*(_QWORD *)(v13 + 24) = v12;
--*(_DWORD *)(v10 + 16);
goto LABEL_18;
}
LABEL_21:
*v1 = 0;
}