//
// sub_10008BD50 from 0x10008bd50 to 0x10008bdfd (173 bytes)
//
// 1 xrefs:
// > PlayLayer::saveActiveSaveObjects @ 0x10008a986
//
// 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:20:06 +0000
//
void __fastcall sub_10008BD50(__int64 a1)
{
void *v1; // rbx
signed __int64 v2; // r15
unsigned __int64 v3; // r13
char *v4; // r12
char *v5; // r13
v1 = *(void **)a1;
v2 = *(_QWORD *)(a1 + 8) - *(_QWORD *)a1;
if ( *(_QWORD *)(a1 + 16) - *(_QWORD *)a1 > (unsigned __int64)v2 )
{
v3 = v2 >> 4;
if ( *(void **)(a1 + 8) == v1 )
{
v4 = nullptr;
}
else
{
if ( v3 >> 60 )
sub_10001ADB0();
v4 = (char *)operator new(*(_QWORD *)(a1 + 8) - *(_QWORD *)a1);
}
v5 = &v4[16 * v3];
memcpy(v4, v1, v2);
*(_QWORD *)a1 = v4;
*(_QWORD *)(a1 + 8) = v5;
*(_QWORD *)(a1 + 16) = v5;
if ( v1 )
operator delete(v1);
}
}