//
// LevelEditorLayer::pasteAttributeState from 0x661a18 to 0x661b00 (232 bytes)
//
// 3 xrefs:
// > EditorUI::onPasteState @ 0x6c33a8
// > SetGroupIDLayer::onPaste @ 0x977570
// > ??> @ 0x5a9a8
//
// 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
//
void LevelEditorLayer::pasteAttributeState(LevelEditorLayer *a1, GameObject *a2, cocos2d::CCArray *a3)
{
GameObject *m_copyStateObject; // x2
cocos2d::CCArray *v6; // x22
GameManager *v8; // x0
cocos2d::ccArray *data; // x1
GameObject **arr; // x19
__int64 v11; // x0
char *v12; // x23
GameObject *v13; // x1
GameObject **v14; // x19
GameObject *v15; // x1
m_copyStateObject = a1->m_copyStateObject;
if ( m_copyStateObject )
{
v6 = a3;
if ( a2 )
{
LevelEditorLayer::applyAttributeState(a1, a2, m_copyStateObject);
}
else if ( a3 )
{
data = a3->data;
if ( data->num )
{
arr = (GameObject **)data->arr;
v11 = 8LL * data->num - 8;
v12 = (char *)arr + v11;
if ( arr <= (GameObject **)((char *)arr + v11) )
{
v13 = *arr;
if ( *arr )
{
v14 = arr + 1;
LevelEditorLayer::applyAttributeState(a1, v13, m_copyStateObject);
while ( v12 >= (char *)v14 )
{
v15 = *v14;
if ( !*v14 )
break;
++v14;
LevelEditorLayer::applyAttributeState(a1, v15, a1->m_copyStateObject);
}
}
}
}
}
v8 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v8, "0156") )
LevelEditorLayer::pasteGroupState(a1, a2, v6);
}
}