//
// PlayLayer::storeCheckpoint from 0x10014a0a4 to 0x10014a134 (144 bytes)
//
// 3 xrefs:
// > PlayLayer::markCheckpoint @ 0x1001488dc
// > PlayLayer::loadPersistentCheckpoint @ 0x10014ae60
// > PlayerObject::tryPlaceCheckpoint @ 0x1002ba544
//
// 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 10:59:36 +0000
//
__int64 __fastcall PlayLayer::storeCheckpoint(_QWORD *a1, __int64 a2)
{
_BYTE *v4; // x21
__n128 v5; // q0
__int64 v6; // x0
unsigned int v7; // w20
__int64 result; // x0
v4 = (char *)a1 + 12238;
v5 = sub_1002E74E0(a1[1781], a2);
v6 = sub_10019CA2C(a2, v5);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1344LL))(a1, v6);
v7 = 500;
if ( *v4 == 1 )
{
if ( v4[306] )
v7 = 500;
else
v7 = 1;
}
while ( 1 )
{
result = sub_1002E757C(a1[1781]);
if ( (unsigned int)result <= v7 )
break;
PlayLayer::removeCheckpoint(a1, 1);
}
return result;
}