//
// CharacterColorPage::toggleShip from 0xb511b8 to 0xb51278 (192 bytes)
//
// 3 xrefs:
// > ??> @ 0x4c0a8
// > CharacterColorPage::init @ 0xb52c10
// > ??> @ 0x1541878
//
// This function is hookable on this platform (idp: arm, 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 13:01:59 +0000
//
__int64 __fastcall CharacterColorPage::toggleShip(CharacterColorPage *this, cocos2d::CCObject *a2)
{
__int64 v3; // x20
GameManager *v4; // x0
__int64 v5; // x0
long double v6; // q0
unsigned int v7; // w21
int v8; // w2
int v9; // w1
__int64 v11; // x0
long double v12; // [xsp+30h] [xbp+30h]
v3 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 1072LL))(a2);
v4 = (GameManager *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)v4 == 1 )
{
v11 = GameManager::sharedState(v4);
v7 = 8;
LODWORD(v6) = 1065772646;
v8 = 8;
v9 = *(_DWORD *)(v11 + 884) - *(_DWORD *)(v11 + 888);
}
else
{
v5 = GameManager::sharedState(v4);
LODWORD(v6) = 1066611507;
v7 = 1;
v8 = 1;
v9 = *(_DWORD *)(v5 + 728) - *(_DWORD *)(v5 + 732);
}
v12 = v6;
SimplePlayer::updatePlayerFrame(v3, v9, v8);
(*(void (__fastcall **)(__int64, long double))(*(_QWORD *)v3 + 160LL))(v3, v12);
return (*(__int64 (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)a2 + 72LL))(a2, v7);
}