//
// sub_1800173F0 from 0x1800173f0 to 0x1800174bc (204 bytes)
//
// 3 xrefs:
// > cocos2d::extension::CCHttpClient::~CCHttpClient @ 0x1800176ab
// > cocos2d::extension::CCHttpClient::~CCHttpClient @ 0x1800176bc
// > ??> @ 0x18004c998
//
// 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
//
int __fastcall sub_1800173F0(__int64 a1)
{
int result; // eax
_Thrd_t *v3; // rbx
_Thrd_t *i; // rdi
_Thrd_t v5; // [rsp+20h] [rbp-18h] BYREF
if ( Mtx_lock((_Mtx_t)(a1 + 64)) )
{
LABEL_12:
std::_Throw_Cpp_error(5);
JUMPOUT(0x1800174BBLL);
}
if ( *(_DWORD *)(a1 + 140) == 0x7FFFFFFF )
{
*(_DWORD *)(a1 + 140) = 2147483646;
std::_Throw_Cpp_error(6);
__debugbreak();
}
*(_BYTE *)(a1 + 216) = 1;
Mtx_unlock((_Mtx_t)(a1 + 64));
result = Cnd_broadcast((_Cnd_t)(a1 + 144));
v3 = *(_Thrd_t **)a1;
for ( i = *(_Thrd_t **)(a1 + 8); v3 != i; ++v3 )
{
if ( v3->_Id )
{
if ( v3->_Id == Thrd_id() )
goto LABEL_12;
v5 = *v3;
result = Thrd_join(&v5, nullptr);
if ( result )
{
std::_Throw_Cpp_error(2);
__debugbreak();
}
*v3 = 0;
}
}
return result;
}