//
// SSL_set0_wbio from 0xd3f694 to 0xd3f6f4 (96 bytes)
//
// 4 xrefs:
// > SSL_set_bio @ 0xd3f788
// > SSL_set_wfd @ 0xd3f944
// > SSL_set_wfd @ 0xd3f9b8
// > ??> @ 0xc5d48
//
// 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 SSL_set0_wbio(__int64 a1, __int64 a2)
{
__int64 v3; // x0
__int64 result; // x0
__int64 v5; // [xsp+28h] [xbp+28h]
__int64 v6; // [xsp+28h] [xbp+28h]
if ( *(_QWORD *)(a1 + 32) )
{
v5 = a2;
v3 = BIO_pop(*(_QWORD *)(a1 + 24));
*(_QWORD *)(a1 + 24) = v3;
a2 = v5;
}
else
{
v3 = *(_QWORD *)(a1 + 24);
}
v6 = a2;
BIO_free_all(v3);
result = *(_QWORD *)(a1 + 32);
*(_QWORD *)(a1 + 24) = v6;
if ( result )
{
result = BIO_push(result, v6);
*(_QWORD *)(a1 + 24) = result;
}
return result;
}