//
// cocos2d::CCTouchDispatcher::ownerLevelOf from 0x1800b6b20 to 0x1800b6c34 (276 bytes)
//
// 6 xrefs:
// > cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b6443
// > cocos2d::CCTouchDispatcher::addTargetedDelegate @ 0x1800b6583
// > cocos2d::CCTouchDispatcher::ownerLevelFor @ 0x1800b6af1
// > cocos2d::CCTouchDispatcher::ownerLevelOf @ 0x1800b6bf9
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2964
//
// This function is hookable on this platform (idp: pc, 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 11:22:22 +0000
//
char __fastcall cocos2d::CCTouchDispatcher::ownerLevelOf(
cocos2d::CCDictionary **this,
struct cocos2d::CCNode *a2,
int *a3)
{
struct cocos2d::CCObject *v6; // rax
struct cocos2d::CCObject *v7; // rax
__int64 v8; // rdx
int v10; // ebp
__int64 v11; // rax
struct cocos2d::CCNode *v12; // rax
int v13; // ecx
unsigned int v14; // ebx
cocos2d::CCDictionary *v15; // rdi
struct cocos2d::CCInteger *v16; // rax
int v17; // [rsp+30h] [rbp+8h] BYREF
if ( !(unsigned int)cocos2d::CCDictionary::count(*(this + 18)) || !a2 )
return 0;
while ( 1 )
{
v6 = cocos2d::CCDictionary::objectForKey(*(this + 18), *((unsigned int *)a2 + 2));
if ( v6 )
{
*a3 = *((_DWORD *)v6 + 14);
return 1;
}
v7 = cocos2d::CCDictionary::objectForKey(*(this + 19), *((unsigned int *)a2 + 2));
v8 = *((unsigned int *)a2 + 2);
if ( v7 )
break;
if ( !cocos2d::CCDictionary::objectForKey(*(this + 17), v8) )
{
a2 = (struct cocos2d::CCNode *)(*(__int64 (__fastcall **)(struct cocos2d::CCNode *))(*(_QWORD *)a2 + 504LL))(a2);
if ( a2 )
continue;
}
return 0;
}
v10 = *((_DWORD *)v7 + 14);
cocos2d::CCDictionary::removeObjectForKey(*(this + 19), v8);
v11 = *(_QWORD *)a2;
v17 = 0;
v12 = (struct cocos2d::CCNode *)(*(__int64 (__fastcall **)(struct cocos2d::CCNode *))(v11 + 504))(a2);
if ( !cocos2d::CCTouchDispatcher::ownerLevelOf((cocos2d::CCTouchDispatcher *)this, v12, &v17) )
return 0;
v13 = v17 - v10;
*a3 = v17 - v10;
v14 = *((_DWORD *)a2 + 2);
v15 = *(this + 18);
v16 = cocos2d::CCInteger::create(v13);
cocos2d::CCDictionary::setObject(v15, v16, v14);
return 1;
}