//
// GJPathSprite::changeToLockedArt from 0x140289400 to 0x1402896c0 (704 bytes)
//
// 4 xrefs:
// > GJPathPage::playUnlockAnimation @ 0x140287efe
// > GJPathSprite::updateState @ 0x14028928f
// > ??> @ 0x1406d1610
// > ??> @ 0x1406d161c
//
// 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=2
void GJPathSprite::changeToLockedArt(GJPathSprite *a1)
{
cocos2d::CCString *v2; // rax
const char *CString; // rax
size_t v4; // r8
void **v5; // rdx
size_t v6; // r8
CCSpriteWithHue *v7; // rdi
void *v8; // rcx
CCSpriteWithHue_vtbl *v9; // rbx
struct cocos2d::CCPoint v10; // rax
float v11; // xmm0_4
float v12; // xmm0_4
struct cocos2d::CCSprite *v13; // rdi
float v14; // xmm0_4
struct cocos2d::CCPoint v15; // rax
void *v16; // rcx
_WORD v17[2]; // [rsp+20h] [rbp-19h] BYREF
struct cocos2d::CCPoint v18; // [rsp+24h] [rbp-15h] BYREF
struct cocos2d::CCPoint v19; // [rsp+34h] [rbp-5h] BYREF
void *Block[2]; // [rsp+40h] [rbp+7h] BYREF
__m128i si128; // [rsp+50h] [rbp+17h]
void *v22[2]; // [rsp+60h] [rbp+27h] BYREF
__int128 v23; // [rsp+70h] [rbp+37h]
v2 = cocos2d::CCString::createWithFormat("pathIcon_%02d_001.png", a1->m_pathNumber);
CString = cocos2d::CCString::getCString(v2);
*(_OWORD *)v22 = 0;
v23 = 0;
v4 = -1;
do
++v4;
while ( CString[v4] );
sub_14003A930(v22, CString, v4);
a1->m_bDontDraw = 1;
v5 = v22;
if ( *((_QWORD *)&v23 + 1) > 0xFu )
v5 = (void **)v22[0];
*(_OWORD *)Block = 0;
si128 = 0;
v6 = -1;
do
++v6;
while ( *((_BYTE *)v5 + v6) );
sub_14003A930(Block, v5, v6);
v7 = CCSpriteGrayscale::createWithSpriteFrameName((__int64)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v8 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v8);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
a1->addChild_0(a1, v7, -1);
v9 = v7->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v10 = cocos2d::CCNode::convertToNodeSpace(a1, &v18);
((void (__fastcall *)(CCSpriteWithHue *, struct cocos2d::CCPoint))v9->setPosition_0)(v7, v10);
v11 = 3.0;
switch ( a1->m_pathNumber )
{
case 3:
v11 = 4.5;
break;
case 6:
LABEL_16:
v11 = 4.0;
break;
case 7:
v11 = 5.0;
break;
case 8:
goto LABEL_16;
default:
break;
}
v12 = v11 * 0.33000001;
v7->m_luminance._Elems[0] = v12;
v7->m_luminance._Elems[1] = v12;
v7->m_luminance._Elems[2] = v12;
memset(v17, 40, 3);
v7->setColor(&v7->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)v17);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)&xmmword_14053DE08);
v14 = ((float (__fastcall *)(GJPathSprite *, struct cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v13, 1);
cocos2d::CCPoint::CCPoint(v14, 0.0);
v15 = cocos2d::CCNode::convertToNodeSpace(a1, &v19);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator+)(v15, &v18);
v13->setPosition_0(v13, &v18);
((void (__fastcall *)(struct cocos2d::CCSprite *))v13->setScale_0)(v13);
v17[0] = -14136;
LOBYTE(v17[1]) = -56;
v13->setColor(&v13->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)v17);
if ( *((_QWORD *)&v23 + 1) > 0xFu )
{
v16 = v22[0];
if ( (unsigned __int64)(*((_QWORD *)&v23 + 1) + 1LL) >= 0x1000 )
{
v16 = *((void **)v22[0] - 1);
if ( (unsigned __int64)((char *)v22[0] - (char *)v16 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v16);
}
}