//
// cocos2d::extension::CCThreadPool::availableThreadCount from 0x5ab914 to 0x5ab96a (86 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCHttpClient::availableThreadCount @ 0x5ab98e
//
// 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
//
unsigned int __fastcall cocos2d::extension::CCThreadPool::availableThreadCount(cocos2d::extension::CCThreadPool *this)
{
pthread_mutex_t *v1; // r5
unsigned int v3; // r3
unsigned int v4; // r4
unsigned int v5; // r4
v1 = (pthread_mutex_t *)((char *)this + 52);
std::mutex::lock((pthread_mutex_t *)((char *)this + 52));
v3 = *((_DWORD *)this + 16)
+ ((*((_DWORD *)this + 9) - *((_DWORD *)this + 10)) >> 4)
+ 32 * (((*((_DWORD *)this + 12) - *((_DWORD *)this + 8)) >> 2) - 1)
+ ((*((_DWORD *)this + 7) - *((_DWORD *)this + 5)) >> 4);
v4 = (*((_DWORD *)this + 1) - *(_DWORD *)this) >> 2;
if ( v4 <= v3 )
v5 = 0;
else
v5 = v4 - v3;
if ( &pthread_create )
pthread_mutex_unlock(v1);
return v5;
}