//
// RingObject::spawnCircle from 0x1404a1db0 to 0x1404a1faf (511 bytes)
//
// 2 xrefs:
// > RingObject::powerOnObject @ 0x1404a1d96
// > ??> @ 0x1406dc734
//
// 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=4
void RingObject::spawnCircle(RingObject *a1)
{
__int64 v2; // rax
CCCircleWave *v3; // rdi
CCCircleWave_vtbl *v4; // rbx
const cocos2d::CCPoint *v5; // rax
__int64 v6; // rax
cocos2d::CCObject *m_target; // rcx
CCCircleWave_vtbl *v8; // rbx
__int64 v9; // rax
cocos2d::CCPoint v10; // r9
__int64 v11; // rdx
CCCircleWaveDelegate *v12; // rcx
CCCircleWaveDelegate *v13; // rax
void *v14; // [rsp+48h] [rbp+10h]
void *v15; // [rsp+48h] [rbp+10h]
void *v16; // [rsp+48h] [rbp+10h]
v2 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v14 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = qword_1406C2ED8;
}
if ( *(_QWORD *)(v2 + 520) && !a1->m_hasNoEffects && a1->m_objectID != 3643 )
{
v3 = CCCircleWave::create(5.0, 55.0, 0.25, 0, 1);
v4 = v3->__vftable;
v5 = a1->getPosition_0(a1);
v4->setPosition_0(v3, v5);
v6 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v15 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v6 = qword_1406C2ED8;
}
(*(void (__fastcall **)(_QWORD, CCCircleWave *, _QWORD))(**(_QWORD **)(*(_QWORD *)(v6 + 520) + 4072LL) + 440LL))(
*(_QWORD *)(*(_QWORD *)(v6 + 520) + 4072LL),
v3,
0);
v3->m_circleMode = Outline;
m_target = v3->m_target;
if ( m_target )
cocos2d::CCObject::release(m_target);
v3->m_target = a1;
cocos2d::CCObject::retain(a1);
cocos2d::CCNode::unschedule(v3, CCCircleWave::updatePosition);
cocos2d::CCNode::schedule(v3, CCCircleWave::updatePosition);
v8 = v3->__vftable;
v9 = (__int64)v3->m_target->getPosition_0(v3->m_target);
v8->setPosition_0(v3, (const cocos2d::CCPoint *)v9);
v11 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v16 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v11 = qword_1406C2ED8;
}
v12 = *(CCCircleWaveDelegate **)(v11 + 520);
v13 = v12 + 1780;
if ( !v12 )
v13 = nullptr;
v3->m_delegate = v13;
cocos2d::CCArray::addObject(*(SetupTriggerPopup **)(*(_QWORD *)(v11 + 520) + 14520LL), v3, nullptr, v10);
}
}