//
// ASN1_STRING_TABLE_add from 0xa790ec to 0xa79238 (332 bytes)
//
// 2 xrefs:
// > sub_A7AFF4 @ 0xa7b278
// > ??> @ 0x833ec
//
// 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:45 +0000
//
int __fastcall ASN1_STRING_TABLE_add(int a1, int a2, int a3, int a4, int a5)
{
int v9; // r6
int v10; // r0
_DWORD *v11; // r5
_DWORD *v12; // r0
_DWORD *v13; // r4
int v14; // r0
int v15; // r1
int v16; // r2
int v17; // r3
int result; // r0
v9 = a5;
if ( !dword_D35AE8 )
{
dword_D35AE8 = (int)OPENSSL_sk_new((int)sub_A78E34);
if ( !dword_D35AE8 )
goto LABEL_22;
}
v10 = ASN1_STRING_TABLE_get(a1);
v11 = (_DWORD *)v10;
if ( !v10 || (*(_DWORD *)(v10 + 16) & 1) == 0 )
{
v12 = CRYPTO_zalloc(&dword_14, (int)"crypto/asn1/a_strnid.c", 202);
v13 = v12;
if ( v12 )
{
if ( OPENSSL_sk_push((int *)dword_D35AE8, (int)v12) )
{
if ( v11 )
{
v14 = v11[1];
v15 = v11[2];
v16 = v11[3];
v17 = v11[4] | 1;
*v13 = *v11;
v13[1] = v14;
v13[2] = v15;
v13[3] = v16;
v13[4] = v17;
}
else
{
v13[1] = -1;
v13[2] = -1;
v13[4] = 1;
}
goto LABEL_8;
}
CRYPTO_free(v13, (int)"crypto/asn1/a_strnid.c", 206);
}
LABEL_22:
ERR_put_error(13, 129, 65, (int)"crypto/asn1/a_strnid.c", 230);
return 0;
}
v13 = (_DWORD *)v10;
LABEL_8:
if ( a2 >= 0 )
v13[1] = a2;
if ( a3 >= 0 )
v13[2] = a3;
if ( a4 )
v13[3] = a4;
if ( a5 )
v9 = a5 | 1;
result = 1;
if ( a5 )
v13[4] = v9;
return result;
}