//
// sub_180019780 from 0x180019780 to 0x18001981c (156 bytes)
//
// 3 xrefs:
// > cocos2d::extension::WebSocket::send @ 0x18001a3ff
// > cocos2d::extension::WebSocket::send @ 0x18001a4ab
// > ??> @ 0x18004ac5c
//
// 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 sub_180019780(__int64 a1, __int64 a2)
{
__int64 v4; // rsi
__int64 *v5; // rbx
__int64 v6; // rdi
_QWORD *v7; // rax
_QWORD *v8; // rdx
v4 = a1 + 80;
pthread_mutex_lock(a1 + 80);
v5 = *(__int64 **)(a1 + 64);
v6 = *v5;
if ( v5[1] == 0xAAAAAAAAAAAAAAALL )
std::_Xlength_error("list too long");
v7 = operator new(0x18u);
v7[2] = a2;
++v5[1];
v8 = *(_QWORD **)(v6 + 8);
*v7 = v6;
v7[1] = v8;
*(_QWORD *)(v6 + 8) = v7;
*v8 = v7;
return pthread_mutex_unlock(v4);
}