//
// EndPortalObject::setPosition from 0x140138260 to 0x1401383ba (346 bytes)
//
// 2 xrefs:
// > ??> @ 0x140556bd8
// > ??> @ 0x1406ca0a4
//
// 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
//
// Hidden C++ exception states: #wind=1
void EndPortalObject::setPosition(EndPortalObject *a1, const cocos2d::CCPoint *a2)
{
float v4; // xmm8_4
__int64 v5; // rax
const cocos2d::CCPoint *v6; // rax
char v7; // [rsp+60h] [rbp+8h] BYREF
void *v8; // [rsp+70h] [rbp+18h] BYREF
cocos2d::CCPoint v9; // [rsp+78h] [rbp+20h] BYREF
GameObject::setPosition(a1, a2);
if ( a1->m_gradientBar )
{
if ( a1->m_flippedX )
v4 = -1.0;
else
v4 = 1.0;
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v8 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
cocos2d::CCPoint::CCPoint(&v9, (float)(-14.0 - (float)(15.0 / *(float *)(*(_QWORD *)(v5 + 520) + 424LL))) * v4, 0.0);
cocos2d::CCPoint::operator+(a2, &v7);
a1->m_gradientBar->setPosition_0(a1->m_gradientBar, (const cocos2d::CCPoint *)&v7);
}
if ( a1->m_particle )
{
cocos2d::CCPoint::operator*(&a1->m_particleOffset, &v7);
v6 = a1->getPosition_0(a1);
cocos2d::CCPoint::operator+(v6, &v8);
a1->m_particle->setPosition_0(a1->m_particle, (const cocos2d::CCPoint *)&v8);
}
}