//
// cocos2d::CCTouchDispatcher::rearrangeHandlers from 0x80855c to 0x808590 (52 bytes)
//
// 2 xrefs:
// > cocos2d::CCTouchDispatcher::setPriority @ 0x8085ba
// > cocos2d::CCTouchDispatcher::setPriority @ 0x8085c6
//
// 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
//
int __fastcall cocos2d::CCTouchDispatcher::rearrangeHandlers(cocos2d::CCTouchDispatcher *this, cocos2d::CCArray *a2)
{
_DWORD *v2; // r3
int v3; // r0
char *v4; // r1
int (__fastcall *v6[2])(_DWORD); // [sp+0h] [bp-8h] BYREF
v6[0] = (int (__fastcall *)(_DWORD))this;
v6[1] = (int (__fastcall *)(_DWORD))a2;
v2 = *((_DWORD **)a2 + 13);
v3 = v2[3];
v4 = (char *)(v3 + 4 * *v2);
v6[0] = (int (__fastcall *)(_DWORD))sub_807C2A;
return std::__sort(v3, v4, v6);
}