//
// ssl3_shutdown from 0xfb6384 to 0xfb6480 (252 bytes)
//
// 14 xrefs:
// > dtls1_shutdown @ 0xfdc068
// > ??> @ 0x68188
// > ??> @ 0x1536f88
// > ??> @ 0x1537068
// > ??> @ 0x1537148
// > ??> @ 0x1537228
// > ??> @ 0x1537308
// > ??> @ 0x15373e8
// > ??> @ 0x15374c8
// > ??> @ 0x15375a8
// > ??> @ 0x1537688
// > ??> @ 0x1537768
// > ??> @ 0x1537848
// > ??> @ 0x1537928
//
// 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:15:15 +0000
//
__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;
}