//
// png_do_packswap from 0x870e40 to 0x870e82 (66 bytes)
//
// 2 xrefs:
// > png_do_read_transformations @ 0x86a858
// > png_do_write_transformations @ 0x8735e8
//
// 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:02:58 +0000
//
_DWORD *__fastcall png_do_packswap(_DWORD *result, _BYTE *a2)
{
unsigned int v2; // r3
int v3; // r2
_BYTE *v4; // r2
v2 = *((unsigned __int8 *)result + 9);
if ( v2 <= 7 )
{
v3 = result[1];
switch ( v2 )
{
case 1u:
result = &unk_C21748;
break;
case 2u:
result = &unk_C21848;
break;
case 4u:
result = &unk_C21948;
break;
default:
return result;
}
v4 = &a2[v3];
if ( a2 < v4 )
{
do
{
*a2 = *((_BYTE *)result + (unsigned __int8)*a2);
++a2;
}
while ( a2 != v4 );
}
}
return result;
}