//
// PlayerObject::updatePlayerSwingFrame from 0x14039e7b0 to 0x14039e9d4 (548 bytes)
//
// 3 xrefs:
// > MenuGameLayer::resetPlayer @ 0x1403330c1
// > PlayerObject::toggleSwingMode @ 0x14039ac1c
// > ??> @ 0x1406d6794
//
// 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
//
void PlayerObject::updatePlayerSwingFrame(PlayerObject *a1, int a2)
{
int v3; // eax
int v4; // r14d
GameManager *v5; // rcx
cocos2d::CCString *v6; // rax
const char *CString; // rdi
cocos2d::CCString *v8; // rax
const char *v9; // rsi
cocos2d::CCString *v10; // rax
const char *v11; // rbp
cocos2d::CCSprite *m_iconSprite; // rcx
cocos2d::CCSprite_vtbl *v13; // rbx
cocos2d::CCSpriteFrameCache *v14; // rax
struct cocos2d::CCSpriteFrame *v15; // rax
cocos2d::CCSprite_vtbl *v16; // rbx
__int64 v17; // rcx
cocos2d::CCSpriteFrameCache *v18; // rax
struct cocos2d::CCSpriteFrame *v19; // rax
cocos2d::CCSprite_vtbl *v20; // rbx
__int64 v21; // rcx
cocos2d::CCSpriteFrameCache *v22; // rax
struct cocos2d::CCSpriteFrame *v23; // rax
const struct cocos2d::CCSize *v24; // rax
double v25; // xmm0_8
cocos2d::CCSprite_vtbl *v26; // rbx
const cocos2d::CCPoint *v27; // rax
cocos2d::CCString *v28; // rax
const char *v29; // rax
size_t v30; // r8
__int128 v31; // [rsp+20h] [rbp-48h] BYREF
__int64 v32; // [rsp+30h] [rbp-38h]
__int64 v33; // [rsp+38h] [rbp-30h]
cocos2d::CCSize v34; // [rsp+70h] [rbp+8h] BYREF
void *v35; // [rsp+80h] [rbp+18h]
v3 = 43;
if ( a2 < 43 )
v3 = a2;
v4 = 1;
if ( v3 > 1 )
v4 = v3;
v5 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v35 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v35);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = (GameManager *)qword_1406C2ED8;
}
GameManager::loadIcon(v5, v4, 7, a1->m_iconRequestID);
v6 = cocos2d::CCString::createWithFormat("swing_%02d_001.png", v4);
CString = cocos2d::CCString::getCString(v6);
v8 = cocos2d::CCString::createWithFormat("swing_%02d_2_001.png", v4);
v9 = cocos2d::CCString::getCString(v8);
v10 = cocos2d::CCString::createWithFormat("swing_%02d_glow_001.png", v4);
v11 = cocos2d::CCString::getCString(v10);
m_iconSprite = a1->m_iconSprite;
v13 = m_iconSprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(m_iconSprite);
v15 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, CString);
v13->setDisplayFrame(a1->m_iconSprite, v15);
v16 = a1->m_iconSpriteSecondary->__vftable;
v18 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v17);
v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v18, v9);
v16->setDisplayFrame(a1->m_iconSpriteSecondary, v19);
v20 = a1->m_iconGlow->__vftable;
v22 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v21);
v23 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v22, v11);
v20->setDisplayFrame(a1->m_iconGlow, v23);
v24 = a1->m_iconSprite->getContentSize(a1->m_iconSprite);
v25 = cocos2d::CCSize::CCSize(&v34, v24);
v26 = a1->m_iconSpriteSecondary->__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v25, v34.width * 0.5);
v26->setPosition_0(a1->m_iconSpriteSecondary, v27);
v28 = cocos2d::CCString::createWithFormat("swing_%02d_extra_001.png", v4);
v29 = cocos2d::CCString::getCString(v28);
v31 = 0;
v32 = 0;
v33 = 0;
v30 = -1;
do
++v30;
while ( v29[v30] );
sub_14003A930(&v31, v29, v30);
PlayerObject::updatePlayerSpriteExtra(a1, &v31);
}