//
// GJPathSprite::init from 0xba4304 to 0xba444c (328 bytes)
//
// 2 xrefs:
// > GJPathSprite::create @ 0xba44a4
// > ??> @ 0xfef50
//
// This function is hookable on this platform (idp: arm, 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 13:02:48 +0000
//
__int64 __fastcall GJPathSprite::init(GJPathSprite *this, const char *a2)
{
int v3; // w24
cocos2d::CCString *v4; // x0
const char *CString; // x25
size_t v6; // x0
size_t v7; // x20
unsigned __int64 v8; // x0
char *v9; // x3
char *v10; // x1
unsigned __int8 v11; // w0
unsigned int v12; // w19
__int64 v14; // [xsp+50h] [xbp+50h] BYREF
size_t v15; // [xsp+58h] [xbp+58h]
char *v16; // [xsp+60h] [xbp+60h]
v3 = (int)a2;
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"pathIcon_%02d_001.png", a2);
v14 = 0;
CString = (const char *)cocos2d::CCString::getCString(v4);
v15 = 0;
v16 = nullptr;
v6 = strlen(CString);
v7 = v6;
if ( v6 > 0xFFFFFFFFFFFFFFEFLL )
sub_62F79C();
if ( v6 > 0x16 )
{
v8 = (v6 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v14 = v8 | 1;
v9 = (char *)operator new(v8);
v16 = v9;
v15 = v7;
LABEL_4:
v9 = (char *)memcpy(v9, CString, v7);
goto LABEL_5;
}
LOBYTE(v14) = 2 * v6;
v9 = (char *)&v14 + 1;
if ( v6 )
goto LABEL_4;
LABEL_5:
v9[v7] = 0;
v10 = (char *)&v14 + 1;
if ( (v14 & 1) != 0 )
v10 = v16;
v11 = cocos2d::CCSprite::initWithSpriteFrameName(this, v10);
v12 = v11;
if ( v11 )
*((_DWORD *)this + 149) = v3;
if ( (v14 & 1) != 0 )
operator delete(v16);
return v12;
}