//
// sub_180019580 from 0x180019580 to 0x18001961c (156 bytes)
//
// 2 xrefs:
// > cocos2d::extension::WebSocket::onSocketCallback @ 0x18001a7ed
// > ??> @ 0x18004cbb4
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:15:42 +0000
//
__int64 __fastcall sub_180019580(__int64 a1, __int64 a2)
{
__int64 v4; // rsi
__int64 *v5; // rbx
__int64 v6; // rdi
_QWORD *v7; // rax
_QWORD *v8; // rdx
v4 = a1 + 72;
pthread_mutex_lock(a1 + 72);
v5 = *(__int64 **)(a1 + 56);
v6 = *v5;
if ( v5[1] == 0xAAAAAAAAAAAAAAALL )
std::_Xlength_error("list too long");
v7 = (_QWORD *)sub_18001F040(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);
}