//
// cocos2d::extension::CCHttpClient::dCCHttpClient from 0x100438750 to 0x10043881f (207 bytes)
//
// 2 xrefs:
// > sub_100438830 @ 0x100438835
// > sub_100438840 @ 0x100438849
//
// 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
//
__int64 __fastcall cocos2d::extension::CCHttpClient::dCCHttpClient(__int64 a1)
{
__int64 v1; // r15
std::thread *v2; // r14
std::thread *v3; // r15
void *v4; // r14
cocos2d::CCDirector *v5; // rax
cocos2d::CCScheduler *v6; // rax
*(_QWORD *)a1 = off_100937DC8;
v1 = *(_QWORD *)(a1 + 56);
std::mutex::lock((std::mutex *)(v1 + 72));
*(_BYTE *)(v1 + 184) = 1;
std::mutex::unlock((std::mutex *)(v1 + 72));
std::condition_variable::notify_all((std::condition_variable *)(v1 + 136));
v2 = *(std::thread **)v1;
v3 = *(std::thread **)(v1 + 8);
while ( v2 != v3 )
{
if ( v2->__t_ )
std::thread::join(v2);
++v2;
}
v4 = *(void **)(a1 + 56);
if ( v4 )
{
sub_1004382B0(*(_QWORD *)(a1 + 56));
operator delete(v4);
}
v5 = cocos2d::CCDirector::sharedDirector();
v6 = (cocos2d::CCScheduler *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v5->getScheduler)(v5);
cocos2d::CCScheduler::unscheduleSelector(
v6,
(cocos2d::SEL_SCHEDULE)(unsigned __int64)cocos2d::extension::CCHttpClient::dispatchResponseCallbacks,
(cocos2d::CCObject *)a1);
if ( qword_1009A1770 )
cocos2d::CCObject::release((cocos2d::CCObject *)qword_1009A1770);
curl_global_cleanup();
return cocos2d::CCObject::dCCObject(a1);
}