//
// cocos2d::CCNotificationObserver::CCNotificationObserver from 0xb1e1e4 to 0xb1e340 (348 bytes)
//
// 4 xrefs:
// > cocos2d::CCNotificationCenter::addObserver @ 0xb1e3c0
// > cocos2d::CCNotificationCenter::registerScriptObserver @ 0xb1e450
// > ??> @ 0x646b0
// > ??> @ 0x90408
//
// 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
//
// Alternative name is '_ZN7cocos2d22CCNotificationObserverC1EPNS_8CCObjectEMS1_FvS2_EPKcS2_'
__int64 __fastcall cocos2d::CCNotificationObserver::CCNotificationObserver(
__int64 a1,
__int64 a2,
__int64 a3,
__int64 a4,
char *a5,
__int64 a6)
{
size_t v10; // x0
void *v11; // x24
size_t v12; // x0
void *v13; // x0
unsigned int *v15; // x2
int v16; // w1
__int64 v19; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCObject::CCObject((cocos2d::CCObject *)a1);
*(_QWORD *)(a1 + 88) = a6;
*(_QWORD *)(a1 + 56) = a2;
*(_QWORD *)(a1 + 64) = a3;
*(_QWORD *)(a1 + 72) = a4;
*(_QWORD *)a1 = &off_1219050;
v10 = strlen(a5);
v11 = (void *)operator new[](v10 + 1);
*(_QWORD *)(a1 + 80) = v11;
v12 = strlen(a5);
memset(v11, 0, v12 + 1);
sub_D153B8((int)&v19, a5);
strlen(a5);
sub_D16348((int)&v19, *(void **)(a1 + 80));
*(_DWORD *)(a1 + 96) = 0;
v13 = (void *)(v19 - 24);
if ( (__int64 *)(v19 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v19 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v19 - 8);
*(_DWORD *)(v19 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v13);
}
return _stack_chk_guard;
}