//
// GJPathSprite::changeToLockedArt from 0x140397210 to 0x1403974fc (748 bytes)
//
// 3 xrefs:
// > GJPathPage::playUnlockAnimation @ 0x140395c83
// > GJPathSprite::updateState @ 0x140397092
// > ??> @ 0x140923138
//
// 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 11:31:13 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall GJPathSprite::changeToLockedArt(__int64 a1)
{
cocos2d::CCString *v2; // rax
const char *CString; // rax
size_t v4; // r8
void **v5; // rdx
size_t v6; // r8
cocos2d::CCSprite *v7; // rdi
void *v8; // r8
__int64 v9; // rbx
__int64 v10; // rax
float v11; // xmm0_4
float v12; // xmm0_4
struct cocos2d::CCSprite *v13; // rdi
__int64 v14; // rax
__int64 v15; // rbx
__int64 v16; // rax
void *v17; // rcx
_WORD v18[2]; // [rsp+30h] [rbp-19h] BYREF
_BYTE v19[8]; // [rsp+34h] [rbp-15h] BYREF
_BYTE v20[8]; // [rsp+3Ch] [rbp-Dh] BYREF
_BYTE v21[12]; // [rsp+44h] [rbp-5h] BYREF
void *Block[2]; // [rsp+50h] [rbp+7h] BYREF
__m128i si128; // [rsp+60h] [rbp+17h]
void *v24[2]; // [rsp+70h] [rbp+27h] BYREF
__int128 v25; // [rsp+80h] [rbp+37h]
v2 = cocos2d::CCString::createWithFormat("pathIcon_%02d_001.png", *(_DWORD *)(a1 + 600));
CString = cocos2d::CCString::getCString(v2);
*(_OWORD *)v24 = 0;
v25 = 0;
v4 = -1;
do
++v4;
while ( CString[v4] );
sub_14003D230(v24, CString, v4);
*(_BYTE *)(a1 + 559) = 1;
v5 = v24;
if ( *((_QWORD *)&v25 + 1) > 0xFu )
v5 = (void **)v24[0];
*(_OWORD *)Block = 0;
si128 = 0;
v6 = -1;
do
++v6;
while ( *((_BYTE *)v5 + v6) );
sub_14003D230(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 )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v8);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
(*(void (__fastcall **)(__int64, cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v7, 0xFFFFFFFFLL);
v9 = *(_QWORD *)v7;
cocos2d::CCNode::convertToNodeSpace(a1, v19, &unk_14090AC50);
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(v9 + 184))(v7, v10);
v11 = 3.0;
switch ( *(_DWORD *)(a1 + 600) )
{
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;
*((float *)v7 + 151) = v12;
*((float *)v7 + 152) = v12;
*((float *)v7 + 153) = v12;
memset(v18, 40, 3);
(**((void (__fastcall ***)(__int64, _WORD *))v7 + 40))((__int64)v7 + 320, v18);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)&xmmword_14071C878);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v13, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20, 0.0, 0.0);
v15 = v14;
cocos2d::CCNode::convertToNodeSpace(a1, v21, &unk_14090AC50);
cocos2d::CCPoint::operator+(v16, v19, v15);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, _BYTE *))(*(_QWORD *)v13 + 184LL))(v13, v19);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v13 + 160LL))(v13);
v18[0] = -14136;
LOBYTE(v18[1]) = -56;
(**((void (__fastcall ***)(__int64, _WORD *))v13 + 40))((__int64)v13 + 320, v18);
if ( *((_QWORD *)&v25 + 1) > 0xFu )
{
v17 = v24[0];
if ( (unsigned __int64)(*((_QWORD *)&v25 + 1) + 1LL) >= 0x1000 )
{
v17 = *((void **)v24[0] - 1);
if ( (unsigned __int64)((char *)v24[0] - (char *)v17 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v17);
}
}