//
// sub_1005BE05C from 0x1005be05c to 0x1005be254 (504 bytes)
//
// 2 xrefs:
// > sub_1005BE254 @ 0x1005be2ac
// > sub_1005BE4BC @ 0x1005be7ec
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:09:19 +0000
//
float32_t __fastcall sub_1005BE05C(__int64 a1, float *a2, float32x4_t a3)
{
_DWORD *v4; // x22
int v5; // w8
float32x4_t v7; // q5
int v8; // w8
__int64 v9; // x21
__int64 v10; // x9
unsigned int v11; // w2
unsigned __int64 v12; // x8
__int64 v13; // x11
signed __int64 v14; // x12
float *v15; // x13
float *v16; // x14
float *v17; // x16
float *v18; // x17
float v19; // s0
__int64 v20; // x0
float v21; // s1
float v22; // s2
__int64 v23; // x1
float v24; // s4
float v25; // s5
float v26; // s0
float v27; // s1
float v28; // s3
float v29; // s4
__int64 v30; // x2
float v31; // s6
float v32; // s7
__int64 v33; // x3
float v34; // s16
float v35; // s3
unsigned __int64 v36; // x8
__int64 v37; // x10
float *v38; // x12
float *v39; // x14
float v40; // s0
float v41; // s2
float v42; // s3
__int64 v43; // x15
float v44; // s4
float32x4x2_t v46; // 0:q1.32
float32x4x2_t v47; // 0:q3.32
v4 = (_DWORD *)(a1 + 81968);
v5 = 2 * *(_DWORD *)(a1 + 81968);
if ( v5 < 9 )
{
v9 = 2;
if ( v5 == 8 )
{
LABEL_6:
if ( (int)v9 >= 1 )
{
v12 = 0;
v13 = v9 << 32;
v14 = (unsigned __int64)(unsigned int)(3 * v9) << 32;
v15 = &a2[3 * (unsigned int)v9];
v16 = a2 + 1;
v17 = &a2[(unsigned int)v9];
v18 = &a2[2 * (unsigned int)v9];
do
{
v19 = *(v16 - 1);
v20 = v12;
v21 = v17[v12];
v22 = v19 + v21;
v23 = (v13 >> 30) | 4;
v24 = *(float *)((char *)a2 + v23);
v25 = (float)-*v16 - v24;
v26 = v19 - v21;
v27 = v24 - *v16;
v28 = v18[v12];
v29 = v15[v12];
v30 = (int)(((2 * v9) | 1) + v12);
v31 = a2[v30];
v32 = v28 + v29;
v33 = (v14 >> 30) | 4;
v34 = *(float *)((char *)a2 + v33);
v35 = v28 - v29;
*(v16 - 1) = v22 + v32;
*v16 = v25 - (float)(v31 + v34);
v16 += 2;
v18[v20] = v22 - v32;
a2[v30] = v25 + (float)(v31 + v34);
v17[v20] = v26 - (float)(v31 - v34);
*(float *)((char *)a2 + v23) = v27 - v35;
v15[v20] = v26 + (float)(v31 - v34);
a3.f32[0] = v27 + v35;
*(float *)((char *)a2 + v33) = v27 + v35;
v12 += 2LL;
v13 += 0x200000000LL;
v14 += 0x200000000LL;
}
while ( v12 < (unsigned int)v9 );
}
return a3.f32[0];
}
}
else
{
a3.f32[0] = sub_1005BC2EC(a1, a2);
v8 = 2 * *v4;
v9 = 8;
if ( v8 >= 33 )
{
v10 = 32;
do
{
v11 = v9;
v9 = v10;
sub_1005BC5BC(a1, a2, v11, a3, v46, v47, v7);
v10 = (unsigned int)(4 * v9);
v8 = 2 * *v4;
}
while ( (int)v10 < v8 );
}
if ( v8 == 4 * (_DWORD)v9 )
goto LABEL_6;
}
if ( (int)v9 >= 1 )
{
v36 = 0;
v37 = v9 << 32;
v38 = &a2[(unsigned int)v9];
do
{
v39 = &a2[v36];
v40 = v38[v36];
v41 = v39[1];
v42 = *v39 - v40;
v43 = (v37 >> 30) | 4;
v44 = *(float *)((char *)a2 + v43);
*v39 = *v39 + v40;
v39[1] = (float)-v41 - v44;
v38[v36] = v42;
a3.f32[0] = v44 - v41;
*(float *)((char *)a2 + v43) = v44 - v41;
v36 += 2LL;
v37 += 0x200000000LL;
}
while ( v36 < (unsigned int)v9 );
}
return a3.f32[0];
}