//
// sub_1022D4 from 0x1022d4 to 0x1024f0 (540 bytes)
//
// 1 xrefs:
// > ??> @ 0x11a100
//
// 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 12:15:13 +0000
//
float32x4_t *__fastcall sub_1022D4(float32x4_t *result, __int64 a2, __int64 a3, __int64 a4, const float *a5)
{
__int64 v5; // x30
float32x4_t v6; // q0
float32x4_t v7; // q1
__int64 v8; // x8
long double v9; // q2
long double v10; // q3
__int64 v11; // x9
__int64 v12; // x5
long double v13; // q0
int8x16_t v14; // q1
long double v15; // q2
int8x16_t v16; // q3
long double v17; // q4
int v18; // w8
unsigned __int64 v19; // d6
__int64 v20; // x10
unsigned int v21; // w9
int16x8_t v22; // q16
float32x4_t v23; // q17
float32x4_t v24; // q6
long double v25; // q5
__int64 v26; // x9
int16x8_t v27; // q16
float32x4_t v28; // q7
float32x4_t v29; // q6
long double *v30; // x9
float32x4_t *v31; // x0
long double v32; // q5
float32x4_t v33; // q16
float32x4_t v34; // q17
float32x4_t v35; // q6
float32x4_t v36; // q7
long double v37; // q4
long double *v38; // x9
int64x2_t v39; // q3
long double v40; // q0
long double v41; // q1
long double v42; // q2
float32x4_t *v43; // x0
float32x4_t v44; // q5
float32x4_t v45; // q16
float32x4_t v46; // q17
float32x4_t v47; // q6
float32x4_t v48; // q7
int v49; // w8
float32x4_t v50; // q0
float32x4_t v51; // q1
__int64 v52; // x9
long double v53; // q2
long double v54; // q3
__int64 v55; // x10
__int64 v56; // x0
__int64 v57; // x1
int v58; // w8
if ( (_DWORD)a2 && ((unsigned __int8)result & 0xF) != 0 )
{
v6 = vld1q_dup_f32(a5);
v7 = vld1q_dup_f32((const float *)a4);
v8 = a3 + 16;
*(_QWORD *)&v9 = 0x3000000030000000LL;
*((_QWORD *)&v9 + 1) = 0x3000000030000000LL;
*(_QWORD *)&v10 = 0x3800000038000000LL;
*((_QWORD *)&v10 + 1) = 0x3800000038000000LL;
do
{
if ( ((unsigned __int8)result & 0xF) == 0 )
break;
v11 = 2LL * (unsigned int)(8 * *(_DWORD *)(a4 + 4));
result = (float32x4_t *)sub_102D18(
*(long double *)&v6,
COERCE_LONG_DOUBLE(vaddq_s32(v7, v6)),
v9,
v10,
COERCE_LONG_DOUBLE(vmulq_f32(vcvtq_f32_u32(vshrq_n_u32(v7, 1u)), *(float32x4_t *)&v9)),
*(long double *)(a3 + v11),
*(long double *)(v8 + v11));
v5 = v12;
*(_QWORD *)a4 += *(_QWORD *)a5;
}
while ( (_DWORD)a2 );
}
if ( (int)a2 >> 2 )
{
result = (float32x4_t *)sub_102CA4(result, a2, a3, a4, a5, v5);
if ( v18 )
{
do
{
v19 = vshl_n_s32(vzip2_s32((int32x2_t)v14.n128_u64[0], (int32x2_t)vextq_s8(v14, v14, 8u).n128_u64[0]), 3u).n64_u64[0];
v20 = a3 + 2LL * (unsigned int)v19;
v21 = HIDWORD(v19);
v22 = *(int16x8_t *)(v20 + 16);
v23 = vcvtq_f32_s32(vmovl_s16(*(int16x4_t *)v20));
v24 = vcvtq_f32_s32(vmovl_high_s16(*(int16x8_t *)v20));
v25 = COERCE_LONG_DOUBLE(vmulq_f32(vcvtq_f32_u32(vshrq_n_u32(vuzp1q_s32(v14, v16), 1u)), *(float32x4_t *)&v13));
v26 = a3 + 2LL * v21;
*result = vmulq_f32(
vmlaq_n_f32(
v23,
vsubq_f32(vcvtq_f32_s32(vmovl_s16((int16x4_t)v22.n128_u64[0])), v23),
*(float *)&v25),
*(float32x4_t *)&v17);
result[1] = vmulq_f32(
vmlaq_n_f32(v24, vsubq_f32(vcvtq_f32_s32(vmovl_high_s16(v22)), v24), *(float *)&v25),
*(float32x4_t *)&v17);
v27 = *(int16x8_t *)(v26 + 16);
v28 = vcvtq_f32_s32(vmovl_s16(*(int16x4_t *)v26));
v29 = vcvtq_f32_s32(vmovl_high_s16(*(int16x8_t *)v26));
v30 = (long double *)(a3
+ 2LL
* vshl_n_s32(
vzip2_s32((int32x2_t)v16.n128_u64[0], (int32x2_t)vextq_s8(v16, v16, 8u).n128_u64[0]),
3u).n64_u32[0]);
result[2] = vmulq_f32(
vmlaq_lane_f32(
v28,
vsubq_f32(vcvtq_f32_s32(vmovl_s16((int16x4_t)v27.n128_u64[0])), v28),
*(float32x2_t *)&v25,
1),
*(float32x4_t *)&v17);
result[3] = vmulq_f32(
vmlaq_lane_f32(v29, vsubq_f32(vcvtq_f32_s32(vmovl_high_s16(v27)), v29), *(float32x2_t *)&v25, 1),
*(float32x4_t *)&v17);
v31 = (float32x4_t *)sub_102DE4(
v13,
COERCE_LONG_DOUBLE(vaddq_s64(v14, *(int64x2_t *)&v15)),
v15,
*(long double *)&v16,
v17,
v25,
*v30,
v30[1]);
v31[4] = vmulq_f32(vmlaq_laneq_f32(v33, v34, *(float32x4_t *)&v32, 2), *(float32x4_t *)&v37);
v31[5] = vmulq_f32(vmlaq_laneq_f32(v35, v36, *(float32x4_t *)&v32, 2), *(float32x4_t *)&v37);
v43 = (float32x4_t *)sub_102DE4(
v40,
v41,
v42,
COERCE_LONG_DOUBLE(vaddq_s64(v39, *(int64x2_t *)&v42)),
v37,
v32,
*v38,
v38[1]);
v43[6] = vmulq_f32(vmlaq_laneq_f32(v45, v46, v44, 3), *(float32x4_t *)&v17);
v43[7] = vmulq_f32(vmlaq_laneq_f32(v47, v48, v44, 3), *(float32x4_t *)&v17);
result = v43 + 8;
}
while ( v49 );
}
*(_QWORD *)a4 = v14.n128_u64[0];
}
if ( (a2 & 3) != 0 )
{
v50 = vld1q_dup_f32(a5);
v51 = vld1q_dup_f32((const float *)a4);
v52 = a3 + 16;
*(_QWORD *)&v53 = 0x3000000030000000LL;
*((_QWORD *)&v53 + 1) = 0x3000000030000000LL;
*(_QWORD *)&v54 = 0x3800000038000000LL;
*((_QWORD *)&v54 + 1) = 0x3800000038000000LL;
do
{
v55 = 2LL * (unsigned int)(8 * *(_DWORD *)(a4 + 4));
v56 = sub_102D18(
*(long double *)&v50,
COERCE_LONG_DOUBLE(vaddq_s32(v51, v50)),
v53,
v54,
COERCE_LONG_DOUBLE(vmulq_f32(vcvtq_f32_u32(vshrq_n_u32(v51, 1u)), *(float32x4_t *)&v53)),
*(long double *)(a3 + v55),
*(long double *)(v52 + v55));
result = (float32x4_t *)sub_102E10(v56, v57);
}
while ( v58 );
}
return result;
}