//
// LocalLevelManager::didEncodeForSave from 0x10025f07c to 0x10025f21c (416 bytes)
//
// 1 xrefs:
// > ??> @ 0x100910e80
//
// 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 11:01:37 +0000
//
void __fastcall LocalLevelManager::didEncodeForSave(__int64 a1)
{
void *v2; // x0
void **v3; // x21
__int64 v4; // x20
int v5; // w9
const std::string::value_type *v6; // x1
std::string::size_type v7; // x2
std::string *v8; // x0
__int128 v9; // q0
void **v10; // x21
std::string v11; // [xsp+8h] [xbp-58h] BYREF
__int128 __dst; // [xsp+20h] [xbp-40h] BYREF
std::string::size_type v13; // [xsp+30h] [xbp-30h]
GameLevelManager::sharedState();
sub_1000AFC5C(1, &__dst);
sub_100261C14(a1 + 440);
*(_OWORD *)(a1 + 440) = __dst;
*(_QWORD *)(a1 + 456) = v13;
v13 = 0;
__dst = 0u;
v11.__r_.__value_.__r.__words[0] = (std::string::size_type)&__dst;
sub_1000D8DEC((void ***)&v11);
std::mutex::lock((std::mutex *)(a1 + 464));
if ( *(_BYTE *)(a1 + 600) == 1 )
{
v2 = sub_100009900(&__dst, "");
}
else if ( *(char *)(a1 + 551) < 0 )
{
v2 = sub_1000097D0(&__dst, *(void **)(a1 + 528), *(_QWORD *)(a1 + 536));
}
else
{
__dst = *(_OWORD *)(a1 + 528);
v13 = *(_QWORD *)(a1 + 544);
}
v3 = (void **)(a1 + 552);
if ( *(char *)(a1 + 575) < 0 )
operator delete(*v3);
*(_OWORD *)v3 = __dst;
*(_QWORD *)(a1 + 568) = v13;
v4 = *(char *)(a1 + 575);
if ( v4 < 0 )
{
v4 = *(_QWORD *)(a1 + 560);
if ( v4 )
goto LABEL_10;
LABEL_18:
sub_100009900(&__dst, "");
goto LABEL_19;
}
if ( !*(_BYTE *)(a1 + 575) )
goto LABEL_18;
LABEL_10:
sub_10004EB10((__int64)v2);
v5 = *(char *)(a1 + 575);
if ( v5 >= 0 )
v6 = (const std::string::value_type *)(a1 + 552);
else
v6 = *(const std::string::value_type **)(a1 + 552);
if ( v5 >= 0 )
v7 = *(unsigned __int8 *)(a1 + 575);
else
v7 = *(_QWORD *)(a1 + 560);
v8 = std::string::append(&v11, v6, v7);
v9 = *(_OWORD *)&v8->__r_.__value_.__l.__data_;
v13 = v8->__r_.__value_.__r.__words[2];
__dst = v9;
v8->__r_.__value_.__l.__size_ = 0;
v8->__r_.__value_.__r.__words[2] = 0;
v8->__r_.__value_.__r.__words[0] = 0;
LABEL_19:
v10 = (void **)(a1 + 576);
if ( *(char *)(a1 + 599) < 0 )
operator delete(*v10);
*(_OWORD *)v10 = __dst;
*(_QWORD *)(a1 + 592) = v13;
HIBYTE(v13) = 0;
LOBYTE(__dst) = 0;
if ( v4 && SHIBYTE(v11.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v11.__r_.__value_.__l.__data_);
std::mutex::unlock((std::mutex *)(a1 + 464));
}