//
// cocos2d::CCNotificationCenter::addObserver from 0x100287770 to 0x100287856 (230 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::addObserver(
cocos2d::CCNotificationCenter *a1,
cocos2d::CCObject *a2,
cocos2d::SEL_CallFuncO a3,
const char *a4,
cocos2d::CCObject *a5)
{
cocos2d::CCNotificationCenter_vtbl *v6; // rax
bool (__cdecl *canEncode)(cocos2d::CCObject *__hidden); // rax
_QWORD *v8; // r13
_QWORD *v9; // rbx
__int64 v10; // r12
const char *v11; // rax
cocos2d::CCObject *v12; // r12
size_t adj; // [rsp+10h] [rbp-40h]
void (__cdecl *ptr)(cocos2d::CCObject *); // [rsp+18h] [rbp-38h]
adj = a3.adj;
ptr = a3.ptr;
v6 = a1[1].__vftable;
if ( v6 )
{
canEncode = v6->canEncode;
if ( *(_DWORD *)canEncode )
{
v8 = *((_QWORD **)canEncode + 2);
v9 = &v8[*(unsigned int *)canEncode - 1];
do
{
v10 = *v8;
if ( !*v8 )
break;
if ( (cocos2d::CCObject *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v10 + 80LL))(*v8) == a2 )
{
v11 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 96LL))(v10);
if ( !strcmp(v11, a4) )
return;
}
++v8;
}
while ( v8 <= v9 );
}
}
v12 = (cocos2d::CCObject *)operator new(0x68u);
cocos2d::CCNotificationObserver::CCNotificationObserver(v12, a2, ptr, adj, a4, a5);
cocos2d::CCObject::autorelease(v12);
sub_10071FCD0(a1[1].__vftable, v12);
}