//
// cocos2d::extension::CCThreadPool::enqueue from 0xaad388 to 0xaad4b0 (296 bytes)
//
// 2 xrefs:
// > cocos2d::extension::CCHttpClient::send @ 0xaad524
// > ??> @ 0x6d590
//
// 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::CCThreadPool::enqueue(__int64 a1, __int64 a2)
{
pthread_mutex_t *v3; // x0
__int64 v4; // x0
__int64 v5; // x0
__int64 v7; // [xsp+38h] [xbp+38h]
pthread_mutex_t *mutex; // [xsp+48h] [xbp+48h]
v3 = (pthread_mutex_t *)(a1 + 104);
mutex = v3;
if ( !v3 )
sub_D1410C(1);
if ( &pthread_create )
{
v7 = a2;
v4 = pthread_mutex_lock(v3);
a2 = v7;
if ( (_DWORD)v4 )
sub_D1410C(v4);
}
if ( *(_BYTE *)(a1 + 192) )
{
if ( mutex && &pthread_create )
pthread_mutex_unlock(mutex);
}
else
{
v5 = *(_QWORD *)(a1 + 72);
if ( v5 == *(_QWORD *)(a1 + 88) - 32LL )
{
std::deque>::_M_push_back_aux const&>(a1 + 24, a2);
}
else
{
if ( v5 )
{
std::function::function(v5, a2);
v5 = *(_QWORD *)(a1 + 72);
}
*(_QWORD *)(a1 + 72) = v5 + 32;
}
if ( mutex && &pthread_create )
pthread_mutex_unlock(mutex);
sub_D0BC64(a1 + 144);
}
return _stack_chk_guard;
}