//
// GameManager::didEncodeForSave from 0x1003762f0 to 0x10037637f (143 bytes)
//
// 1 xrefs:
// > ??> @ 0x100b270c0
//
// 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:29:04 +0000
//
__int64 __fastcall GameManager::didEncodeForSave(_QWORD *a1, double a2)
{
__int64 v3; // rax
__int64 v4; // r14
__int64 v5; // r15
void *v6; // rdi
__int64 result; // rax
__int128 v8; // [rsp+0h] [rbp-30h] BYREF
__int64 v9; // [rsp+10h] [rbp-20h]
v3 = GameLevelManager::sharedState(a2);
sub_10054D820(&v8, v3, 0);
v4 = a1[44];
if ( v4 )
{
v5 = a1[45];
v6 = (void *)a1[44];
if ( v5 != v4 )
{
do
{
if ( (*(_BYTE *)(v5 - 32) & 1) != 0 )
operator delete(*(void **)(v5 - 16));
v5 -= 32;
}
while ( v5 != v4 );
v6 = (void *)a1[44];
}
a1[45] = v4;
operator delete(v6);
}
*((_OWORD *)a1 + 22) = v8;
result = v9;
a1[46] = v9;
return result;
}