//
// std::__exception_ptr::exception_ptr::_M_release from 0xd1f0f8 to 0xd1f150 (88 bytes)
//
// 2 xrefs:
// > std::__exception_ptr::exception_ptr::~exception_ptr @ 0xd1f150
// > ??> @ 0x51210
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall std::__exception_ptr::exception_ptr::_M_release(void **this)
{
_QWORD *v1; // x1
unsigned int *v2; // x2
unsigned int v3; // w3
unsigned int v4; // w3
void (__fastcall *v5)(void *); // x1
v1 = *this;
if ( *this )
{
v2 = (unsigned int *)(v1 - 16);
do
{
v3 = __ldaxr(v2);
v4 = v3 - 1;
}
while ( __stlxr(v4, v2) );
if ( !v4 )
{
v5 = (void (__fastcall *)(void *))*(v1 - 13);
if ( v5 )
v5(*this);
_cxa_free_exception(*this);
*this = nullptr;
}
}
}