//
// sub_A94490 from 0xa94490 to 0xa94678 (488 bytes)
//
// 2 xrefs:
// > ??> @ 0xc8147c
// > ??> @ 0xc814e8
//
// 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:59 +0000
//
int __fastcall sub_A94490(int a1, int a2, int a3, _DWORD *a4)
{
int v4; // r4
v4 = *(_DWORD *)(a1 + 20);
if ( a2 == 4103 )
{
*(_DWORD *)(v4 + 40) = a4;
return 1;
}
else if ( a2 > 4103 )
{
if ( a2 == 4107 )
{
CRYPTO_free(*(void **)(v4 + 44), (int)"crypto/dh/dh_pmeth.c", 180);
*(_DWORD *)(v4 + 44) = a4;
if ( a4 )
*(_DWORD *)(v4 + 48) = a3;
else
*(_DWORD *)(v4 + 48) = 0;
return 1;
}
else
{
if ( a2 > 4107 )
{
if ( a2 == 4109 )
{
ASN1_OBJECT_free(*(_DWORD **)(v4 + 36));
*(_DWORD *)(v4 + 36) = a4;
return 1;
}
if ( a2 < 4109 )
{
*a4 = *(_DWORD *)(v4 + 44);
return *(_DWORD *)(v4 + 48);
}
if ( a2 == 4110 )
{
*a4 = *(_DWORD *)(v4 + 36);
return 1;
}
return -2;
}
if ( a2 == 4105 )
{
if ( a3 > 0 )
{
*(_DWORD *)(v4 + 52) = a3;
return 1;
}
return -2;
}
if ( a2 <= 4105 )
*a4 = *(_DWORD *)(v4 + 40);
else
*a4 = *(_DWORD *)(v4 + 52);
return 1;
}
}
else
{
if ( a2 != 4099 )
{
if ( a2 > 4099 )
{
if ( a2 == 4101 )
{
if ( (unsigned int)a3 <= 2 )
{
*(_DWORD *)(v4 + 8) = a3;
return 1;
}
}
else if ( a2 > 4101 )
{
if ( a3 == -2 )
return *(unsigned __int8 *)(v4 + 32);
if ( (unsigned int)(a3 - 1) <= 1 )
{
*(_BYTE *)(v4 + 32) = a3;
return 1;
}
}
else if ( *(_DWORD *)(v4 + 8) )
{
*(_DWORD *)(v4 + 12) = a3;
return 1;
}
}
else if ( a2 == 4097 )
{
if ( a3 > 255 )
{
*(_DWORD *)v4 = a3;
return 1;
}
}
else
{
if ( a2 <= 4097 )
{
if ( a2 == 2 )
return 1;
return -2;
}
if ( !*(_DWORD *)(v4 + 8) )
{
*(_DWORD *)(v4 + 4) = a3;
return 1;
}
}
return -2;
}
if ( (unsigned int)(a3 - 1) > 2 )
return -2;
*(_DWORD *)(v4 + 20) = a3;
return 1;
}
}