//
// EC_ec_pre_comp_free from 0xa006b8 to 0xa0075c (164 bytes)
//
// 6 xrefs:
// > EC_pre_comp_free @ 0x9fed7c
// > ec_wNAF_precompute_mult @ 0xa01840
// > ec_wNAF_precompute_mult @ 0xa01958
// > ec_wNAF_precompute_mult @ 0xa01b00
// > ec_wNAF_precompute_mult @ 0xa01c84
// > ??> @ 0x7b48c
//
// 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 12:07:38 +0000
//
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;
}