//
// X509_NAME_delete_entry from 0x847754 to 0x847830 (220 bytes)
//
// 3 xrefs:
// > sub_843DE0 @ 0x844fe8
// > sub_851538 @ 0x8517b8
// > ??> @ 0x675ec
//
// 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
//
int __fastcall X509_NAME_delete_entry(int *a1, int a2)
{
signed int v3; // r4
_DWORD *v4; // r5
int v5; // r8
int v6; // r0
signed int v7; // r6
int v8; // r7
int v9; // r0
if ( !a1 )
return 0;
v3 = a2;
if ( (a2 >= OPENSSL_sk_num(*a1)) | ((unsigned int)a2 >> 31) )
return 0;
v4 = (_DWORD *)*a1;
v5 = OPENSSL_sk_delete((int *)*a1, v3);
v6 = OPENSSL_sk_num((int)v4);
a1[1] = 1;
v7 = v6;
if ( v3 != v6 )
{
if ( v3 )
v8 = *(_DWORD *)(OPENSSL_sk_value(v4, v3 - 1) + 8);
else
v8 = *(_DWORD *)(v5 + 8) - 1;
if ( *(_DWORD *)(OPENSSL_sk_value(v4, v3) + 8) > v8 + 1 && v3 < v7 )
{
do
{
v9 = OPENSSL_sk_value(v4, v3++);
--*(_DWORD *)(v9 + 8);
}
while ( v3 != v7 );
}
}
return v5;
}