//
// cocos2d::CCKeyboardDispatcher::flushPendingDelegates from 0xdb2da8 to 0xdb2e54 (172 bytes)
//
// 3 xrefs:
// > cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0xdb30b8
// > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0xdb3ec4
// > ??> @ 0x101d40
//
// This function is hookable on this platform (idp: arm, 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 13:08:40 +0000
//
__int64 __fastcall cocos2d::CCKeyboardDispatcher::flushPendingDelegates(cocos2d::CCKeyboardDispatcher *this)
{
__int64 v2; // x0
unsigned int v3; // w20
cocos2d::CCKeyboardDelegate *v4; // x1
__int64 result; // x0
__int64 v6; // x0
unsigned int v7; // w20
cocos2d::CCKeyboardDelegate *v8; // x1
if ( *((_BYTE *)this + 66) )
{
v2 = *((_QWORD *)this + 10);
*((_BYTE *)this + 66) = 0;
if ( *(_DWORD *)v2 )
{
v3 = 0;
do
{
v4 = *(cocos2d::CCKeyboardDelegate **)(*(_QWORD *)(v2 + 16) + 8LL * v3++);
cocos2d::CCKeyboardDispatcher::forceRemoveDelegate(this, v4);
v2 = *((_QWORD *)this + 10);
}
while ( *(_DWORD *)v2 > v3 );
}
cocos2d::ccCArrayRemoveAllValues((_DWORD *)v2);
}
result = *((unsigned __int8 *)this + 65);
if ( *((_BYTE *)this + 65) )
{
v6 = *((_QWORD *)this + 9);
*((_BYTE *)this + 65) = 0;
if ( *(_DWORD *)v6 )
{
v7 = 0;
do
{
v8 = *(cocos2d::CCKeyboardDelegate **)(*(_QWORD *)(v6 + 16) + 8LL * v7++);
cocos2d::CCKeyboardDispatcher::forceAddDelegate((cocos2d::CCArray **)this, v8);
v6 = *((_QWORD *)this + 9);
}
while ( v7 < *(_DWORD *)v6 );
}
return (__int64)cocos2d::ccCArrayRemoveAllValues((_DWORD *)v6);
}
return result;
}