//
// PlayerObject::toggleBirdMode from 0x100403c10 to 0x100404058 (1096 bytes)
//
// 13 xrefs:
// > GJBaseGameLayer::setupLevelStart @ 0x100101419
// > GJBaseGameLayer::setupLevelStart @ 0x1001016c6
// > GJBaseGameLayer::switchToFlyMode @ 0x100101c89
// > PlayerObject::switchedToMode @ 0x1003ffd86
// > PlayerObject::switchedToMode @ 0x1003ffda3
// > PlayerObject::toggleFlyMode @ 0x10040315b
// > PlayerObject::toggleSwingMode @ 0x100404364
// > PlayerObject::toggleDartMode @ 0x100404d74
// > PlayerObject::toggleRollMode @ 0x1004053b3
// > PlayerObject::toggleRobotMode @ 0x1004057a6
// > PlayerObject::toggleSpiderMode @ 0x100405c16
// > PlayerObject::copyAttributes @ 0x1004084a6
// > MenuGameLayer::resetPlayer @ 0x1004f9652
//
// 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 12:30:04 +0000
//
void __fastcall PlayerObject::toggleBirdMode(__int64 a1, char a2, char a3, double a4, double a5, double a6, __m128 a7)
{
__int64 v10; // rsi
__int64 v11; // xmm0_8
__int64 v12; // rdi
__int64 v13; // r12
__int64 v14; // rax
__int64 v15; // r12
__int64 v16; // r12
__int64 v17; // r12
__int64 v18; // r12
__m128 v19; // xmm0
__m128 v20; // xmm1
_OWORD v21[3]; // [rsp+8h] [rbp-38h] BYREF
if ( *(_BYTE *)(a1 + 2418) != a2 )
{
*(_QWORD *)(a1 + 1960) = *(_QWORD *)(a1 + 2624);
*(_BYTE *)(a1 + 2418) = a2;
if ( a2 )
{
PlayerObject::toggleFlyMode(a1, 0, 0);
if ( *(_BYTE *)(a1 + 2419) )
{
*(_QWORD *)(a1 + 1960) = *(_QWORD *)(a1 + 2624);
*(_BYTE *)(a1 + 2419) = 0;
if ( *(float *)(a1 + 2472) == 1.0 || (v10 = 0, !*(_BYTE *)(a1 + 2648)) )
v10 = *(unsigned int *)(a1 + 1560);
PlayerObject::updatePlayerFrame(a1, v10);
if ( *(_BYTE *)(a1 + 2423) )
v11 = 1127481344;
else
v11 = 0;
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)a1 + 360LL))(a1, *(double *)&v11);
*(_WORD *)(a1 + 1784) = 0;
*(_BYTE *)(a1 + 1640) = 0;
*(_DWORD *)(a1 + 1776) = 0;
}
PlayerObject::toggleDartMode(a1, 0, 0);
PlayerObject::toggleRobotMode(a1, 0, 0);
PlayerObject::toggleSpiderMode(a1, 0, 0);
PlayerObject::toggleSwingMode(a1, 0, 0);
}
*(_WORD *)(a1 + 1784) = 0;
*(_BYTE *)(a1 + 1640) = 0;
*(_DWORD *)(a1 + 1776) = 0;
*(double *)(a1 + 2392) = *(double *)(a1 + 2392) * 0.5;
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)a1 + 360LL))(a1, 0.0);
*(_BYTE *)(a1 + 2500) = 0;
*(_BYTE *)(a1 + 2425) = 0;
*(_BYTE *)(a1 + 1971) = 0;
v12 = *(_QWORD *)(a1 + 2120);
if ( v12 )
{
v13 = sub_1005DDE90(v12);
GameObject::removeGlow(v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v13 + 536LL))(v13);
cocos2d::CCObject::release(*(_QWORD *)(a1 + 2120));
*(_QWORD *)(a1 + 2120) = 0;
}
if ( *(_BYTE *)(a1 + 2418) != 1 )
{
PlayerObject::resetPlayerIcon(a1);
if ( !a2 )
return;
goto LABEL_24;
}
v14 = GameManager::sharedState();
PlayerObject::updatePlayerBirdFrame(a1, (unsigned int)(*(_DWORD *)(v14 + 752) - *(_DWORD *)(v14 + 756)));
if ( *(_BYTE *)(a1 + 2832) == 1 )
{
v15 = *(_QWORD *)(a1 + 1800);
cocos2d::CCNode::stopActionByTag(v15, 13);
cocos2d::CCNode::stopActionByTag(v15, 14);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 160LL))(v15, 1.0);
v16 = *(_QWORD *)(a1 + 1824);
cocos2d::CCNode::stopActionByTag(v16, 13);
cocos2d::CCNode::stopActionByTag(v16, 14);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 1.0);
}
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 1800) + 160LL))(*(_QWORD *)(a1 + 1800), 0.55000001);
v17 = *(_QWORD *)(a1 + 1800);
sub_100278250((float *)v21, 0.0, 5.0);
(*(void (__fastcall **)(__int64, _OWORD *))(*(_QWORD *)v17 + 184LL))(v17, v21);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1832) + 344LL))(*(_QWORD *)(a1 + 1832), 1);
v18 = *(_QWORD *)(a1 + 1832);
sub_100278250((float *)v21, 0.0, -7.0);
(*(void (__fastcall **)(__int64, _OWORD *))(*(_QWORD *)v18 + 184LL))(v18, v21);
PlayerObject::updatePlayerGlow(a1);
v19 = 0;
v20 = 0;
v20.f32[0] = (float)(unsigned __int8)*(_WORD *)(a1 + 2605) / 255.0;
a7.f32[0] = (float)HIBYTE(*(unsigned __int16 *)(a1 + 2605)) / 255.0;
v19.f32[0] = (float)*(unsigned __int8 *)(a1 + 2607) / 255.0;
v21[0] = _mm_movelh_ps(_mm_insert_ps(v20, a7, 16), _mm_blend_ps(v19, (__m128)xmmword_100A03610, 14));
(*(void (__fastcall **)(_QWORD, _OWORD *))(**(_QWORD **)(a1 + 2168) + 1360LL))(*(_QWORD *)(a1 + 2168), v21);
(*(void (__fastcall **)(_QWORD, _OWORD *))(**(_QWORD **)(a1 + 2168) + 1392LL))(*(_QWORD *)(a1 + 2168), v21);
if ( *(_BYTE *)(a1 + 1787) )
{
if ( *(_BYTE *)(a1 + 1974) != 1 )
goto LABEL_19;
}
else
{
cocos2d::CCParticleSystem::resetSystem(*(_QWORD *)(a1 + 2168));
if ( *(_BYTE *)(a1 + 1974) != 1 )
{
LABEL_19:
*(_BYTE *)(a1 + 1974) = 0;
if ( a3 )
goto LABEL_21;
goto LABEL_20;
}
}
cocos2d::CCParticleSystem::stopSystem(*(_QWORD *)(a1 + 2160));
*(_BYTE *)(a1 + 1974) = 0;
if ( a3 )
{
LABEL_21:
PlayerObject::activateStreak(a1);
GJActionManager::stopInternalAction(*(_QWORD *)(a1 + 3032), 6);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 128LL))(a1, *(float *)(a1 + 2472));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 144LL))(a1, *(float *)(a1 + 2472));
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1848) + 344LL))(*(_QWORD *)(a1 + 1848), 1);
if ( !a2 )
return;
LABEL_24:
PlayerObject::updatePlayerArt(a1);
PlayerObject::updateDashArt(a1);
return;
}
LABEL_20:
PlayerObject::spawnPortalCircle(a1, 51455, 50.0);
goto LABEL_21;
}
}