//
// sub_E140FC from 0xe140fc to 0xe1432c (560 bytes)
//
// 3 xrefs:
// > sub_E1432C @ 0xe143c4
// > sub_E14404 @ 0xe14464
// > sub_E14404 @ 0xe14568
//
// 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:41 +0000
//
__int64 __fastcall sub_E140FC(__int64 *a1, __int64 a2)
{
__int64 v2; // x19
int v5; // w23
__int64 v6; // x25
void *v7; // x0
void *v8; // x21
unsigned int v9; // w0
unsigned int v10; // w20
const char *v11; // x2
__int64 v12; // x0
int v14; // w3
int v15; // w25
unsigned int v16; // w23
v2 = a2 + 216;
v5 = *(_DWORD *)(a2 + 224);
v6 = *(_QWORD *)(a2 + 216);
v7 = off_154A3C0(0x4000u);
v8 = v7;
if ( !v7 )
{
inflateEnd(v2);
*(_DWORD *)(a2 + 212) = 0;
return 27;
}
*(_QWORD *)(v2 + 24) = v7;
*(_DWORD *)(v2 + 32) = 0x4000;
v9 = inflate(v2, 2);
v10 = v9;
if ( v9 <= 1 )
goto LABEL_12;
if ( v9 != -3 )
{
LABEL_7:
off_154A3C8(v8);
LABEL_8:
v11 = *(const char **)(a2 + 264);
v12 = *a1;
if ( v11 )
goto LABEL_9;
LABEL_18:
sub_DF1848(v12, "Error while processing content unencoding: Unknown failure within decompression software.");
goto LABEL_10;
}
inflateEnd(v2);
if ( !(unsigned int)inflateInit2_(v2, 4294967281LL, "1.2.8", 112) )
{
*(_QWORD *)(a2 + 216) = v6;
*(_DWORD *)(v2 + 8) = v5;
while ( 1 )
{
*(_QWORD *)(v2 + 24) = v8;
*(_DWORD *)(v2 + 32) = 0x4000;
v10 = inflate(v2, 2);
if ( v10 > 1 )
goto LABEL_7;
LABEL_12:
v14 = *(_DWORD *)(v2 + 32);
if ( v14 != 0x4000 )
{
v15 = *(unsigned __int8 *)(a2 + 369);
if ( !*(_BYTE *)(a2 + 369) )
{
v16 = sub_DF23A8((__int64)a1, 1, (char *)v8, (unsigned int)(0x4000 - v14));
if ( v16 )
{
off_154A3C8(v8);
inflateEnd(v2);
*(_DWORD *)(a2 + 212) = v15;
return v16;
}
}
}
if ( v10 == 1 )
{
off_154A3C8(v8);
if ( (unsigned int)inflateEnd(v2) )
goto LABEL_8;
inflateEnd(v2);
*(_DWORD *)(a2 + 212) = 0;
return 0;
}
if ( !*(_DWORD *)(v2 + 8) )
{
off_154A3C8(v8);
return 0;
}
}
}
off_154A3C8(v8);
v11 = *(const char **)(a2 + 264);
v12 = *a1;
if ( !v11 )
goto LABEL_18;
LABEL_9:
sub_DF1848(v12, "Error while processing content unencoding: %s", v11);
LABEL_10:
inflateEnd(v2);
*(_DWORD *)(a2 + 212) = 0;
return 61;
}