//
// sub_180019590 from 0x180019590 to 0x180019620 (144 bytes)
//
// 2 xrefs:
// > ??> @ 0x180028fe0
// > ??> @ 0x18004ac14
//
// 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
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCObject *__fastcall sub_180019590(struct cocos2d::CCObject *Block, __int64 a2)
{
char v2; // di
__int64 v4; // rax
cocos2d::CCScheduler *v5; // rax
void *v6; // rcx
void *v7; // rcx
v2 = a2;
*(_QWORD *)Block = &cocos2d::extension::WsThreadHelper::`vftable';
v4 = cocos2d::CCDirector::sharedDirector(Block, a2);
v5 = (cocos2d::CCScheduler *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 112LL))(v4);
cocos2d::CCScheduler::unscheduleAllForTarget(v5, Block);
pthread_mutex_destroy((char *)Block + 72);
pthread_mutex_destroy((char *)Block + 80);
v6 = *((void **)Block + 7);
if ( v6 )
sub_180019620(v6);
v7 = *((void **)Block + 8);
if ( v7 )
sub_180019620(v7);
cocos2d::CCObject::~CCObject(Block);
if ( (v2 & 1) != 0 )
j_j_free(Block);
return Block;
}