//
// cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate from 0x1800463a0 to 0x180046498 (248 bytes)
//
// 6 xrefs:
// > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x1800462e2
// > cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0x180047103
// > ??> @ 0x180140360
// > ??> @ 0x180140394
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bb8c0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:21:41 +0000
//
unsigned __int64 __fastcall cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate(
__int64 a1,
unsigned int a2,
unsigned __int8 a3,
__int64 *a4)
{
unsigned __int64 result; // rax
struct cocos2d::CCObject *Target; // rax
__int64 v10; // rdx
char v11; // bp
unsigned __int64 v12; // rbx
struct cocos2d::CCObject *v13; // rsi
__int64 v14; // rdx
__int64 (__fastcall **v15)(struct cocos2d::CCObject *, _QWORD); // rax
result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 56));
if ( (_DWORD)result )
{
result = (unsigned __int64)cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(a1 + 56));
if ( result )
{
Target = cocos2d::CCNotificationObserver::getTarget((cocos2d::CCNotificationObserver *)result);
v10 = *a4;
v11 = 0;
v12 = 0;
v13 = Target;
if ( !((a4[1] - *a4) >> 2) )
goto LABEL_9;
do
{
v14 = *(unsigned int *)(v10 + 4 * v12);
if ( (_DWORD)v14
&& (*(unsigned __int8 (__fastcall **)(struct cocos2d::CCObject *, __int64, _QWORD))(*(_QWORD *)v13 + 16LL))(
v13,
v14,
a3) )
{
v11 = 1;
}
v10 = *a4;
++v12;
result = (a4[1] - *a4) >> 2;
}
while ( v12 < result );
if ( !v11 )
{
LABEL_9:
v15 = *(__int64 (__fastcall ***)(struct cocos2d::CCObject *, _QWORD))v13;
if ( a3 )
return (*v15)(v13, a2);
else
return v15[1](v13, a2);
}
}
}
return result;
}