//
// SmartGameObject::updateSmartFrame from 0x1001912e0 to 0x1001914a2 (450 bytes)
//
// 6 xrefs:
// > EditorUI::createSmartObjectsFromTemplate @ 0x100014484
// > EditorUI::createPrefab @ 0x100014a4f
// > SmartGameObject::customObjectSetup @ 0x100191b12
// > SmartGameObject::customObjectSetup @ 0x100191b3d
// > SetupSmartBlockLayer::onClose @ 0x1004e1562
// > SetupSmartBlockLayer::onClose @ 0x1004e15c2
//
// 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:25:54 +0000
//
void __fastcall SmartGameObject::updateSmartFrame(__int64 a1)
{
int v2; // eax
const char *v3; // rax
std::string::value_type *v4; // r14
size_t v5; // rax
size_t v6; // r12
char *v7; // r15
char *v8; // r13
size_t v9; // r14
void *v10; // r13
unsigned int v11; // eax
const void *v12; // rdi
size_t v13; // rax
size_t v14; // rdx
bool v15; // zf
char v16; // r15
__int64 v17; // rax
__int64 v18; // rsi
__int64 v19; // rax
size_t __dst; // [rsp+8h] [rbp-48h] BYREF
size_t v21; // [rsp+10h] [rbp-40h]
void *__s2; // [rsp+18h] [rbp-38h]
std::string::value_type *__s; // [rsp+20h] [rbp-30h]
v2 = *(_DWORD *)(a1 + 1028);
switch ( v2 )
{
case 2897:
v3 = "smartBlock03b_001.png";
v4 = (std::string::value_type *)"smartBlock03_001.png";
break;
case 2896:
v3 = "smartBlock02b_001.png";
v4 = (std::string::value_type *)"smartBlock02_001.png";
break;
case 2895:
v3 = "smartBlock01b_001.png";
v4 = (std::string::value_type *)"smartBlock01_001.png";
break;
default:
return;
}
if ( *(_BYTE *)(a1 + 1347) )
v4 = (std::string::value_type *)v3;
v5 = strlen(v4);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v6 = v5;
v7 = (char *)&__dst + 1;
__s = v4;
if ( v5 >= 0x17 )
{
v9 = 26;
if ( (v5 | 7) != 0x17 )
v9 = (v5 | 7) + 1;
v8 = (char *)operator new(v9);
__s2 = v8;
__dst = v9 + 1;
v4 = __s;
v21 = v6;
}
else
{
LOBYTE(__dst) = 2 * v5;
v8 = (char *)&__dst + 1;
if ( !v5 )
goto LABEL_17;
}
memcpy(v8, v4, v6);
LABEL_17:
v8[v6] = 0;
v10 = __s2;
v11 = *(unsigned __int8 *)(a1 + 1376);
v12 = (const void *)(a1 + 1377);
if ( (v11 & 1) != 0 )
{
v13 = *(_QWORD *)(a1 + 1384);
v12 = *(const void **)(a1 + 1392);
}
else
{
v13 = v11 >> 1;
}
v14 = (unsigned __int8)__dst >> 1;
if ( (__dst & 1) != 0 )
{
v14 = v21;
v7 = (char *)__s2;
}
v15 = v14 == v13;
if ( v14 >= v13 )
v14 = v13;
v16 = v15 & (memcmp(v12, v7, v14) == 0);
if ( (__dst & 1) != 0 )
operator delete(v10);
if ( !v16 )
{
std::string::assign((std::string *)(a1 + 1376), __s);
v17 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v18 = a1 + 1377;
if ( (*(_BYTE *)(a1 + 1376) & 1) != 0 )
v18 = *(_QWORD *)(a1 + 1392);
v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, v18);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1160LL))(a1, v19);
}
}