//
// engine_pkey_meths_free from 0xd9f280 to 0xd9f318 (152 bytes)
//
// 2 xrefs:
// > engine_free_util @ 0xd9d518
// > ??> @ 0x2da20
//
// 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
//
__int64 __fastcall engine_pkey_meths_free(__int64 result)
{
__int64 (*v1)(void); // x4
__int64 v2; // x20
__int64 v3; // x19
__int64 v4; // x21
__int64 v5; // x3
_QWORD v6[2]; // [xsp+30h] [xbp+30h] BYREF
v1 = *(__int64 (**)(void))(result + 72);
v2 = result;
if ( v1 )
{
result = v1();
if ( (int)result > 0 )
{
v3 = 0;
v4 = 4 * ((unsigned int)(result - 1) + 1LL);
do
{
while ( 1 )
{
v5 = *(unsigned int *)(v6[1] + v3);
v3 += 4;
result = (*(__int64 (__fastcall **)(__int64, _QWORD *, _QWORD, __int64))(v2 + 72))(v2, v6, 0, v5);
if ( (_DWORD)result )
break;
if ( v3 == v4 )
return result;
}
result = EVP_PKEY_meth_free(v6[0]);
}
while ( v3 != v4 );
}
}
return result;
}