//
// ERR_set_error_data from 0x101f6b4 to 0x101f730 (124 bytes)
//
// 2 xrefs:
// > ERR_add_error_vdata @ 0x101f824
// > ??> @ 0x83350
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:16:10 +0000
//
__int64 __fastcall ERR_set_error_data(__int64 a1, int a2)
{
__int64 state; // x0
int v5; // w2
__int64 v6; // x20
__int64 v7; // x19
__int64 v8; // x21
__int64 result; // x0
state = ERR_get_state();
v5 = *(_DWORD *)(state + 576);
v6 = state;
if ( !v5 )
v5 = 15;
v7 = v5;
v8 = state + 4LL * v5;
result = *(unsigned int *)(v8 + 320);
if ( (result & 1) != 0 )
result = CRYPTO_free(*(_QWORD *)(v6 + 8 * (v5 + 24LL)), "crypto/err/err.c", 694);
*(_QWORD *)(v6 + 8 * (v7 + 24)) = a1;
*(_DWORD *)(v8 + 320) = a2;
return result;
}