//
// GJGarageLayer::updateRate from 0x1402788d0 to 0x140278b0d (573 bytes)
//
// 3 xrefs:
// > ??> @ 0x14056ad28
// > ??> @ 0x1406d1004
// > ??> @ 0x1406d1010
//
// 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 GJGarageLayer::updateRate(GJGarageLayer *a1)
{
__int64 v1; // rdx
__int64 v3; // rax
cocos2d::CCString *v4; // rax
const char *CString; // rsi
cocos2d::CCString *v6; // rax
const char *v7; // rdi
__int64 v8; // rdx
__int64 *v9; // rcx
__int64 v10; // rbx
cocos2d::CCSpriteFrameCache *v11; // rax
struct cocos2d::CCSpriteFrame *v12; // rax
struct cocos2d::CCSprite *v13; // rdi
float v14; // xmm0_4
cocos2d::CCSprite_vtbl *v15; // rbx
const cocos2d::CCPoint *v16; // rax
__int64 v17; // rcx
__int64 v18; // rax
void *v19; // [rsp+48h] [rbp+10h] BYREF
void *v20; // [rsp+50h] [rbp+18h]
v3 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v19 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = qword_1406C2ED8;
}
if ( *(_BYTE *)(v3 + 676) && *(_QWORD *)&a1->m_obPosition.y )
{
v4 = cocos2d::CCString::createWithFormat("player_%02d_001.png", 13);
CString = cocos2d::CCString::getCString(v4);
v6 = cocos2d::CCString::createWithFormat("player_%02d_2_001.png", 13);
v7 = cocos2d::CCString::getCString(v6);
LOBYTE(v8) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)&a1->m_obPosition.y + 560LL))(
*(_QWORD *)&a1->m_obPosition.y,
v8);
v9 = *(__int64 **)&a1->m_obPosition.y;
v10 = *v9;
v11 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v9);
v12 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v11, CString);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSpriteFrame *))(v10 + 992))(*(_QWORD *)&a1->m_obPosition.y, v12);
v13 = cocos2d::CCSprite::createWithSpriteFrameName(v7);
v14 = (*(float (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64))(**(_QWORD **)&a1->m_obPosition.y + 440LL))(
*(_QWORD *)&a1->m_obPosition.y,
v13,
0xFFFFFFFFLL);
v15 = v13->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v14, *(float *)(*(_QWORD *)&a1->m_obPosition.y + 432LL) * 0.5);
v15->setPosition_0(v13, v16);
LOWORD(v19) = -20561;
BYTE2(v19) = -81;
(**(void (__fastcall ***)(__int64, void **))(*(_QWORD *)&a1->m_obPosition.y + 320LL))(
*(_QWORD *)&a1->m_obPosition.y + 320LL,
&v19);
LOWORD(v19) = -1;
BYTE2(v19) = -1;
v13->setColor(&v13->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v19);
v3 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v20 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v20);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = qword_1406C2ED8;
}
*(_QWORD *)(v3 + 928) = 0;
}
if ( *(_BYTE *)(v3 + 677) )
{
v17 = *(_QWORD *)&a1->m_fVertexZ;
if ( v17 )
{
LOBYTE(v1) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 560LL))(v17, v1);
v18 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v19 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v19);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v18 = qword_1406C2ED8;
}
*(_QWORD *)(v18 + 928) = 0;
}
}
}