//
// sub_18009E300 from 0x18009e300 to 0x18009e35d (93 bytes)
//
// 2 xrefs:
// > cocos2d::CCTouchDispatcher::addStandardDelegate @ 0x1800b2aed
// > cocos2d::CCTouchDispatcher::addTargetedDelegate @ 0x1800b2bc4
//
// 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
//
__int64 __fastcall sub_18009E300(__int64 a1, __int64 a2)
{
__int64 result; // rax
unsigned int v4; // ecx
__int64 v5; // r8
__int64 v6; // rdx
__int64 v7; // r9
__int64 v8; // rcx
result = 0;
v4 = *(_DWORD *)a1;
if ( v4 )
{
while ( 1 )
{
v5 = 8 * result;
if ( *(_QWORD *)(8 * result + *(_QWORD *)(a1 + 16)) == a2 )
break;
result = (unsigned int)(result + 1);
if ( (unsigned int)result >= v4 )
return result;
}
if ( (_DWORD)result != -1 )
{
*(_DWORD *)a1 = v4 - 1;
if ( (unsigned int)result < v4 - 1 )
{
v6 = 8LL * (unsigned int)(result + 1);
v7 = v4 - 1 - (unsigned int)result;
do
{
v8 = *(_QWORD *)(a1 + 16);
v5 += 8;
v6 += 8;
result = *(_QWORD *)(v6 + v8 - 8);
*(_QWORD *)(v5 + v8 - 8) = result;
--v7;
}
while ( v7 );
}
}
}
return result;
}