//
// sub_DEA1A8 from 0xdea1a8 to 0xdea7e8 (1600 bytes)
//
// 2 xrefs:
// > sub_DEA7E8 @ 0xdea840
// > sub_DEE968 @ 0xdef77c
//
// 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:13 +0000
//
__int64 __fastcall sub_DEA1A8(__int64 a1, _QWORD *a2, __int64 *a3, const char *a4, _QWORD *a5)
{
__int64 *v5; // x23
const char *v9; // x0
char *v10; // d10
const char *v11; // x3
unsigned int v12; // w21
void *v13; // x26
_QWORD *v14; // d9
unsigned int v15; // w28
size_t v16; // x3
__int64 v17; // x0
__int64 *v18; // x22
const char *v19; // x3
__int64 i; // x24
__int64 v21; // x0
const char *v22; // x24
__int64 v23; // x0
unsigned int v24; // w0
_BOOL4 v25; // w0
FILE *v26; // x0
const char *v27; // x2
unsigned int v28; // w1
size_t v29; // x3
__int64 v30; // x0
char *v31; // x1
void *v33; // x0
_QWORD *v34; // x19
_QWORD *v36; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v37; // [xsp+B8h] [xbp+B8h] BYREF
int v38; // [xsp+C0h] [xbp+C0h]
int v39; // [xsp+C4h] [xbp+C4h]
char ptr[512]; // [xsp+C8h] [xbp+C8h] BYREF
v5 = a3;
v36 = nullptr;
v37 = 0;
*a2 = 0;
if ( !a3 )
return 0;
if ( (unsigned int)sub_E254E0(a1) )
return 27;
v9 = (const char *)sub_E05A38("------------------------%08x%08x", v38, v39);
v10 = (char *)v9;
if ( !v9 )
return 27;
if ( a4 )
v11 = a4;
else
v11 = "Content-Type: multipart/form-data";
v12 = sub_DE9150(&v36, nullptr, (__int64)"%s; boundary=%s\r\n", v11, v9);
if ( v12 )
{
off_154A3C8(v10);
return v12;
}
v13 = nullptr;
v14 = v36;
LABEL_8:
if ( !v37 || (v15 = sub_DE9150(&v36, &v37, (__int64)&word_11B03F8)) == 0 )
{
v15 = sub_DE9150(&v36, &v37, (__int64)"--%s\r\n", v10);
if ( !v15 )
{
v15 = sub_DE9150(&v36, &v37, (__int64)"Content-Disposition: form-data; name=\"");
if ( !v15 )
{
v16 = v5[2];
if ( (v16 & 0x8000000000000000LL) != 0 || v37 < 0 )
{
LABEL_53:
v15 = 43;
}
else
{
v15 = sub_DE8F94(&v36, 1u, (const char *)v5[1], v16, &v37);
if ( !v15 )
{
v15 = sub_DE9150(&v36, &v37, (__int64)&byte_11ACB00);
if ( !v15 )
{
v17 = v5[9];
if ( !v17 )
goto LABEL_21;
off_154A3C8(v13);
if ( (unsigned int)sub_E254E0(a1) )
{
v13 = nullptr;
v15 = 27;
}
else
{
v13 = (void *)sub_E05A38("------------------------%08x%08x", v38, v39);
if ( v13 )
{
v15 = sub_DE9150(
&v36,
&v37,
(__int64)"\r\nContent-Type: multipart/mixed; boundary=%s\r\n",
(const char *)v13);
if ( !v15 )
{
v17 = v5[9];
LABEL_21:
v18 = v5;
if ( v17 )
{
LABEL_22:
v15 = sub_DE9150(
&v36,
&v37,
(__int64)"\r\n--%s\r\nContent-Disposition: attachment",
(const char *)v13);
if ( !v15 )
{
v15 = sub_DE9254((const char *)v18[3], (char *)v18[11], &v36, &v37);
if ( !v15 )
goto LABEL_24;
}
goto LABEL_54;
}
while ( 1 )
{
v30 = v5[10];
if ( (v30 & 0x51) != 0 )
{
v31 = (char *)v5[11];
if ( v31 || (v30 & 1) != 0 )
{
v15 = sub_DE9254((const char *)v5[3], v31, &v36, &v37);
if ( v15 )
goto LABEL_54;
}
}
LABEL_24:
v19 = (const char *)v18[7];
if ( v19 )
{
v15 = sub_DE9150(&v36, &v37, (__int64)"\r\nContent-Type: %s", v19);
if ( v15 )
goto LABEL_54;
}
for ( i = v18[8]; i; i = *(_QWORD *)(i + 8) )
{
v15 = sub_DE9150(&v36, &v37, (__int64)"\r\n%s", *(const char **)i);
if ( v15 )
goto LABEL_54;
}
v15 = sub_DE9150(&v36, &v37, (__int64)"\r\n\r\n");
if ( v15 )
goto LABEL_54;
v21 = v5[10];
if ( (v21 & 3) == 0 )
break;
v22 = (const char *)v18[3];
if ( !strcmp(&byte_1191DE0, v22) )
goto LABEL_34;
v26 = fopen(v22, "rb");
if ( !v26 )
{
if ( a1 )
sub_DF1848(a1, "couldn't open file \"%s\"", (const char *)v18[3]);
v15 = 26;
*a2 = 0;
goto LABEL_54;
}
if ( v26 != &_sF )
{
fclose(v26);
v27 = (const char *)v18[3];
if ( v37 < 0 )
goto LABEL_53;
v28 = 4;
v29 = 0;
goto LABEL_43;
}
LABEL_34:
while ( 1 )
{
v23 = fread(ptr, 1u, 0x200u, &_sF);
if ( !v23 )
break;
if ( v23 < 0 || v37 < 0 )
{
v25 = 0;
v15 = 43;
goto LABEL_44;
}
v24 = sub_DE8F94(&v36, 2u, ptr, v23, &v37);
if ( v24 )
{
v15 = v24;
v25 = 0;
goto LABEL_44;
}
}
v25 = 1;
LABEL_44:
v18 = (__int64 *)v18[9];
if ( !v25 || !v18 )
{
if ( !v15
&& (!v5[9] || (v15 = sub_DE9150(&v36, &v37, (__int64)"\r\n--%s--", (const char *)v13)) == 0) )
{
v5 = (__int64 *)*v5;
if ( v5 )
goto LABEL_8;
v15 = sub_DE9150(&v36, &v37, (__int64)&unk_11B03F0, v10);
if ( !v15 )
{
*a5 = v37;
off_154A3C8(v13);
off_154A3C8(v10);
*a2 = v14;
return 0;
}
}
goto LABEL_54;
}
if ( v5[9] )
goto LABEL_22;
}
if ( (v21 & 0x10) != 0 )
{
v29 = v5[6];
v27 = (const char *)v5[5];
if ( (v29 & 0x8000000000000000LL) != 0 )
goto LABEL_53;
}
else
{
if ( (v21 & 0x40) != 0 )
{
v27 = (const char *)v5[12];
if ( (v21 & 0x80) != 0 )
v29 = v5[13];
else
v29 = v5[4];
if ( (v29 & 0x8000000000000000LL) != 0 || v37 < 0 )
goto LABEL_53;
v28 = 3;
goto LABEL_43;
}
v27 = (const char *)v5[3];
if ( (v21 & 0x80) != 0 )
v29 = v5[13];
else
v29 = v5[4];
if ( (v29 & 0x8000000000000000LL) != 0 )
goto LABEL_53;
}
if ( v37 < 0 )
goto LABEL_53;
v28 = 2;
LABEL_43:
v15 = sub_DE8F94(&v36, v28, v27, v29, &v37);
v25 = v15 == 0;
goto LABEL_44;
}
}
else
{
v15 = 27;
}
}
}
}
}
}
}
}
LABEL_54:
if ( v14 )
{
do
{
v34 = (_QWORD *)*v14;
if ( *((_DWORD *)v14 + 2) <= 2u )
off_154A3C8((void *)v14[2]);
v33 = v14;
v14 = v34;
off_154A3C8(v33);
}
while ( v34 );
}
off_154A3C8(v13);
off_154A3C8(v10);
return v15;
}