//
// ERR_pop_to_mark from 0x7fb674 to 0x7fb734 (192 bytes)
//
// 5 xrefs:
// > PKCS12_parse @ 0x824ed0
// > X509_print_ex @ 0x83dca4
// > sub_84A58C @ 0x84a5d0
// > engine_table_select @ 0x8b4754
// > ??> @ 0x629fc
//
// 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 ERR_pop_to_mark()
{
int state; // r4
int v1; // r3
int v2; // r12
_DWORD *v3; // r2
int v4; // r2
int v5; // r1
_DWORD *v6; // r0
int v7; // r1
state = ERR_get_state();
v1 = *(_DWORD *)(state + 384);
v2 = *(_DWORD *)(state + 388);
while ( 1 )
{
v4 = 4 * v1;
if ( v2 == v1 )
break;
v5 = *(_DWORD *)(state + 4 * v1);
v6 = (_DWORD *)(state + v4);
if ( (v5 & 1) != 0 )
{
*(_DWORD *)(state + 4 * v1) = v5 & 0xFFFFFFFE;
return 1;
}
*(_DWORD *)(state + 4 * v1) = 0;
v7 = v6[48];
v6[16] = 0;
if ( (v7 & 1) != 0 )
{
CRYPTO_free(v6[32], "crypto/err/err.c", 759);
v1 = *(_DWORD *)(state + 384);
v2 = *(_DWORD *)(state + 388);
v4 = 4 * v1;
*(_DWORD *)(state + 4 * (v1 + 32)) = 0;
}
--v1;
v3 = (_DWORD *)(state + v4);
v3[48] = 0;
v3[64] = 0;
v3[80] = -1;
*(_DWORD *)(state + 384) = v1;
if ( v1 == -1 )
{
v1 = 15;
*(_DWORD *)(state + 384) = 15;
}
}
return 0;
}