//
// SetupKeyframePopup::refreshPreviewArt from 0xb6b3ec to 0xb6b5e8 (508 bytes)
//
// 3 xrefs:
// > SetupKeyframePopup::valueDidChange @ 0xb6b60c
// > SetupKeyframePopup::onCustomButton @ 0xb6b920
// > ??> @ 0x8df70
//
// 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 13:02:17 +0000
//
__int64 __fastcall SetupKeyframePopup::refreshPreviewArt(SetupKeyframePopup *this)
{
cocos2d::CCArray *v2; // x0
cocos2d::CCArray *v3; // x19
__int64 *v4; // x19
__int64 v5; // x0
unsigned int *v6; // x0
unsigned int v7; // w2
__int64 *v8; // x0
__int64 *j; // x2
__int64 v10; // x1
__int64 *v11; // x1
void *v12; // x19
bool v14; // zf
unsigned int *v15; // x1
unsigned __int64 v16; // x19
__int64 v17; // x0
unsigned __int64 i; // x20
__int64 *v19; // [xsp+50h] [xbp+50h] BYREF
_QWORD v20[2]; // [xsp+58h] [xbp+58h] BYREF
if ( *((_QWORD *)this + 128) )
{
v2 = *((cocos2d::CCArray **)this + 85);
v20[0] = 0;
v20[1] = 0;
v19 = v20;
if ( v2 )
v3 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(v2, (cocos2d::CCObject *)v20);
else
v3 = *((cocos2d::CCArray **)this + 86);
if ( v3 )
{
if ( (unsigned int)cocos2d::CCArray::count(v3) )
{
v15 = *((unsigned int **)v3 + 7);
if ( *v15 )
{
v16 = *((_QWORD *)v15 + 2);
v17 = 8LL * *v15 - 8;
for ( i = v16 + v17; i >= v16; v16 += 8LL )
{
if ( !*(_QWORD *)v16 )
break;
std::__tree::__emplace_unique_key_args(
&v19,
(int *)(*(_QWORD *)v16 + 1856LL),
(_DWORD *)(*(_QWORD *)v16 + 1856LL));
}
}
}
}
v4 = v19;
while ( v4 != v20 )
{
v5 = cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(*((_QWORD *)this + 128) + 13272LL),
*((int *)v4 + 7));
if ( v5 )
{
v6 = *(unsigned int **)(v5 + 56);
v7 = *v6;
if ( *v6 )
{
v8 = *((__int64 **)v6 + 2);
for ( j = &v8[v7 - 1]; j >= v8; *(_BYTE *)(v10 + 1881) = 1 )
{
v10 = *v8;
if ( !*v8 )
break;
++v8;
}
}
}
v11 = (__int64 *)v4[1];
if ( v11 )
{
while ( *v11 )
v11 = (__int64 *)*v11;
v4 = v11;
}
else
{
do
{
v14 = v4 == *(__int64 **)v4[2];
v4 = (__int64 *)v4[2];
if ( v14 )
break;
v14 = v4 == *(__int64 **)v4[2];
v4 = (__int64 *)v4[2];
}
while ( !v14 );
}
}
v12 = (void *)v20[0];
if ( v20[0] )
{
std::__tree::destroy((__int64)&v19, *(_QWORD **)v20[0]);
std::__tree::destroy((__int64)&v19, *(_QWORD **)&byte_8[(_QWORD)v12]);
operator delete(v12);
}
}
return _stack_chk_guard;
}