//
// GJDifficultySprite::getDifficultyFrame from 0x1002b6b80 to 0x1002b6c91 (273 bytes)
//
// 3 xrefs:
// > GJDifficultySprite::create @ 0x1002b6a95
// > GJDifficultySprite::init @ 0x1002b6b20
// > GJDifficultySprite::updateDifficultyFrame @ 0x1002b6cda
//
// 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
//
std::string *__fastcall GJDifficultySprite::getDifficultyFrame(std::string *this, int a2, int a3, double a4)
{
int v5; // r14d
cocos2d::CCString *v6; // rax
const char *CString; // r13
size_t v8; // rax
std::string::size_type v9; // r12
char *data; // r15
size_t v11; // r14
char v13; // [rsp+0h] [rbp-40h]
int v14; // [rsp+14h] [rbp-2Ch]
v5 = a2;
v6 = (cocos2d::CCString *)sub_1007AB580("difficulty_%02d_", v13);
CString = cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a4);
v9 = v8;
v14 = a3;
if ( v8 >= 0x17 )
{
v11 = 26;
if ( (v8 | 7) != 0x17 )
v11 = (v8 | 7) + 1;
data = (char *)operator new(v11);
this->__r_.__value_.__r.__words[2] = (std::string::size_type)data;
this->__r_.__value_.__r.__words[0] = v11 + 1;
v5 = a2;
this->__r_.__value_.__l.__size_ = v9;
goto LABEL_8;
}
this->__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8);
data = this->__r_.__value_.__s.__data_;
if ( v8 )
LABEL_8:
memmove(data, CString, v9);
data[v9] = 0;
if ( v14 != 1 || (unsigned int)(v5 - 6) >= 5 )
{
std::string::append(this, "btn_001.png");
if ( v5 == -1 )
std::string::assign(this, "difficulty_auto_btn_001.png");
}
else
{
std::string::append(this, "btn2_001.png");
}
return this;
}