//
// GJDifficultySprite::getDifficultyFrame from 0x1002a4c00 to 0x1002a4d11 (273 bytes)
//
// 3 xrefs:
// > GJDifficultySprite::create @ 0x1002a4b15
// > GJDifficultySprite::init @ 0x1002a4ba0
// > GJDifficultySprite::updateDifficultyFrame @ 0x1002a4d5a
//
// 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 12:27:55 +0000
//
std::string *__fastcall GJDifficultySprite::getDifficultyFrame(std::string *this, int a2, int a3)
{
int v4; // r14d
__int64 v5; // rax
const char *CString; // r13
size_t v7; // rax
std::string::size_type v8; // r12
char *data; // r15
size_t v10; // r14
char v12; // [rsp+0h] [rbp-40h]
int v13; // [rsp+14h] [rbp-2Ch]
v4 = a2;
v5 = sub_10088E820("difficulty_%02d_", v12);
CString = (const char *)cocos2d::CCString::getCString(v5);
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v8 = v7;
v13 = a3;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
data = (char *)operator new(v10);
this->__r_.__value_.__r.__words[2] = (std::string::size_type)data;
this->__r_.__value_.__r.__words[0] = v10 + 1;
v4 = a2;
this->__r_.__value_.__l.__size_ = v8;
goto LABEL_8;
}
this->__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7);
data = this->__r_.__value_.__s.__data_;
if ( v7 )
LABEL_8:
memmove(data, CString, v8);
data[v8] = 0;
if ( v13 != 1 || (unsigned int)(v4 - 6) >= 5 )
{
std::string::append(this, "btn_001.png");
if ( v4 == -1 )
std::string::assign(this, "difficulty_auto_btn_001.png");
}
else
{
std::string::append(this, "btn2_001.png");
}
return this;
}