//
// cocos2d::CCNotificationCenter::registerScriptObserver from 0x1002879f0 to 0x100287acd (221 bytes)
//
// 0 xrefs:
//
// 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
//
void __fastcall cocos2d::CCNotificationCenter::registerScriptObserver(
cocos2d::CCNotificationCenter *a1,
cocos2d::CCObject *a2,
int a3,
const char *a4)
{
cocos2d::CCNotificationCenter_vtbl *v5; // rax
bool (__cdecl *canEncode)(cocos2d::CCObject *__hidden); // rax
_QWORD *v7; // r14
unsigned __int64 v8; // rbx
__int64 v9; // r13
const char *v10; // rax
cocos2d::CCObject *v11; // r13
v5 = a1[1].__vftable;
if ( v5 )
{
canEncode = v5->canEncode;
if ( *(_DWORD *)canEncode )
{
v7 = *((_QWORD **)canEncode + 2);
v8 = (unsigned __int64)&v7[*(unsigned int *)canEncode - 1];
do
{
v9 = *v7;
if ( !*v7 )
break;
if ( (cocos2d::CCObject *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v9 + 80LL))(*v7) == a2 )
{
v10 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 96LL))(v9);
if ( !strcmp(v10, a4) )
return;
}
++v7;
}
while ( (unsigned __int64)v7 <= v8 );
}
}
v11 = (cocos2d::CCObject *)operator new(0x68u);
cocos2d::CCNotificationObserver::CCNotificationObserver(v11, a2, 0, 0, a4, 0);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))v11->__vftable[1].update)(v11, (unsigned int)a3);
cocos2d::CCObject::autorelease(v11);
sub_10071FCD0(a1[1].__vftable, v11);
}