//
// sub_908FC4 from 0x908fc4 to 0x90909a (214 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:04:20 +0000
//
int __fastcall sub_908FC4(_DWORD *a1, int a2)
{
int v2; // r11
_DWORD *v3; // r6
int v5; // r2
int v6; // r4
int v7; // r3
int v8; // r1
int v9; // lr
size_t v10; // r9
int v11; // r0
int v12; // r8
size_t v13; // r7
int v14; // r10
void *v15; // r0
const void *v16; // r1
int i; // r4
int v18; // r0
const void *v19; // r1
int v21; // [sp+4h] [bp-18h]
int v22; // [sp+8h] [bp-14h]
int v23; // [sp+Ch] [bp-10h]
int v24; // [sp+10h] [bp-Ch]
int v25; // [sp+14h] [bp-8h]
v3 = *(_DWORD **)a2;
v5 = a1[2];
v6 = a1[4];
v7 = *(_DWORD *)(*(_DWORD *)a2 + 40);
v8 = *(_DWORD *)(*(_DWORD *)a2 + 36);
v9 = v5 >> 1;
v10 = a1[3];
v11 = v3[8];
if ( v6 > 0 )
v2 = 0;
v12 = (v6 + 1) / 2;
v13 = (int)(v10 + 1) / 2;
v14 = v11 * v5;
if ( v6 > 0 )
{
v25 = (int)(v10 + 1) / 2;
v13 = v3[4];
}
v23 = v8 * v9;
v21 = v3[5];
v24 = v7 * v9;
v22 = v3[6];
if ( v6 > 0 )
{
while ( 1 )
{
v15 = (void *)(v14 + v11 * v2 + v13);
v16 = (const void *)(a1[5] + a1[8] * v2++);
memcpy(v15, v16, v10);
if ( v2 == v6 )
break;
v11 = v3[8];
}
v13 = v25;
}
if ( v12 > 0 )
{
for ( i = 0; i != v12; ++i )
{
memcpy((void *)(v23 + v3[9] * i + v21), (const void *)(a1[6] + a1[9] * i), v13);
v18 = v24 + v3[10] * i;
v19 = (const void *)(a1[7] + a1[9] * i);
memcpy((void *)(v18 + v22), v19, v13);
}
}
return a1[4];
}