//
// LevelEditorLayer::prepareSaveData from 0x140408ee0 to 0x1404091c9 (745 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::doAutoSave @ 0x1404092e2
// > LevelEditorLayer::doAutoBackup @ 0x14040979b
// > ??> @ 0x140925c34
//
// 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 11:31:59 +0000
//
// Hidden C++ exception states: #wind=5
__int64 __fastcall LevelEditorLayer::prepareSaveData(__int64 a1, __int64 a2, _QWORD *a3)
{
_QWORD *v3; // rdi
__int64 v6; // rbx
__int64 v7; // rax
__int64 v8; // rdi
void *v9; // rdx
__int128 v10; // xmm6
__int128 v11; // xmm7
__int128 v12; // xmm8
__int128 v13; // xmm9
__int128 v14; // xmm10
__int128 v15; // xmm11
__int64 v16; // xmm12_8
DS_Dictionary *v17; // rdi
__int64 v18; // rax
__int64 v19; // rdi
void *v20; // rdx
DS_Dictionary *v22; // [rsp+38h] [rbp-110h]
_BYTE v23[32]; // [rsp+48h] [rbp-100h] BYREF
_BYTE v24[32]; // [rsp+68h] [rbp-E0h] BYREF
_BYTE v25[32]; // [rsp+88h] [rbp-C0h] BYREF
v3 = a3;
v6 = *(_QWORD *)(a1 + 2168);
cocos2d::ZipUtils::compressString(v25, a3, 0, 0xFFFFFFFFLL, 11);
v3[2] = 0;
if ( v3[3] > 0xFu )
v3 = (_QWORD *)*v3;
*(_BYTE *)v3 = 0;
sub_14003F4F0((__int64)v24, v6 + 408);
v7 = sub_14003F4F0((__int64)v23, (__int64)v25);
v8 = v7;
if ( v6 + 408 != v7 )
{
v9 = (void *)v7;
if ( *(_QWORD *)(v7 + 24) > 0xFu )
v9 = *(void **)v7;
sub_1400405A0((void **)(v6 + 408), v9, *(_QWORD *)(v7 + 16));
}
sub_14003D310(v8);
LevelEditorLayer::updateLevelSaveInfo(a1);
*(_DWORD *)(v6 + 724) += (int)*(double *)(a1 + 15392);
v10 = *(_OWORD *)(v6 + 736);
v11 = *(_OWORD *)(v6 + 752);
v12 = *(_OWORD *)(v6 + 768);
v13 = *(_OWORD *)(v6 + 784);
v14 = *(_OWORD *)(v6 + 800);
v15 = *(_OWORD *)(v6 + 816);
v16 = *(_QWORD *)(v6 + 832);
*(_OWORD *)(v6 + 736) = *(_OWORD *)(a1 + 15408);
*(_OWORD *)(v6 + 752) = *(_OWORD *)(a1 + 15424);
*(_OWORD *)(v6 + 768) = *(_OWORD *)(a1 + 15440);
*(_OWORD *)(v6 + 784) = *(_OWORD *)(a1 + 15456);
*(_OWORD *)(v6 + 800) = *(_OWORD *)(a1 + 15472);
*(_OWORD *)(v6 + 816) = *(_OWORD *)(a1 + 15488);
*(_QWORD *)(v6 + 832) = *(_QWORD *)(a1 + 15504);
v22 = (DS_Dictionary *)operator new(0xF0u);
v17 = DS_Dictionary::DS_Dictionary(v22);
(*(void (__fastcall **)(__int64, DS_Dictionary *))(*(_QWORD *)v6 + 40LL))(v6, v17);
DS_Dictionary::saveRootSubDictToString(v17, a2);
if ( v17 )
{
DS_Dictionary::~DS_Dictionary(v17);
j_j_free(v17);
}
v18 = sub_14003F4F0((__int64)v23, (__int64)v24);
v19 = v18;
if ( v6 + 408 != v18 )
{
v20 = (void *)v18;
if ( *(_QWORD *)(v18 + 24) > 0xFu )
v20 = *(void **)v18;
sub_1400405A0((void **)(v6 + 408), v20, *(_QWORD *)(v18 + 16));
}
sub_14003D310(v19);
*(_DWORD *)(v6 + 724) -= (int)*(double *)(a1 + 15392);
*(_OWORD *)(v6 + 736) = v10;
*(_OWORD *)(v6 + 752) = v11;
*(_OWORD *)(v6 + 768) = v12;
*(_OWORD *)(v6 + 784) = v13;
*(_OWORD *)(v6 + 800) = v14;
*(_OWORD *)(v6 + 816) = v15;
*(_QWORD *)(v6 + 832) = v16;
sub_14003D310((__int64)v24);
sub_14003D310((__int64)v25);
return a2;
}