//
// sub_1004382B0 from 0x1004382b0 to 0x10043838a (218 bytes)
//
// 2 xrefs:
// > sub_100438400 @ 0x100438405
// > cocos2d::extension::CCHttpClient::dCCHttpClient @ 0x1004387c5
//
// 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
//
void __fastcall sub_1004382B0(__int64 a1)
{
std::thread *v2; // r12
std::thread *v3; // r13
std::thread *v4; // r15
std::thread *v5; // r14
std::thread *v6; // rdi
std::mutex::lock((std::mutex *)(a1 + 72));
*(_BYTE *)(a1 + 184) = 1;
std::mutex::unlock((std::mutex *)(a1 + 72));
std::condition_variable::notify_all((std::condition_variable *)(a1 + 136));
v2 = *(std::thread **)a1;
v3 = *(std::thread **)(a1 + 8);
while ( v2 != v3 )
{
if ( v2->__t_ )
std::thread::join(v2);
++v2;
}
std::condition_variable::~condition_variable((std::condition_variable *)(a1 + 136));
std::mutex::~mutex((std::mutex *)(a1 + 72));
sub_100438A10(a1 + 24);
v4 = *(std::thread **)a1;
if ( *(_QWORD *)a1 )
{
v5 = *(std::thread **)(a1 + 8);
v6 = *(std::thread **)a1;
if ( v5 != v4 )
{
do
std::thread::~thread(--v5);
while ( v5 != v4 );
v6 = *(std::thread **)a1;
}
*(_QWORD *)(a1 + 8) = v4;
operator delete(v6);
}
}