//
// sub_18001DE50 from 0x18001de50 to 0x18001ded8 (136 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCTableView::CCTableView @ 0x18001ca2a
// > sub_18001DA20 @ 0x18001dacb
// > ??> @ 0x18004b0ac
//
// 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
//
char *__fastcall sub_18001DE50(_QWORD *a1, unsigned __int64 a2)
{
unsigned __int64 v3; // rbx
void *v4; // rax
void *v5; // rcx
_QWORD *v6; // rax
char *result; // rax
if ( a2 > 0x3FFFFFFFFFFFFFFFLL )
goto LABEL_11;
v3 = 4 * a2;
if ( 4 * a2 < 0x1000 )
{
if ( v3 )
v6 = operator new(4 * a2);
else
v6 = nullptr;
goto LABEL_10;
}
if ( v3 + 39 < v3 )
LABEL_11:
Concurrency::cancel_current_task();
v4 = operator new(v3 + 39);
v5 = v4;
if ( !v4 )
invalid_parameter_noinfo_noreturn();
v6 = (_QWORD *)(((unsigned __int64)v4 + 39) & 0xFFFFFFFFFFFFFFE0uLL);
*(v6 - 1) = v5;
LABEL_10:
*a1 = v6;
a1[1] = v6;
result = (char *)v6 + v3;
a1[2] = result;
return result;
}