//
// sub_DF3D08 from 0xdf3d08 to 0xdf3ea8 (416 bytes)
//
// 2 xrefs:
// > ??> @ 0x13fbd30
// > ??> @ 0x13fbdb0
//
// 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:09:19 +0000
//
__int64 __fastcall sub_DF3D08(_BYTE *a1, unsigned __int8 a2)
{
int v2; // w21
_BYTE *v4; // x19
void *v5; // x1
char *v6; // x0
__int64 v7; // x20
int v8; // w21
int v9; // w0
bool v10; // cc
__int64 v12; // x22
const char *v13; // x0
v2 = a2;
v4 = a1 + 1560;
if ( a2 )
{
a1[1705] = 0;
}
else if ( a1[1705] )
{
if ( (unsigned int)sub_E20668(v4, "%s", "QUIT") )
{
v12 = *(_QWORD *)a1;
v13 = (const char *)sub_E150EC();
sub_DF1848(v12, "Failure sending QUIT command: %s", v13);
a1[1705] = v2;
sub_E0F4CC(a1, 1);
*((_DWORD *)v4 + 44) = v2;
}
else
{
*((_DWORD *)v4 + 44) = 34;
while ( !(unsigned int)sub_E202AC(v4, 1) && *((_DWORD *)v4 + 44) )
;
}
}
v5 = *((void **)v4 + 14);
if ( v5 )
{
if ( v5 == *(void **)(*(_QWORD *)a1 + 35992LL) )
*(_QWORD *)(*(_QWORD *)a1 + 35992LL) = 0;
off_154A3C8(v5);
*((_QWORD *)v4 + 14) = 0;
}
v6 = *((char **)v4 + 15);
if ( v6 )
{
if ( *((int *)v4 + 32) > 0 )
{
v7 = 0;
v8 = 0;
do
{
++v8;
off_154A3C8(*(void **)&v6[v7]);
v9 = *((_DWORD *)v4 + 32);
*(_QWORD *)(*((_QWORD *)v4 + 15) + v7) = 0;
v10 = v8 < v9;
v7 += 8;
v6 = *((char **)v4 + 15);
}
while ( v10 );
}
off_154A3C8(v6);
*((_QWORD *)v4 + 15) = 0;
*((_DWORD *)v4 + 32) = 0;
}
off_154A3C8(*((void **)v4 + 17));
*((_QWORD *)v4 + 17) = 0;
off_154A3C8(*((void **)v4 + 26));
*((_QWORD *)v4 + 26) = 0;
off_154A3C8(*((void **)v4 + 19));
*((_QWORD *)v4 + 19) = 0;
off_154A3C8(*((void **)v4 + 24));
*((_QWORD *)v4 + 24) = 0;
sub_E20C80(v4);
return 0;
}