//
// inflateSetDictionary from 0xf3b184 to 0xf3b338 (436 bytes)
//
// 1 xrefs:
// > ??> @ 0xeee58
//
// 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:13:04 +0000
//
__int64 __fastcall inflateSetDictionary(__int64 a1, unsigned __int8 *a2, unsigned int a3)
{
__int64 v3; // x23
__int64 v7; // x20
char *v8; // x0
unsigned __int8 *v9; // x22
unsigned int v10; // w3
char v11; // w3
int v12; // w19
char *v13; // x0
unsigned int v14; // w19
unsigned int v15; // w21
unsigned int v16; // w1
unsigned int v17; // w0
unsigned int v18; // w0
unsigned __int64 v20; // x0
if ( !a1 )
return 4294967294LL;
v3 = *(_QWORD *)(a1 + 56);
if ( !v3 )
return 4294967294LL;
if ( !*(_DWORD *)(v3 + 8) )
{
v7 = *(_QWORD *)(a1 + 56);
if ( *(_DWORD *)v3 != 10 )
goto LABEL_5;
goto LABEL_18;
}
if ( *(_DWORD *)v3 != 10 )
return 4294967294LL;
LABEL_18:
v20 = adler32(0, nullptr, 0);
if ( *(_QWORD *)(v3 + 24) != adler32(v20, a2, a3) )
return 4294967293LL;
v7 = *(_QWORD *)(a1 + 56);
LABEL_5:
v8 = *(char **)(v7 + 64);
v9 = &a2[a3];
if ( v8
|| (v8 = (char *)(*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64))(a1 + 64))(
*(_QWORD *)(a1 + 80),
(unsigned int)(1 << *(_DWORD *)(v7 + 48)),
1),
(*(_QWORD *)(v7 + 64) = v8) != 0) )
{
v10 = *(_DWORD *)(v7 + 52);
if ( !v10 )
{
v11 = *(_DWORD *)(v7 + 48);
*(_DWORD *)(v7 + 60) = 0;
v10 = 1 << v11;
*(_QWORD *)(v7 + 52) = v10;
}
if ( a3 >= v10 )
{
memcpy(v8, &v9[-v10], v10);
*(_DWORD *)(v7 + 60) = 0;
*(_DWORD *)(v7 + 56) = *(_DWORD *)(v7 + 52);
}
else
{
v12 = *(_DWORD *)(v7 + 60);
v13 = &v8[v12];
v14 = v10 - v12;
if ( v14 > a3 )
v14 = a3;
memcpy(v13, &v9[-a3], v14);
v15 = a3 - v14;
if ( v15 )
{
memcpy(*(void **)(v7 + 64), &v9[-v15], v15);
*(_DWORD *)(v7 + 60) = v15;
*(_DWORD *)(v7 + 56) = *(_DWORD *)(v7 + 52);
}
else
{
v16 = *(_DWORD *)(v7 + 52);
v17 = v14 + *(_DWORD *)(v7 + 60);
*(_DWORD *)(v7 + 60) = v17;
if ( v17 == v16 )
*(_DWORD *)(v7 + 60) = 0;
v18 = *(_DWORD *)(v7 + 56);
if ( v16 > v18 )
*(_DWORD *)(v7 + 56) = v14 + v18;
}
}
*(_DWORD *)(v3 + 12) = 1;
return 0;
}
else
{
*(_DWORD *)v3 = 30;
return 4294967292LL;
}
}