//
// sub_1800790C0 from 0x1800790c0 to 0x180079164 (164 bytes)
//
// 6 xrefs:
// > cocos2d::CCEGLView::CCEGLView @ 0x1800782bd
// > cocos2d::CCEGLView::~CCEGLView @ 0x18007867f
// > sub_18007C490 @ 0x18007c4ca
// > ??> @ 0x180144c18
// > ??> @ 0x180144c28
// > ??> @ 0x1801beb78
//
// 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 11:21:59 +0000
//
_QWORD *__fastcall sub_1800790C0(_QWORD *a1)
{
unsigned __int64 v1; // rdx
__int64 v3; // rcx
_QWORD *result; // rax
_QWORD *v5; // rcx
_QWORD *v6; // rbx
unsigned __int64 *v7; // rdx
unsigned __int64 *v8; // rcx
unsigned __int64 v9; // [rsp+30h] [rbp+8h] BYREF
v1 = a1[2];
if ( v1 )
{
v3 = a1[1];
if ( a1[7] >> 3 <= v1 )
{
**(_QWORD **)(v3 + 8) = 0;
v5 = *(_QWORD **)v3;
if ( v5 )
{
do
{
v6 = (_QWORD *)*v5;
j_j_free_0(v5);
v5 = v6;
}
while ( v6 );
}
*(_QWORD *)a1[1] = a1[1];
*(_QWORD *)(a1[1] + 8LL) = a1[1];
a1[2] = 0;
v7 = (unsigned __int64 *)a1[4];
v8 = (unsigned __int64 *)a1[3];
v9 = a1[1];
return (_QWORD *)sub_180045230(v8, v7, &v9);
}
else
{
return sub_180078C70(a1, *(_QWORD *)v3, (_QWORD *)v3);
}
}
return result;
}