//
// cocos2d::extension::CCHttpClient::dCCHttpClient from 0x100426200 to 0x1004262cf (207 bytes)
//
// 2 xrefs:
// > sub_1004262E0 @ 0x1004262e5
// > sub_1004262F0 @ 0x1004262f9
//
// 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:30:17 +0000
//
__int64 __fastcall cocos2d::extension::CCHttpClient::dCCHttpClient(_QWORD *a1, __int64 a2)
{
__int64 v3; // r15
std::thread *v4; // rdi
std::thread *v5; // r14
std::thread *v6; // r15
std::thread *v7; // r14
__int64 v8; // rax
__int64 v9; // rax
*a1 = off_100B41BF8;
v3 = a1[7];
std::mutex::lock((std::mutex *)(v3 + 72));
*(_BYTE *)(v3 + 184) = 1;
std::mutex::unlock((std::mutex *)(v3 + 72));
v4 = (std::thread *)(v3 + 136);
std::condition_variable::notify_all((std::condition_variable *)(v3 + 136));
v5 = *(std::thread **)v3;
v6 = *(std::thread **)(v3 + 8);
while ( v5 != v6 )
{
if ( v5->__t_ )
{
v4 = v5;
std::thread::join(v5);
}
++v5;
}
v7 = (std::thread *)a1[7];
if ( v7 )
{
sub_100425D50(a1[7]);
v4 = v7;
operator delete(v7);
}
v8 = cocos2d::CCDirector::sharedDirector(v4, a2);
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 128LL))(v8);
cocos2d::CCScheduler::unscheduleSelector(v9, cocos2d::extension::CCHttpClient::dispatchResponseCallbacks, 0, a1);
if ( qword_100BE39F8 )
cocos2d::CCObject::release(qword_100BE39F8);
curl_global_cleanup();
return sub_10047FF60(a1);
}