//
// dtls1_write_app_data_bytes from 0x9cbcd0 to 0x9cbd94 (196 bytes)
//
// 11 xrefs:
// > ??> @ 0x73eac
// > ??> @ 0xd15b14
// > ??> @ 0xd15b88
// > ??> @ 0xd15bfc
// > ??> @ 0xd15c70
// > ??> @ 0xd15ce4
// > ??> @ 0xd15d58
// > ??> @ 0xd15dcc
// > ??> @ 0xd15e40
// > ??> @ 0xd15eb4
// > ??> @ 0xd15f28
//
// 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:09 +0000
//
int __fastcall dtls1_write_app_data_bytes(int a1, int a2, _BYTE *a3, signed int a4)
{
int result; // r0
if ( !SSL_in_init(a1) || ossl_statem_get_in_handshake(a1) )
goto LABEL_2;
result = (*(int (__fastcall **)(int))(a1 + 24))(a1);
if ( result < 0 )
return result;
if ( result )
{
LABEL_2:
if ( a4 > 0x4000 )
{
ERR_put_error(20, 268, 334, "ssl/d1_msg.c", 40);
return -1;
}
else
{
return dtls1_write_bytes((_DWORD *)a1, a2, a3, a4);
}
}
else
{
ERR_put_error(20, 268, 229, "ssl/d1_msg.c", 34);
return -1;
}
}