//
// sub_1006012A8 from 0x1006012a8 to 0x10060150c (612 bytes)
//
// 0 xrefs:
//
// 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:57 +0000
//
unsigned __int64 __fastcall sub_1006012A8(__int64 a1, unsigned int a2, unsigned int a3, float32x4_t *a4, double a5)
{
unsigned __int64 v9; // x23
unsigned __int64 v10; // x9
unsigned __int64 v11; // x11
__int64 v12; // x12
__int64 v13; // x14
unsigned __int64 result; // x0
unsigned __int64 v15; // x17
unsigned __int64 v16; // x8
char *v17; // x0
__int64 v18; // x9
__int64 v19; // x9
float32x4_t v20; // q1
float32x4_t *v21; // x0
float32x4_t *v22; // x1
float32x4_t v23; // q5
int v24; // w10
unsigned int v25; // w12
unsigned int v26; // w14
int v27; // w15
bool v28; // cf
int v29; // w17
__int64 v30; // x16
unsigned __int64 v31; // x15
__int64 v32; // x15
__int64 v33; // x0
__int64 v34; // x17
float32x4_t v35; // q1
unsigned __int64 v36; // x1
float32x4_t *v37; // x2
float32x4_t v38; // q5
v9 = a2 - a3;
if ( a3 )
bzero(a4, 4LL * a3);
v10 = 0;
v11 = a3 - 1LL;
v12 = 4LL * a3;
v13 = a3 & 0xFFFFFFF8;
result = 1;
do
{
v15 = v10;
v16 = result;
if ( !a3 )
goto LABEL_4;
v17 = (char *)(a1 + 4 * v10);
LODWORD(a5) = *(_DWORD *)v17;
if ( a3 < 8 )
{
v18 = 0;
goto LABEL_16;
}
v18 = 0;
if ( __CFADD__((_DWORD)v15, (_DWORD)v11) || HIDWORD(v11) )
goto LABEL_16;
if ( a1 + v12 + 4 * v15 > (unsigned __int64)a4 && v17 < (char *)a4 + v12 )
{
v18 = 0;
do
{
LABEL_16:
a4->f32[v18] = a4->f32[v18] + (float)(*(float *)&a5 * *(float *)(a1 + 4LL * (unsigned int)(v15 + v18)));
++v18;
}
while ( a3 != v18 );
goto LABEL_4;
}
v19 = 0;
v20 = (float32x4_t)vdupq_lane_s32(*(int32x2_t *)&a5, 0);
v21 = a4 + 1;
do
{
v22 = (float32x4_t *)(a1 + 4LL * (unsigned int)(v15 + v19));
v23 = vmlaq_f32(*v21, v22[1], v20);
v21[-1] = vmlaq_f32(v21[-1], *v22, v20);
*v21 = v23;
v19 += 8;
v21 += 2;
}
while ( v13 != v19 );
v18 = a3 & 0xFFFFFFF8;
if ( v13 != a3 )
goto LABEL_16;
LABEL_4:
v10 = v15 + 1;
result = v16 + 1;
}
while ( v15 < v9 );
if ( (unsigned int)v10 < a2 )
{
v24 = 0;
v25 = a3 - 1;
v26 = a3 - 1;
do
{
v27 = v26;
v28 = v26-- != 0;
if ( v26 != 0 && v28 )
v29 = v27;
else
v29 = 1;
if ( v25 - v24 <= 1 )
v30 = 1;
else
v30 = v25 - v24;
if ( v16 == a2 )
goto LABEL_20;
LODWORD(a5) = *(_DWORD *)(a1 + 4 * v16);
if ( (unsigned int)v30 >= 8 )
{
v31 = 0;
result = (unsigned int)(v24 + v10);
if ( __CFADD__((_DWORD)result, v30 - 1) || (unsigned __int64)(v30 - 1) >> 32 )
goto LABEL_30;
v32 = 4LL * (unsigned int)v30;
v33 = 4LL * (unsigned int)(v24 + v10);
if ( a1 + v32 + v33 <= (unsigned __int64)a4 || (result = a1 + v33, result >= (unsigned __int64)a4 + v32) )
{
v34 = v29 & 0xFFFFFFF8;
v31 = (unsigned int)v30 & 0xFFFFFFF8;
v35 = (float32x4_t)vdupq_lane_s32(*(int32x2_t *)&a5, 0);
result = (unsigned __int64)&a4[1];
v36 = v16;
do
{
v37 = (float32x4_t *)(a1 + 4LL * (unsigned int)v36);
v38 = vmlaq_f32(*(float32x4_t *)result, v37[1], v35);
*(float32x4_t *)(result - 16) = vmlaq_f32(*(float32x4_t *)(result - 16), *v37, v35);
*(float32x4_t *)result = v38;
v36 += 8LL;
result += 32LL;
v34 -= 8;
}
while ( v34 );
if ( v31 == v30 )
goto LABEL_20;
goto LABEL_30;
}
}
v31 = 0;
do
{
LABEL_30:
a4->f32[v31] = a4->f32[v31] + (float)(*(float *)&a5 * *(float *)(a1 + 4LL * (unsigned int)(v16 + v31)));
++v31;
}
while ( v31 < a2 - (unsigned int)v16 );
LABEL_20:
++v16;
++v24;
}
while ( v16 < a2 );
}
return result;
}