//
// cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate from 0x808a7c to 0x808afe (130 bytes)
//
// 2 xrefs:
// > cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0x8097da
// > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x809b72
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:27 +0000
//
cocos2d::CCKeyboardHandler *__fastcall cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate(
int a1,
int a2,
int a3,
_DWORD *a4,
int a5,
int a6)
{
cocos2d::CCKeyboardHandler *result; // r0
unsigned int v11; // r5
int v12; // r8
cocos2d::CCKeyboardHandler *v13; // r4
int v14; // r1
int (__fastcall **v15)(cocos2d::CCKeyboardHandler *, int, int, int); // r3
int v16; // [sp+8h] [bp-4h]
v16 = a3;
result = (cocos2d::CCKeyboardHandler *)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 52));
if ( result )
{
result = (cocos2d::CCKeyboardHandler *)cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(a1 + 52));
if ( result )
{
result = (cocos2d::CCKeyboardHandler *)cocos2d::CCKeyboardHandler::getDelegate(result);
v11 = 0;
v12 = 0;
v13 = result;
while ( v11 < (a4[1] - *a4) >> 2 )
{
v14 = *(_DWORD *)(*a4 + 4 * v11);
if ( v14 )
{
result = (cocos2d::CCKeyboardHandler *)(*(int (__fastcall **)(cocos2d::CCKeyboardHandler *, int, int, _DWORD, int, int, int))(*(_DWORD *)v13 + 8))(
v13,
v14,
a3,
*(_DWORD *)(*(_DWORD *)v13 + 8),
a5,
a6,
v16);
if ( result )
v12 = 1;
}
++v11;
}
if ( !v12 )
{
v15 = *(int (__fastcall ***)(cocos2d::CCKeyboardHandler *, int, int, int))v13;
if ( a3 )
return (cocos2d::CCKeyboardHandler *)(*v15)(v13, a2, a5, a6);
else
return (cocos2d::CCKeyboardHandler *)v15[1](v13, a2, a5, a6);
}
}
}
return result;
}