//
// dtls1_clear from 0x9cad10 to 0x9cadcc (188 bytes)
//
// 11 xrefs:
// > ??> @ 0x73e6c
// > ??> @ 0xd15ae8
// > ??> @ 0xd15b5c
// > ??> @ 0xd15bd0
// > ??> @ 0xd15c44
// > ??> @ 0xd15cb8
// > ??> @ 0xd15d2c
// > ??> @ 0xd15da0
// > ??> @ 0xd15e14
// > ??> @ 0xd15e88
// > ??> @ 0xd15efc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:08 +0000
//
int __fastcall dtls1_clear(int a1)
{
_DWORD *v2; // r3
int v3; // r6
int v4; // r5
int v5; // r7
int v6; // r8
__int16 options; // r0
_DWORD *v8; // r3
int result; // r0
int v10; // r3
DTLS_RECORD_LAYER_clear(a1 + 556);
v2 = *(_DWORD **)(a1 + 108);
if ( v2 )
{
v3 = v2[68];
v4 = v2[69];
v5 = v2[70];
v6 = v2[71];
dtls1_clear_received_buffer(a1);
dtls1_clear_sent_buffer(a1);
memset(*(void **)(a1 + 108), 0, 0x194u);
if ( *(_DWORD *)(a1 + 28) )
*(_DWORD *)(*(_DWORD *)(a1 + 108) + 256) = 256;
options = SSL_get_options(a1);
v8 = *(_DWORD **)(a1 + 108);
v8[68] = v3;
v8[69] = v4;
if ( (options & 0x1000) != 0 )
{
v8[71] = v6;
v8[70] = v5;
}
}
result = ssl3_clear(a1);
v10 = **(_DWORD **)(a1 + 4);
if ( v10 == 0x1FFFF )
{
*(_DWORD *)a1 = 65277;
}
else if ( (*(_DWORD *)(a1 + 300) & 0x8000) != 0 )
{
*(_DWORD *)a1 = 256;
*(_DWORD *)(a1 + 324) = 256;
}
else
{
*(_DWORD *)a1 = v10;
}
return result;
}