//
// BN_mod_mul_reciprocal from 0xe1ac64 to 0xe1ad2c (200 bytes)
//
// 6 xrefs:
// > sub_E162E0 @ 0xe16420
// > sub_E162E0 @ 0xe16458
// > sub_E162E0 @ 0xe16510
// > sub_E162E0 @ 0xe1653c
// > sub_E162E0 @ 0xe16648
// > ??> @ 0x3c780
//
// 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 BN_mod_mul_reciprocal(__int64 a1, __int64 **a2, __int64 **a3, __int64 a4, int32x2_t *a5)
{
__int64 v8; // x0
__int64 v9; // x20
unsigned int v10; // w20
BN_CTX_start((unsigned __int64)a5);
v8 = BN_CTX_get(a5);
v9 = v8;
if ( v8 )
{
if ( !a3 )
{
v9 = (__int64)a2;
goto LABEL_5;
}
if ( a2 == a3 )
{
if ( (unsigned int)BN_sqr(v8, a2, (__int64)a5) )
goto LABEL_5;
}
else if ( (unsigned int)BN_mul(v8, a2, a3, (__int64)a5) )
{
LABEL_5:
v10 = BN_div_recp(0, a1, v9, a4, a5);
BN_CTX_end((__int64)a5);
return v10;
}
}
BN_CTX_end((__int64)a5);
return 0;
}