//
// PlayerObject::spawnPortalCircle from 0x1404f5a00 to 0x1404f5c0f (527 bytes)
//
// 15 xrefs:
// > GJBaseGameLayer::teleportPlayer @ 0x14031627b
// > GJBaseGameLayer::teleportPlayer @ 0x140316350
// > GJBaseGameLayer::toggleDualMode @ 0x14031e28d
// > GJBaseGameLayer::toggleFlipped @ 0x140350bcb
// > GJBaseGameLayer::toggleFlipped @ 0x140350c21
// > PlayerObject::flipGravity @ 0x1404f85b9
// > PlayerObject::toggleFlyMode @ 0x1404f8a5a
// > PlayerObject::toggleBirdMode @ 0x1404f8d64
// > PlayerObject::toggleSwingMode @ 0x1404f8eff
// > PlayerObject::toggleDartMode @ 0x1404f9381
// > PlayerObject::toggleRollMode @ 0x1404f9931
// > PlayerObject::toggleRobotMode @ 0x1404f9c19
// > PlayerObject::toggleSpiderMode @ 0x1404f9fdc
// > PlayerObject::togglePlayerScale @ 0x1404ff293
// > ??> @ 0x14092a134
//
// 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:33:20 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall PlayerObject::spawnPortalCircle(__int64 a1, __int64 a2)
{
__int64 v4; // r8
__int64 v5; // rdx
__int64 v6; // rcx
__int64 v7; // r8
struct cocos2d::CCObject *v8; // rdi
cocos2d::CCObject *v9; // rbx
cocos2d::CCObject *v10; // rcx
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rdx
__int64 v14; // rax
__int64 v15; // rcx
void *v16; // [rsp+50h] [rbp+8h]
void *v17; // [rsp+50h] [rbp+8h]
if ( *(_BYTE *)(a1 + 2028) && !*(_BYTE *)(a1 + 2025) )
{
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v16 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
if ( !*(_BYTE *)(*(_QWORD *)(v4 + 560) + 13085LL)
&& !*(_BYTE *)(v4 + 957)
&& !cocos2d::CCPoint::equals((cocos2d::CCPoint *)(a1 + 2568), (const struct cocos2d::CCPoint *)&unk_14090B428) )
{
v8 = CCCircleWave::create(v6, v5, v7, 1, 1);
*((_WORD *)v8 + 170) = *(_WORD *)a2;
*((_BYTE *)v8 + 342) = *(_BYTE *)(a2 + 2);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v8 + 184LL))(v8, a1 + 2568);
v9 = *(cocos2d::CCObject **)(a1 + 2696);
if ( v9 )
{
v10 = *((cocos2d::CCObject **)v8 + 40);
if ( v10 )
cocos2d::CCObject::release(v10);
*((_QWORD *)v8 + 40) = v9;
cocos2d::CCObject::retain(v9);
cocos2d::CCNode::unschedule(v8, CCCircleWave::updatePosition);
v11 = *(_QWORD *)v8;
v12 = (*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)v8 + 40) + 200LL))(*((_QWORD *)v8 + 40));
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v11 + 184))(v8, v12);
v13 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v17 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v13 = qword_14090BFD0;
}
v14 = *(_QWORD *)(v13 + 560);
v15 = v14 + 14648;
if ( !v14 )
v15 = 0;
*((_QWORD *)v8 + 46) = v15;
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(*(_QWORD *)(v13 + 560) + 14952LL), v8);
}
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCObject *, _QWORD))(**(_QWORD **)(a1 + 3120) + 456LL))(
*(_QWORD *)(a1 + 3120),
v8,
0);
}
}
}