//
// sub_1800182C0 from 0x1800182c0 to 0x1800183ce (270 bytes)
//
// 3 xrefs:
// > sub_1800173B0 @ 0x1800173b0
// > cocos2d::extension::CCHttpClient::~CCHttpClient @ 0x1800176c5
// > ??> @ 0x18004ca1c
//
// 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:15:42 +0000
//
void __fastcall sub_1800182C0(__int64 a1, __int64 a2)
{
__int64 v3; // rcx
__int64 v4; // rdi
__int64 v5; // rcx
__int64 v6; // rdi
void *v7; // rcx
_QWORD *v8; // rcx
void *v9; // rcx
v3 = *(_QWORD *)(a1 + 32);
if ( v3 )
{
do
{
v4 = *(_QWORD *)(*(_QWORD *)(a1 + 8) + 8 * ((*(_QWORD *)(a1 + 16) - 1LL) & (*(_QWORD *)(a1 + 24) - 1LL + v3)));
v5 = *(_QWORD *)(v4 + 56);
if ( v5 )
{
LOBYTE(a2) = v5 != v4;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v5 + 32LL))(v5, a2);
*(_QWORD *)(v4 + 56) = 0;
}
v3 = *(_QWORD *)(a1 + 32) - 1LL;
*(_QWORD *)(a1 + 32) = v3;
}
while ( v3 );
*(_QWORD *)(a1 + 24) = 0;
}
if ( *(_QWORD *)(a1 + 8) )
{
v6 = *(_QWORD *)(a1 + 16);
while ( v6 > 0 )
{
--v6;
v7 = *(void **)(*(_QWORD *)(a1 + 8) + 8 * v6);
if ( v7 )
j_j_free(v7);
}
v8 = *(_QWORD **)(a1 + 8);
if ( (unsigned __int64)(8LL * *(_QWORD *)(a1 + 16)) >= 0x1000 )
{
if ( (unsigned __int64)v8 - *(v8 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v8 = (_QWORD *)*(v8 - 1);
}
j_j_free(v8);
*(_QWORD *)(a1 + 8) = 0;
*(_QWORD *)(a1 + 16) = 0;
}
v9 = *(void **)a1;
*(_QWORD *)a1 = 0;
j_j_free(v9);
}