//
// BIO_callback_ctrl from 0xd76d54 to 0xd76e3c (232 bytes)
//
// 8 xrefs:
// > sub_D2F518 @ 0xd2f548
// > sub_D75944 @ 0xd7594c
// > sub_D777D0 @ 0xd778f4
// > sub_E5E870 @ 0xe5e894
// > sub_E5F2CC @ 0xe5f2f0
// > sub_E7D7B8 @ 0xe7d7dc
// > sub_E80A84 @ 0xe80aa8
// > ??> @ 0x49620
//
// 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
//
__int64 __fastcall BIO_callback_ctrl(__int64 result, unsigned int a2, __int64 a3)
{
__int64 v3; // x19
__int64 (*v5)(void); // x3
__int64 (*v6)(void); // x21
__int64 v7; // x0
__int64 v8; // [xsp+38h] [xbp+38h] BYREF
v8 = a3;
v3 = result;
if ( result )
{
if ( *(_QWORD *)result && (v5 = *(__int64 (**)(void))(*(_QWORD *)result + 72LL)) != nullptr )
{
v6 = *(__int64 (**)(void))(result + 8);
if ( v6 )
{
result = v6();
if ( result > 0 )
{
v7 = (*(__int64 (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v3 + 72LL))(v3, a2, v8);
return ((__int64 (__fastcall *)(__int64, __int64, __int64 *, _QWORD, _QWORD, __int64))v6)(
v3,
134,
&v8,
a2,
0,
v7);
}
}
else
{
return v5();
}
}
else
{
ERR_put_error(32, 131, 121, "crypto/bio/bio_lib.c", 364);
return -2;
}
}
return result;
}