//
// LevelBindingsLayer::onPaste from 0xcf1b58 to 0xcf1ee8 (912 bytes)
//
// 3 xrefs:
// > ??> @ 0xfdd98
// > LevelBindingsLayer::settingsEntries @ 0xcf1194
// > ??> @ 0x1547bb8
//
// 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:06:46 +0000
//
__int64 __fastcall LevelBindingsLayer::onPaste(LevelBindingsLayer *this, cocos2d::CCObject *a2)
{
__int64 *v3; // x0
__int64 v4; // x2
void (__fastcall *v5)(LevelBindingsLayer *, __int64, __int64); // x22
__int64 v6; // x0
__int64 v8; // x0
__int64 v9; // x19
__int64 v10; // x24
unsigned int *v11; // x23
unsigned int v12; // w22
unsigned int *v13; // x19
unsigned int *v14; // x20
void (__fastcall *v15)(LevelBindingsLayer *, __int64, __int64); // x22
__int64 v16; // x0
void (__fastcall *v17)(LevelBindingsLayer *, __int64, __int64); // x22
__int64 v18; // x0
void *v19; // [xsp+60h] [xbp+60h] BYREF
void *v20; // [xsp+68h] [xbp+68h]
__int64 v21; // [xsp+78h] [xbp+78h] BYREF
__int64 v22; // [xsp+80h] [xbp+80h]
void *v23; // [xsp+88h] [xbp+88h]
__int64 v24; // [xsp+90h] [xbp+90h] BYREF
__int64 v25; // [xsp+98h] [xbp+98h]
void *v26; // [xsp+A0h] [xbp+A0h]
v3 = &qword_155F4A8[3 * *((unsigned __int8 *)this + 1200)];
v4 = *(_BYTE *)v3 >> 1;
if ( (*(_BYTE *)v3 & 1) != 0 )
v4 = v3[1];
if ( !v4 )
{
v5 = *(void (__fastcall **)(LevelBindingsLayer *, __int64, __int64))(*(_QWORD *)this + 464LL);
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(&v21, "Nothing copied", 0xEu);
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::__init(&v24, &byte_11B8890, 0);
v6 = TextAlertPopup::create((char *)&v21, 150, (char *)&v24, 0.5, 0.6);
v5(this, v6, 100);
goto LABEL_5;
}
v8 = LevelControlConfig::createFromB64(v3);
if ( !v8 || *(int *)(v8 + 56) <= 0 )
{
v17 = *(void (__fastcall **)(LevelBindingsLayer *, __int64, __int64))(*(_QWORD *)this + 464LL);
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(&v21, "Invalid config", 0xEu);
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::__init(&v24, &byte_11B8890, 0);
v18 = TextAlertPopup::create((char *)&v21, 150, (char *)&v24, 0.5, 0.6);
v17(this, v18, 100);
LABEL_5:
if ( (v24 & 1) == 0 )
goto LABEL_6;
goto LABEL_23;
}
v9 = *((_QWORD *)this + 149);
v10 = v8 + 112;
v11 = (unsigned int *)&unk_11A5000;
if ( !*((_BYTE *)this + 1200) )
v10 = v8 + 72;
std::__tree>,std::__map_value_compare>,std::less,true>,std::allocator>>>::clear((_QWORD *)(v9 + 8));
*(_BYTE *)(v9 + 32) = 1;
do
{
v12 = *v11;
(*(void (__fastcall **)(void **__return_ptr, __int64, _QWORD))(*(_QWORD *)v10 + 16LL))(&v19, v10, *v11);
v13 = (unsigned int *)v19;
v14 = (unsigned int *)v20;
if ( v19 != v20 )
{
do
(*(void (__fastcall **)(_QWORD, _QWORD, _QWORD))(**((_QWORD **)this + 149) + 32LL))(
*((_QWORD *)this + 149),
*v13++,
v12);
while ( v14 != v13 );
v14 = (unsigned int *)v19;
}
if ( v14 )
{
if ( v20 != v14 )
v20 = (char *)v20 + 4 * ~((unsigned __int64)((char *)v20 - 4 - (char *)v14) >> 2);
operator delete(v14);
}
++v11;
}
while ( v11 != (unsigned int *)&unk_11A5018 );
(*(void (__fastcall **)(LevelBindingsLayer *))(*(_QWORD *)this + 1304LL))(this);
v15 = *(void (__fastcall **)(LevelBindingsLayer *, __int64, __int64))(*(_QWORD *)this + 464LL);
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(&v21, "Pasted", 6u);
v24 = 0;
v25 = 0;
v26 = nullptr;
std::string::__init(&v24, &byte_11B8890, 0);
v16 = TextAlertPopup::create((char *)&v21, 150, (char *)&v24, 0.5, 0.6);
v15(this, v16, 100);
if ( (v24 & 1) != 0 )
LABEL_23:
operator delete(v26);
LABEL_6:
if ( (v21 & 1) != 0 )
operator delete(v23);
return _stack_chk_guard;
}