//
// bn_mul_low_normal from 0xffba64 to 0xffbb4c (232 bytes)
//
// 3 xrefs:
// > bn_mul_low_recursive @ 0xffbbb8
// > bn_mul_low_recursive @ 0xffbbcc
// > ??> @ 0x5d1a8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:15:51 +0000
//
__int64 __fastcall bn_mul_low_normal(__int64 a1, __int64 a2, _QWORD *a3, unsigned int a4)
{
_QWORD *v4; // x20
int v5; // w22
int v6; // w21
__int64 v7; // x19
__int64 result; // x0
int v10; // w23
int v11; // w25
bool v12; // cc
__int64 v13; // x2
__int64 v14; // t1
__int64 v15; // x2
__int64 v16; // x2
v4 = a3;
v5 = a4 - 1;
v6 = a4;
v7 = a1;
result = bn_mul_words(a1, a2, a4, *a3);
if ( v5 > 0 )
{
v10 = v6 - 2;
v11 = v6 - 3;
do
{
v15 = (unsigned int)v5;
v6 -= 4;
v5 -= 4;
bn_mul_add_words(v7 + 8, a2, v15, v4[1]);
v12 = v10 <= 0;
v16 = (unsigned int)v10;
result = v7 + 16;
v10 -= 4;
if ( v12 )
break;
bn_mul_add_words(result, a2, v16, v4[2]);
v12 = v11 <= 0;
v13 = (unsigned int)v11;
result = v7 + 24;
v7 += 32;
v11 -= 4;
if ( v12 )
break;
bn_mul_add_words(result, a2, v13, v4[3]);
result = v7;
if ( v6 <= 0 )
break;
v14 = v4[4];
v4 += 4;
result = bn_mul_add_words(v7, a2, (unsigned int)v6, v14);
}
while ( v5 > 0 );
}
return result;
}