//
// sub_A7E2C4 from 0xa7e2c4 to 0xa7e344 (128 bytes)
//
// 2 xrefs:
// > ??> @ 0xd26448
// > ??> @ 0xd26468
//
// 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:08:47 +0000
//
int __fastcall sub_A7E2C4(_DWORD **a1, _BYTE *a2)
{
_DWORD *v2; // r4
int v4; // r6
int v5; // r3
int v6; // r0
v2 = *a1;
if ( !*a1 )
return -1;
if ( (BN_num_bits(*a1) & 7) == 0 )
{
if ( !a2 )
{
v4 = 1;
goto LABEL_7;
}
v4 = 1;
*a2++ = 0;
goto LABEL_6;
}
if ( a2 )
{
v4 = 0;
LABEL_6:
BN_bn2bin(v2, a2);
goto LABEL_7;
}
v4 = 0;
LABEL_7:
v5 = BN_num_bits(v2);
v6 = v5 + 7;
if ( v5 + 7 < 0 )
v6 = v5 + 14;
return v4 + (v6 >> 3);
}