//
// cocos2d::CCEGLViewProtocol::handleTouchesBegin from 0xb0a348 to 0xb0a604 (700 bytes)
//
// 3 xrefs:
// > ??> @ 0x74ee0
// > ??> @ 0x1217cd0
// > ??> @ 0x1217dc0
//
// 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::CCEGLViewProtocol::handleTouchesBegin(
cocos2d::CCEGLViewProtocol *a1,
int a2,
int *a3,
float *a4,
float *a5,
double a6)
{
__int64 v11; // x20
__int64 v12; // x25
intptr_t v13; // x19
float v14; // s9
float v15; // s8
__int64 v16; // x26
float v17; // s9
float v18; // s8
float m_fScaleX; // s1
float m_fScaleY; // s0
float v21; // s9
float v22; // s8
float v23; // s0
float v24; // s1
int v25; // w0
__int64 v26; // x28
int v27; // [xsp+9Ch] [xbp+9Ch]
cocos2d::CCSet v29; // [xsp+B8h] [xbp+B8h] BYREF
cocos2d::CCSet::CCSet(&v29);
if ( a2 > 0 )
{
v11 = (unsigned int)(a2 - 1) + 1LL;
v12 = 0;
while ( 1 )
{
v13 = a3[v12];
v14 = a4[v12];
v15 = a5[v12];
if ( cocos2d::CCDictionary::objectForKey(&stru_12456B8, v13) )
goto LABEL_3;
if ( (dword_1245728 & 1) == 0 )
{
v27 = 0;
goto LABEL_11;
}
if ( (dword_1245728 & 2) == 0 )
{
v27 = 1;
goto LABEL_11;
}
if ( (dword_1245728 & 4) == 0 )
{
v27 = 2;
goto LABEL_11;
}
if ( (dword_1245728 & 8) == 0 )
{
v27 = 3;
goto LABEL_11;
}
if ( (dword_1245728 & 0x10) != 0 )
{
LABEL_3:
if ( ++v12 == v11 )
break;
}
else
{
v27 = 4;
LABEL_11:
dword_1245728 |= 1 << v27;
v16 = operator new(0x60u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v16);
*(_DWORD *)(v16 + 56) = 0;
*(_BYTE *)(v16 + 60) = 0;
*(_QWORD *)v16 = &off_1217BE0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v16 + 64));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v16 + 72));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)(v16 + 80));
v17 = v14 - a1->m_obViewPortRect.origin.x;
v18 = v15 - a1->m_obViewPortRect.origin.y;
m_fScaleX = a1->m_fScaleX;
m_fScaleY = a1->m_fScaleY;
*(_DWORD *)(v16 + 56) = v27;
v21 = v17 / m_fScaleX;
qword_1245700[v27] = v16;
*(_QWORD *)(v16 + 88) = 0;
v22 = v18 / m_fScaleY;
cocos2d::CCPoint::operator=((cocos2d::CCPoint *)(v16 + 80), m_fScaleY, m_fScaleX, (float *)(v16 + 72));
v25 = *(unsigned __int8 *)(v16 + 60);
*(float *)(v16 + 72) = v21;
*(float *)(v16 + 76) = v22;
if ( !v25 )
{
cocos2d::CCPoint::operator=((cocos2d::CCPoint *)(v16 + 64), v23, v24, (float *)(v16 + 72));
*(_BYTE *)(v16 + 60) = 1;
}
++v12;
*(double *)(v16 + 88) = a6;
v26 = operator new(0x40u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v26);
*(_DWORD *)(v26 + 56) = v27;
*(_QWORD *)v26 = &off_1148430;
cocos2d::CCDictionary::setObject(&stru_12456B8, (cocos2d::CCObject *)v26, v13);
cocos2d::CCSet::addObject(&v29, (cocos2d::CCObject *)v16);
cocos2d::CCObject::release((cocos2d::CCObject *)v26);
if ( v12 == v11 )
break;
}
}
}
if ( cocos2d::CCSet::count(&v29) )
a1->m_pDelegate->touchesBegan(a1->m_pDelegate, &v29, nullptr);
cocos2d::CCSet::~CCSet(&v29);
}