//
// sub_10023E92C from 0x10023e92c to 0x10023ea54 (296 bytes)
//
// 1 xrefs:
// > sub_10023EA54 @ 0x10023ea74
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_10023E92C(Bytef *a1, uInt a2, void **a3, _DWORD *a4, int a5)
{
signed int v5; // w20
int v10; // w8
Bytef *v11; // x0
__int64 v12; // x22
char *v13; // x0
__int64 v14; // x0
z_stream v16; // [xsp+0h] [xbp-A0h] BYREF
v5 = a5;
if ( a5 < 0 )
v10 = -1;
else
v10 = a5;
v11 = (Bytef *)operator new[](v10);
*a3 = v11;
memset(&v16.zalloc, 0, 24);
v16.next_in = a1;
v16.avail_in = a2;
v16.next_out = v11;
v16.avail_out = v5;
v12 = inflateInit2_(&v16, 47, "1.2.12", 112);
if ( !(_DWORD)v12 )
{
while ( 1 )
{
v14 = inflate(&v16, 0);
v12 = v14;
if ( (unsigned int)(v14 + 4) < 2 )
goto LABEL_13;
if ( (_DWORD)v14 == 1 )
{
*a4 = v5 - v16.avail_out;
return inflateEnd(&v16);
}
if ( (_DWORD)v14 == 2 )
{
v12 = 4294967293LL;
LABEL_13:
inflateEnd(&v16);
return v12;
}
v13 = (char *)realloc(*a3, 2 * v5);
*a3 = v13;
if ( !v13 )
break;
v16.next_out = (Bytef *)&v13[v5];
v16.avail_out = v5;
v5 *= 2;
}
inflateEnd(&v16);
return 4294967292LL;
}
return v12;
}