//
// inflateCopy from 0x94dbb4 to 0x94dcd6 (290 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:05:21 +0000
//
int __fastcall inflateCopy(_DWORD *a1, int *a2)
{
bool v2; // zf
int v3; // r4
int (__fastcall *v4)(int, int, int); // r3
_DWORD *v7; // r6
void *v8; // r7
int *v9; // r2
int *v10; // r3
_DWORD *v11; // lr
int v12; // r8
int v13; // r12
int v14; // r0
int v15; // r1
int v16; // r12
int v17; // r3
unsigned int v18; // r2
int v19; // r1
v2 = a2 == nullptr;
if ( a2 )
v2 = a1 == nullptr;
if ( v2 )
return -2;
v3 = a2[7];
if ( !v3 )
return -2;
v4 = (int (__fastcall *)(int, int, int))a2[8];
if ( !v4 || !a2[9] )
return -2;
v7 = (_DWORD *)v4(a2[10], 1, 7116);
if ( !v7 )
return -4;
v8 = *(void **)(v3 + 52);
if ( v8 && (v8 = (void *)((int (__fastcall *)(int, int, int))a2[8])(a2[10], 1 << *(_DWORD *)(v3 + 36), 1)) == nullptr )
{
((void (__fastcall *)(int, _DWORD *))a2[9])(a2[10], v7);
return -4;
}
else
{
v9 = a2 + 12;
v10 = a2;
v11 = a1;
do
{
v12 = *v10;
v10 += 4;
v13 = *(v10 - 3);
v11 += 4;
v14 = *(v10 - 2);
v15 = *(v10 - 1);
*(v11 - 4) = v12;
*(v11 - 3) = v13;
*(v11 - 2) = v14;
*(v11 - 1) = v15;
}
while ( v10 != v9 );
v16 = *v10;
v17 = v10[1];
*v11 = v16;
v11[1] = v17;
memcpy(v7, (const void *)v3, 0x1BCCu);
v18 = *(_DWORD *)(v3 + 76);
v19 = v3 + 1328;
if ( v18 >= v3 + 1328 && v18 <= v3 + 7100 )
{
v7[19] = (char *)v7 + ((v18 - v19) & 0xFFFFFFFC) + 1328;
v7[20] = (char *)v7 + ((*(_DWORD *)(v3 + 80) - v19) & 0xFFFFFFFC) + 1328;
}
v7[27] = (char *)v7 + ((*(_DWORD *)(v3 + 108) - v19) & 0xFFFFFFFC) + 1328;
if ( v8 )
memcpy(v8, *(const void **)(v3 + 52), 1 << *(_DWORD *)(v3 + 36));
v7[13] = v8;
a1[7] = v7;
return 0;
}
}