//
// ssl3_shutdown from 0xd38030 to 0xd3812c (252 bytes)
//
// 14 xrefs:
// > dtls1_shutdown @ 0xd5dd14
// > ??> @ 0x49d88
// > ??> @ 0x121f200
// > ??> @ 0x121f2e0
// > ??> @ 0x121f3c0
// > ??> @ 0x121f4a0
// > ??> @ 0x121f580
// > ??> @ 0x121f660
// > ??> @ 0x121f740
// > ??> @ 0x121f820
// > ??> @ 0x121f900
// > ??> @ 0x121f9e0
// > ??> @ 0x121fac0
// > ??> @ 0x121fba0
//
// 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 ssl3_shutdown(__int64 a1)
{
unsigned int v2; // w20
int v4; // w0
int v5; // w0
if ( *(_DWORD *)(a1 + 64) || (v2 = SSL_in_before()) != 0 )
{
v2 = 1;
*(_DWORD *)(a1 + 68) = 3;
return v2;
}
v4 = *(_DWORD *)(a1 + 68);
if ( (v4 & 1) != 0 )
{
if ( *(_DWORD *)(*(_QWORD *)(a1 + 144) + 244LL) )
{
if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)(a1 + 8) + 120LL))(a1) == -1 )
return (unsigned int)-1;
v5 = *(_DWORD *)(a1 + 68);
}
else
{
if ( (v4 & 2) != 0 )
goto LABEL_8;
(*(void (__fastcall **)(__int64, _QWORD, _QWORD, _QWORD, _QWORD, _QWORD))(*(_QWORD *)(a1 + 8) + 104LL))(
a1,
0,
0,
0,
0,
0);
v5 = *(_DWORD *)(a1 + 68);
if ( (v5 & 2) == 0 )
return (unsigned int)-1;
}
if ( v5 == 3 && !*(_DWORD *)(*(_QWORD *)(a1 + 144) + 244LL) )
return 1;
return v2;
}
*(_DWORD *)(a1 + 68) = v4 | 1;
ssl3_send_alert(a1, 1, 0);
if ( *(_DWORD *)(*(_QWORD *)(a1 + 144) + 244LL) )
return (unsigned int)-1;
v4 = *(_DWORD *)(a1 + 68);
LABEL_8:
if ( v4 == 3 )
return 1;
return v2;
}