//
// cocos2d::CCKeyboardDispatcher::flushPendingDelegates from 0x808a22 to 0x808a7c (90 bytes)
//
// 2 xrefs:
// > cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0x8097e8
// > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x809b7e
//
// 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::CCKeyboardDelegate *__fastcall cocos2d::CCKeyboardDispatcher::flushPendingDelegates(
cocos2d::CCKeyboardDelegate *this)
{
cocos2d::CCKeyboardDelegate *v1; // r4
unsigned int v2; // r5
unsigned int *v3; // r0
cocos2d::CCKeyboardDelegate *v4; // r1
unsigned int v5; // r5
unsigned int *v6; // r0
cocos2d::CCKeyboardDelegate *v7; // r1
v1 = this;
if ( *((_BYTE *)this + 58) )
{
v2 = 0;
*((_BYTE *)this + 58) = 0;
while ( 1 )
{
v3 = *((unsigned int **)v1 + 16);
if ( v2 >= *v3 )
break;
v4 = *(cocos2d::CCKeyboardDelegate **)(v3[3] + 4 * v2++);
cocos2d::CCKeyboardDispatcher::forceRemoveDelegate(v1, v4);
}
this = (cocos2d::CCKeyboardDelegate *)cocos2d::ccCArrayRemoveAllValues(v3);
}
if ( *((_BYTE *)v1 + 57) )
{
v5 = 0;
*((_BYTE *)v1 + 57) = 0;
while ( 1 )
{
v6 = *((unsigned int **)v1 + 15);
if ( v5 >= *v6 )
break;
v7 = *(cocos2d::CCKeyboardDelegate **)(v6[3] + 4 * v5++);
cocos2d::CCKeyboardDispatcher::forceAddDelegate((cocos2d::CCArray **)v1, v7);
}
return (cocos2d::CCKeyboardDelegate *)cocos2d::ccCArrayRemoveAllValues(v6);
}
return this;
}