//
// sub_9CAFC from 0x9cafc to 0x9cc32 (310 bytes)
//
// 1 xrefs:
// > sub_9CD7C @ 0x9cd9e
//
// 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:41:31 +0000
//
int __fastcall sub_9CAFC(int a1, float *a2)
{
int v4; // r1
_DWORD *v5; // r6
int i; // r2
int v7; // r5
int result; // r0
float *v9; // r3
int v10; // r12
int v11; // r5
int v12; // lr
float *v13; // r1
float *v14; // r6
float *v15; // r4
float v16; // s14
float v17; // s0
float v18; // s4
float v19; // s10
float v20; // s2
float v21; // s7
float v22; // s6
float v23; // s12
float v24; // s0
float v25; // s8
float v26; // s2
float v27; // s3
float v28; // s4
int v29; // r1
float *v30; // r3
float v31; // s6
float v32; // s0
float v33; // s8
float v34; // s2
float v35; // s0
v4 = 2 * *(_DWORD *)(a1 + 81964);
if ( v4 < 9 )
{
i = 2;
}
else
{
v5 = (_DWORD *)(a1 + 81964);
sub_9C3A8(a1, a2);
for ( i = 8; ; i = v7 )
{
v7 = 4 * i;
if ( 4 * i >= 2 * *v5 )
break;
sub_9C6AC(a1, (int)a2, i);
}
v4 = 2 * *v5;
}
result = i;
if ( v4 == 4 * i )
{
v9 = a2 + 1;
v10 = 2 * i;
v11 = 0;
v12 = 3 * i;
while ( v11 < i )
{
v13 = &v9[v10];
v14 = &v9[v12];
v15 = &v9[result];
v16 = *(v9 - 1);
v17 = v9[v10 - 1];
v11 += 2;
v18 = v9[v12 - 1];
v19 = v9[result - 1];
v20 = v9[2 * i];
v21 = v18 + v17;
v22 = v9[3 * i];
v23 = v9[i];
v24 = v17 - v18;
v25 = v22 + v20;
v26 = v20 - v22;
v27 = v23 + *v9;
v28 = *v9 - v23;
*(v9 - 1) = v21 + (float)(v19 + v16);
*v9 = v25 + v27;
v9 += 2;
*(v13 - 1) = (float)(v19 + v16) - v21;
*v13 = v27 - v25;
*(v15 - 1) = (float)(v16 - v19) - v26;
*v15 = v24 + v28;
*(v14 - 1) = v26 + (float)(v16 - v19);
*v14 = v28 - v24;
}
}
else
{
v29 = 0;
while ( v29 < i )
{
v30 = &a2[result];
v31 = a2[1];
v29 += 2;
v32 = a2[i];
v33 = v32 + *a2;
v34 = v31 - a2[result + 1];
v35 = *a2 - v32;
*a2 = v33;
a2[1] = a2[result + 1] + v31;
a2 += 2;
*v30 = v35;
v30[1] = v34;
}
}
return result * 4;
}