//
// cocos2d::extension::CCThreadPool::enqueue from 0x7b2070 to 0x7b2126 (182 bytes)
//
// 1 xrefs:
// > cocos2d::extension::CCHttpClient::send @ 0x7b215c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:08 +0000
//
int __fastcall cocos2d::extension::CCThreadPool::enqueue(int a1, int a2)
{
std::mutex *v2; // r6
int v5; // r3
unsigned int v6; // r3
int v7; // r5
unsigned int v8; // r1
unsigned int v9; // r3
int v10; // r2
int v11; // r5
int v12; // r0
v2 = (std::mutex *)(a1 + 36);
std::mutex::lock((std::mutex *)(a1 + 36));
if ( !*(_BYTE *)(a1 + 44) )
{
v5 = (*(_DWORD *)(a1 + 20) - *(_DWORD *)(a1 + 16)) >> 2;
if ( v5 )
v5 *= 170;
if ( (*(_DWORD *)(a1 + 20) - *(_DWORD *)(a1 + 16)) >> 2 )
--v5;
if ( v5 == *(_DWORD *)(a1 + 28) + *(_DWORD *)(a1 + 32) )
std::deque>::__add_back_capacity(a1 + 12);
v6 = *(_DWORD *)(a1 + 28) + *(_DWORD *)(a1 + 32);
v7 = *(_DWORD *)(a1 + 16);
v8 = v6 / 0xAA;
if ( *(_DWORD *)(a1 + 20) == v7 )
goto LABEL_15;
v9 = v6 % 0xAA;
v10 = *(_DWORD *)(v7 + 4 * v8);
v11 = v10 + 24 * v9;
if ( !v11 )
goto LABEL_15;
v12 = *(_DWORD *)(a2 + 16);
if ( v12 )
{
if ( v12 == a2 )
{
*(_DWORD *)(v11 + 16) = v11;
(*(void (__fastcall **)(_DWORD, unsigned int))(**(_DWORD **)(a2 + 16) + 12))(
*(_DWORD *)(a2 + 16),
v10 + 24 * v9);
LABEL_15:
++*(_DWORD *)(a1 + 32);
std::mutex::unlock(v2);
return std::condition_variable::notify_one((std::condition_variable *)(a1 + 40));
}
v12 = (*(int (__fastcall **)(int))(*(_DWORD *)v12 + 8))(v12);
}
*(_DWORD *)(v11 + 16) = v12;
goto LABEL_15;
}
return std::mutex::unlock(v2);
}