//
// EC_ec_pre_comp_free from 0x7ebab8 to 0x7ebb5c (164 bytes)
//
// 6 xrefs:
// > EC_pre_comp_free @ 0x7ea17c
// > ec_wNAF_precompute_mult @ 0x7ecc40
// > ec_wNAF_precompute_mult @ 0x7ecd58
// > ec_wNAF_precompute_mult @ 0x7ecf00
// > ec_wNAF_precompute_mult @ 0x7ed084
// > ??> @ 0x61a0c
//
// 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
//
int __fastcall EC_ec_pre_comp_free(int result)
{
int v1; // r4
int *v2; // r5
int v3; // r0
int v4; // t1
int v5; // r0
int v6; // [sp+4h] [bp-14h] BYREF
if ( result )
{
v1 = result;
result = CRYPTO_atomic_add(result + 24, -1, &v6, *(_DWORD *)(result + 28));
if ( v6 <= 0 )
{
v2 = *(int **)(v1 + 16);
if ( v2 )
{
v3 = *v2;
if ( *v2 )
{
do
{
EC_POINT_free(v3);
v4 = v2[1];
++v2;
v3 = v4;
}
while ( v4 );
v5 = *(_DWORD *)(v1 + 16);
}
else
{
v5 = *(_DWORD *)(v1 + 16);
}
CRYPTO_free(v5, "crypto/ec/ec_mult.c", 98);
}
CRYPTO_THREAD_lock_free(*(_DWORD *)(v1 + 28));
return CRYPTO_free(v1, "crypto/ec/ec_mult.c", 101);
}
}
return result;
}