//
// cocos2d::CCNotificationCenter::getObserverHandlerByName from 0xb1e12c to 0xb1e1e4 (184 bytes)
//
// 1 xrefs:
// > ??> @ 0x66660
//
// 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
//
int cocos2d::CCNotificationCenter::getObserverHandlerByName(cocos2d::CCNotificationCenter *a1, const char *a2)
{
cocos2d::CCNotificationCenter_vtbl *v2; // x0
bool (__fastcall *canEncode)(cocos2d::CCObject *__hidden); // x0
char *v4; // x19
__int64 v5; // x20
char *v6; // x21
__int64 v7; // x20
const char *v9; // x0
if ( !a2 )
return -1;
if ( !*a2 )
return -1;
v2 = a1[1].__vftable;
if ( !v2 )
return -1;
canEncode = v2->canEncode;
if ( !*(_DWORD *)canEncode )
return -1;
v4 = *((char **)canEncode + 2);
v5 = 8LL * *(unsigned int *)canEncode - 8;
v6 = &v4[v5];
if ( v4 > &v4[v5] )
return -1;
v7 = *(_QWORD *)v4;
if ( !*(_QWORD *)v4 )
return -1;
while ( 1 )
{
v4 += 8;
v9 = (const char *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 96LL))(v7);
if ( !strcmp(v9, a2) )
break;
if ( v6 >= v4 )
{
v7 = *(_QWORD *)v4;
if ( *(_QWORD *)v4 )
continue;
}
return -1;
}
return (*(int (__fastcall **)(__int64))(*(_QWORD *)v7 + 112LL))(v7);
}