//
// PlayLayer::removeCheckpoint from 0x401ebc to 0x401f4a (142 bytes)
//
// 4 xrefs:
// > UILayer::onDeleteCheck @ 0x3fc4fc
// > PlayLayer::storeCheckpoint @ 0x401f9e
// > PlayLayer::removeAllCheckpoints @ 0x407950
// > PlayerObject::removePlacedCheckpoint @ 0x435e4c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:24 +0000
//
int __fastcall PlayLayer::removeCheckpoint(cocos2d::CCArray **this, int a2)
{
int result; // r0
cocos2d::CCArray *v5; // r0
CheckpointObject *Object; // r0
GameObject *v7; // r5
cocos2d::CCArray *v8; // r0
int v9; // r5
result = cocos2d::CCArray::count(*(this + 2962));
if ( result )
{
v5 = *(this + 2962);
if ( a2 )
Object = (CheckpointObject *)cocos2d::CCArray::objectAtIndex(v5, 0);
else
Object = (CheckpointObject *)cocos2d::CCArray::lastObject(v5);
v7 = (GameObject *)CheckpointObject::getObject(Object);
GJBaseGameLayer::removeObjectFromSection((GJBaseGameLayer *)this, v7);
GameObject::removeGlow(v7);
(*(void (__fastcall **)(GameObject *))(*(_DWORD *)v7 + 268))(v7);
v8 = *(this + 2962);
if ( a2 )
{
return cocos2d::CCArray::removeObjectAtIndex(v8, 0, 1);
}
else
{
result = cocos2d::CCArray::removeLastObject(v8, 1);
if ( *((_BYTE *)this + 10614) && *((_BYTE *)this + 10784) )
{
result = cocos2d::CCArray::count(*(this + 2962));
if ( result )
{
v9 = cocos2d::CCArray::lastObject(*(this + 2962));
result = GameObject::makeVisible(*(GameObject **)(v9 + 2288));
*(_DWORD *)(v9 + 2672) = *(this + 202);
}
}
}
}
return result;
}