//
// ERR_get_error from 0x7fb138 to 0x7fb1bc (132 bytes)
//
// 13 xrefs:
// > sub_641BFC @ 0x641c74
// > sub_641F78 @ 0x641fd8
// > sub_643938 @ 0x643c90
// > sub_643938 @ 0x643f92
// > sub_643938 @ 0x6440a4
// > sub_643938 @ 0x64433c
// > sub_643938 @ 0x64440a
// > sub_643938 @ 0x6444bc
// > sub_643938 @ 0x644524
// > sub_6449AC @ 0x6449ee
// > sub_644B1C @ 0x644c08
// > sub_645094 @ 0x64511e
// > ??> @ 0x54b0c
//
// 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_get_error()
{
int state; // r0
int v1; // r3
int v2; // r3
_DWORD *v3; // r5
int v4; // r4
int v5; // r3
state = ERR_get_state();
v1 = *(_DWORD *)(state + 388);
if ( v1 == *(_DWORD *)(state + 384) )
return 0;
v2 = (v1 + 1) % 16;
v3 = (_DWORD *)(state + 4 * v2);
v4 = v3[16];
*(_DWORD *)(state + 388) = v2;
v5 = v3[48];
v3[16] = 0;
if ( (v5 & 1) != 0 )
{
CRYPTO_free(v3[32], "crypto/err/err.c", 481);
v3[32] = 0;
}
v3[48] = 0;
return v4;
}