//
// cocos2d::CCTouchDispatcher::forceAddHandler from 0xb3ea18 to 0xb3eafc (228 bytes)
//
// 5 xrefs:
// > cocos2d::CCTouchDispatcher::addStandardDelegate @ 0xb3eb94
// > cocos2d::CCTouchDispatcher::addTargetedDelegate @ 0xb3ec7c
// > cocos2d::CCTouchDispatcher::touches @ 0xb3f174
// > cocos2d::CCTouchDispatcher::touches @ 0xb3f468
// > ??> @ 0xba6a8
//
// 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
//
void cocos2d::CCTouchDispatcher::forceAddHandler(
cocos2d::CCTouchDispatcher *a1,
cocos2d::CCTouchHandler *a2,
cocos2d::CCArray *a3)
{
unsigned int v3; // w3
cocos2d::ccArray *data; // x1
cocos2d::CCTouchHandler **arr; // x19
__int64 v8; // x0
char *v9; // x23
cocos2d::CCTouchHandler *v10; // x20
unsigned int v11; // w22
int Priority; // w24
cocos2d::CCTouchDelegate *Delegate; // x20
if ( !a3
|| (data = a3->data, !data->num)
|| (arr = (cocos2d::CCTouchHandler **)data->arr,
v8 = 8LL * data->num - 8,
v9 = (char *)arr + v8,
arr > (cocos2d::CCTouchHandler **)((char *)arr + v8)) )
{
v11 = 0;
goto LABEL_12;
}
v10 = *arr;
v11 = 0;
if ( !*arr )
{
LABEL_12:
cocos2d::CCArray::insertObject(a3, (cocos2d::_ccArray *)a2, (cocos2d::CCObject *)v11, v3);
return;
}
while ( 1 )
{
++arr;
Priority = cocos2d::CCTouchHandler::getPriority(v10);
if ( Priority < cocos2d::CCTouchHandler::getPriority(a2) )
++v11;
Delegate = cocos2d::CCTouchHandler::getDelegate(v10);
if ( Delegate == cocos2d::CCTouchHandler::getDelegate(a2) )
break;
if ( v9 >= (char *)arr )
{
v10 = *arr;
if ( *arr )
continue;
}
goto LABEL_12;
}
}