//
// AnimatedGameObject::displayFrameChanged from 0x10042ada4 to 0x10042aff8 (596 bytes)
//
// 2 xrefs:
// > j_AnimatedGameObject::displayFrameChanged @ 0x10042b05c
// > ??> @ 0x10094da70
//
// 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 11:05:03 +0000
//
void __fastcall AnimatedGameObject::displayFrameChanged(__int64 a1, __int64 a2, char *a3)
{
__int64 v4; // x19
std::string::size_type v5; // x20
std::string::size_type size; // x8
std::string *p_p; // x28
std::string::size_type v8; // x27
unsigned __int64 v9; // x25
std::string::size_type v10; // x24
void **v11; // x21
signed __int64 v12; // x22
signed __int64 v13; // x9
char *v14; // x26
char *v15; // x0
int v16; // w20
char *v17; // x0
char *v18; // x23
std::string::size_type v19; // x2
const std::string::value_type *v20; // x3
std::string::size_type v21; // x4
std::string::size_type v22; // x8
std::string *v23; // x1
_QWORD *v24; // x0
__int64 v25; // x0
void **v26; // x1
__int64 v27; // x0
std::string __p; // [xsp+0h] [xbp-B0h] BYREF
void *v29[2]; // [xsp+18h] [xbp-98h] BYREF
char v30; // [xsp+2Fh] [xbp-81h]
void *v31; // [xsp+30h] [xbp-80h] BYREF
std::string::size_type v32; // [xsp+38h] [xbp-78h]
unsigned __int8 v33; // [xsp+47h] [xbp-69h]
void *v34; // [xsp+48h] [xbp-68h] BYREF
signed __int64 v35; // [xsp+50h] [xbp-60h]
char v36; // [xsp+5Fh] [xbp-51h]
v4 = sub_10024DE9C(a2);
if ( a3[23] < 0 )
a3 = *(char **)a3;
sub_100009900(&__p, a3);
sub_100009900(&v34, "_001.png");
sub_100009900(&v31, "_glow_001.png");
v5 = 0;
size = HIBYTE(__p.__r_.__value_.__r.__words[2]);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = __p.__r_.__value_.__l.__size_;
v8 = v36;
v9 = (unsigned __int64)v36 >> 63;
v10 = v35;
if ( v36 >= 0 )
v11 = &v34;
else
v11 = (void **)v34;
if ( v36 >= 0 )
v12 = v36;
else
v12 = v35;
while ( !v12 )
{
LABEL_24:
if ( v5 != -1 )
{
if ( (v9 & 1) != 0 )
v19 = v10;
else
v19 = v8;
if ( (v33 & 0x80u) == 0 )
v20 = (const std::string::value_type *)&v31;
else
v20 = (const std::string::value_type *)v31;
if ( (v33 & 0x80u) == 0 )
v21 = v33;
else
v21 = v32;
std::string::replace(&__p, v5, v19, v20, v21);
v22 = v33;
if ( (v33 & 0x80u) != 0 )
v22 = v32;
v5 += v22;
size = HIBYTE(__p.__r_.__value_.__r.__words[2]);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = __p.__r_.__value_.__l.__size_;
v8 = v36;
v9 = (unsigned __int64)v36 >> 63;
v10 = v35;
v11 = v36 >= 0 ? &v34 : (void **)v34;
v12 = v36 >= 0 ? v36 : v35;
if ( size >= v5 )
continue;
}
goto LABEL_48;
}
v13 = size - v5;
if ( (__int64)(size - v5) >= v12 )
{
v14 = (char *)p_p + size;
v15 = (char *)p_p + v5;
v16 = *(char *)v11;
do
{
if ( v13 - v12 == -1 )
break;
v17 = (char *)memchr(v15, v16, v13 - v12 + 1);
if ( !v17 )
break;
v18 = v17;
if ( !memcmp(v17, v11, v12) )
{
if ( v18 == v14 )
break;
v5 = v18 - (char *)p_p;
goto LABEL_24;
}
v15 = v18 + 1;
v13 = v14 - (v18 + 1);
}
while ( v13 >= v12 );
}
LABEL_48:
if ( (char)v33 < 0 )
{
operator delete(v31);
if ( (v36 & 0x80) == 0 )
goto LABEL_50;
}
else if ( (v8 & 0x80) == 0 )
{
goto LABEL_50;
}
operator delete(v34);
LABEL_50:
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v23 = &__p;
else
v23 = (std::string *)__p.__r_.__value_.__r.__words[0];
v24 = sub_100009900(v29, (char *)v23);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
v25 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v24);
if ( v30 >= 0 )
v26 = v29;
else
v26 = (void **)v29[0];
v27 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v25, v26);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v4 + 1160LL))(v4, v27);
if ( v30 < 0 )
operator delete(v29[0]);
}