//
// GJPathSprite::updateState from 0x140397020 to 0x14039720c (492 bytes)
//
// 3 xrefs:
// > GJPathsLayer::init @ 0x140392d32
// > GJPathPage::init @ 0x140393b24
// > ??> @ 0x14092312c
//
// 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=3
__int64 __fastcall GJPathSprite::updateState(_DWORD *a1)
{
int v3; // ebx
__int64 v4; // rdi
_QWORD *v5; // rax
int Stat; // ebx
signed int v7; // edx
const char *v8; // rax
struct cocos2d::CCLabelBMFont *v9; // rdi
__int64 v10; // rax
__int64 v11; // rbx
__int64 v12; // rax
void *v13; // [rsp+20h] [rbp-48h] BYREF
_BYTE v14[8]; // [rsp+28h] [rbp-40h] BYREF
_BYTE v15[8]; // [rsp+30h] [rbp-38h] BYREF
_QWORD v16[4]; // [rsp+38h] [rbp-30h] BYREF
if ( !qword_14090BFE0 )
{
v13 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
}
if ( !(unsigned __int8)GameStatsManager::isItemUnlocked((__int64)a1, 0xCu, a1[150] + 5) )
return GJPathSprite::changeToLockedArt(a1);
v3 = a1[150];
v4 = qword_14090BFE0;
if ( !qword_14090BFE0 )
{
v13 = operator new(0x3E8u);
qword_14090BFE0 = sub_1402D6480((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);
v4 = qword_14090BFE0;
}
v5 = GameToolbox::intToString(v16, v3 + 29);
if ( v5[3] > 0xFu )
v5 = (_QWORD *)*v5;
Stat = GameStatsManager::getStat(v4, v5);
sub_14003D310((__int64)v16);
v7 = (int)floorf((float)Stat / 100.0);
if ( v7 >= 10 )
return GJPathSprite::addShardSprite(a1);
v8 = (const char *)GameToolbox::intToString(v16, v7);
if ( *((_QWORD *)v8 + 3) > 0xFu )
v8 = *(const char **)v8;
v9 = cocos2d::CCLabelBMFont::create(v8, (const char *)&qword_140704F78);
sub_14003D310((__int64)v16);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v9 + 160LL))(v9);
(*(void (__fastcall **)(_DWORD *, struct cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)a1 + 456LL))(a1, v9, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v14, 0.0, 1.0);
v11 = v10;
cocos2d::CCNode::convertToNodeSpace(a1, v15, &unk_14090AC50);
cocos2d::CCPoint::operator+(v12, &v13, v11);
return (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v9 + 184LL))(v9, &v13);
}