//
// sub_6183C from 0x6183c to 0x6193c (256 bytes)
//
// 4 xrefs:
// > sub_58CA8 @ 0x59130
// > sub_9E338 @ 0x9e3d2
// > sub_A6FB8 @ 0xa7054
// > sub_A7770 @ 0xa77e8
//
// 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 11:40:51 +0000
//
int __fastcall sub_6183C(_DWORD *a1)
{
_DWORD *v2; // r5
int v3; // r10
int v4; // r9
int v5; // r0
void *v6; // r6
_DWORD *v7; // r0
int v8; // r2
unsigned int v9; // r5
unsigned int v10; // r1
int v11; // r2
int i; // r4
unsigned int v13; // r1
_DWORD *v15; // [sp+10h] [bp-20h]
v2 = a1 + 16768;
v3 = a1[17185];
v4 = a1[16722] * a1[298] + 4;
v5 = sub_BD410(a1 + 16768, 4 * v3 * v4 + 512, &unk_2191F, 0);
if ( !v5 )
return 38;
v6 = (void *)v5;
v7 = (_DWORD *)sub_BD580(
*(int *)((char *)&dword_14C + (_DWORD)off_E8000),
16,
"../../src/fmod_systemi_dsp.cpp",
126,
0);
if ( !v7 )
{
sub_BD7AC(v2, v6, &unk_2191F, 0, 1);
return 38;
}
v7[3] = v6;
v7[1] = v7;
v7[2] = 0;
v8 = a1[16718];
v9 = ((unsigned int)v6 + 127) & 0xFFFFFF80;
*v7 = a1 + 16717;
v7[1] = v8;
a1[16718] = v7;
v15 = a1 + 16718;
*(_DWORD *)v7[1] = v7;
memset(v6, 0, 4 * v3 * v4 + 512);
v10 = v9 + 16;
v11 = v3 - 1;
for ( i = 0; i < v11; ++i )
{
*(_DWORD *)(v10 - 16) = v10 + 4 * v4 - 16;
*(_DWORD *)(v10 - 12) = 0;
*(_DWORD *)(v10 - 8) = v10;
v10 += 4 * v4;
}
*(_DWORD *)(v9 + 4 * v11 * v4) = v15[3];
v13 = v9 + 4 * v11 * v4;
*(_DWORD *)(v13 + 4) = 0;
*(_DWORD *)(v13 + 8) = v13 + 16;
v15[3] = v9;
return 0;
}