//
// GJDifficultySprite::init from 0x8d9dc4 to 0x8d9eb4 (240 bytes)
//
// 2 xrefs:
// > GJDifficultySprite::create @ 0x8d9f0c
// > ??> @ 0x864a8
//
// 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
//
bool GJDifficultySprite::init(GJDifficultySprite *a1, int a2, GJDifficultyName a3)
{
bool v4; // w20
char *v5; // x0
unsigned int *v7; // x2
int v8; // w1
char *v9; // [xsp+30h] [xbp+30h] BYREF
GJDifficultySprite::getDifficultyFrame(a2, a3, (__int64)&v9);
v4 = cocos2d::CCSprite::initWithSpriteFrameName(a1, v9);
v5 = v9 - 24;
if ( v9 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v5);
}
return v4;
}