//
// EC_ec_pre_comp_free from 0xd928d8 to 0xd9297c (164 bytes)
//
// 7 xrefs:
// > EC_pre_comp_free @ 0xd910b4
// > ec_wNAF_precompute_mult @ 0xd9389c
// > ec_wNAF_precompute_mult @ 0xd939cc
// > ec_wNAF_precompute_mult @ 0xd93b3c
// > ec_wNAF_precompute_mult @ 0xd93c18
// > ec_wNAF_precompute_mult @ 0xd93cbc
// > ??> @ 0x51588
//
// 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 EC_ec_pre_comp_free(__int64 result)
{
__int64 v1; // x19
__int64 *v2; // x20
__int64 v3; // x0
__int64 v4; // t1
__int64 v5; // x0
int v6; // [xsp+2Ch] [xbp+2Ch] BYREF
if ( result )
{
v1 = result;
CRYPTO_atomic_add(result + 48, 0xFFFFFFFFLL, &v6, *(_QWORD *)(result + 56));
result = (unsigned int)v6;
if ( v6 <= 0 )
{
v2 = *(__int64 **)(v1 + 32);
if ( v2 )
{
v3 = *v2;
if ( *v2 )
{
do
{
EC_POINT_free(v3);
v4 = v2[1];
++v2;
v3 = v4;
}
while ( v4 );
v5 = *(_QWORD *)(v1 + 32);
}
else
{
v5 = *(_QWORD *)(v1 + 32);
}
CRYPTO_free(v5, "crypto/ec/ec_mult.c", 98);
}
CRYPTO_THREAD_lock_free(*(_QWORD *)(v1 + 56));
return CRYPTO_free(v1, "crypto/ec/ec_mult.c", 101);
}
}
return result;
}