//
// GJDifficultySprite::updateDifficultyFrame from 0x1002e58bc to 0x1002e59e0 (292 bytes)
//
// 3 xrefs:
// > LevelInfoLayer::updateLabelValues @ 0x100029908
// > RateStarsLayer::selectRating @ 0x100080980
// > GJRateLevelLayer::selectRating @ 0x1001b17b8
//
// 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
//
void __fastcall GJDifficultySprite::updateDifficultyFrame(GJDifficultySprite *a1, int a2, GJDifficultyName a3)
{
cocos2d::CCSpriteFrameCache *v6; // x22
std::string *p_p; // x1
cocos2d::CCSpriteFrame *v8; // x0
float v9; // s8
__n128 v10; // q1
__n128 v11; // q0
unsigned int v12; // w20
__int64 v13; // x0
std::string __p; // [xsp+8h] [xbp-58h] BYREF
v6 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
GJDifficultySprite::getDifficultyFrame(a2, a3, &__p);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
v8 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v6, (const char *)p_p);
((void (__fastcall *)(GJDifficultySprite *, cocos2d::CCSpriteFrame *))a1->setDisplayFrame)(a1, v8);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( a1->m_pChildren )
{
v9 = *(float *)((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1) * 0.5;
v10.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(GJDifficultySprite *))a1->getContentSize)(a1) + 4) * 0.5;
v11.n128_f32[0] = v9;
sub_100022980(v11, v10, &__p);
if ( (unsigned int)sub_10024A36C((__int64)a1->m_pChildren) )
{
v12 = 0;
do
{
v13 = sub_10024A388((__int64)a1->m_pChildren, v12);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v13 + 184LL))(v13, &__p);
++v12;
}
while ( v12 < (unsigned int)sub_10024A36C((__int64)a1->m_pChildren) );
}
}
}