//
// sub_C964D0 from 0xc964d0 to 0xc96a74 (1444 bytes)
//
// 1 xrefs:
// > sub_C98E88 @ 0xc98eac
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
unsigned __int64 __fastcall sub_C964D0(unsigned __int64 result, _BYTE *a2, int a3)
{
unsigned int v3; // w3
int v4; // w4
unsigned int v5; // w7
unsigned int v6; // w5
int v7; // w8
int8x16_t v8; // q4
int8x16_t *v9; // x6
int8x16_t *v10; // x3
unsigned int v11; // w9
int8x16_t *v12; // x11
int8x16_t *v13; // x10
int8x16_t v14; // q16
int8x16_t v15; // q6
int v16; // w8
int v17; // w9
int v18; // w8
int v19; // w9
int v20; // w8
int v21; // w9
int v22; // w8
int v23; // w9
int v24; // w8
int v25; // w9
int v26; // w8
int v27; // w9
int v28; // w8
int v29; // w4
__int64 v30; // x4
if ( a3 > 0 )
{
if ( ((unsigned __int64)a2 >= result + 4LL * a3 || result >= (unsigned __int64)&a2[a3]) && (unsigned int)a3 > 0x11 )
{
v3 = -((result >> 2) & 3) & 3;
if ( a3 <= v3 )
v3 = a3;
if ( v3 )
{
*a2 = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)result)
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)result)
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)result
+ 1081344) >> 16;
if ( v3 == 1 )
{
v4 = 1;
}
else
{
a2[1] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4)
+ 1081344) >> 16;
if ( v3 == 3 )
{
v4 = 3;
a2[2] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 8))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 8))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 8)
+ 1081344) >> 16;
}
else
{
v4 = 2;
}
}
}
else
{
v4 = 0;
}
v5 = a3 - v3;
v6 = ((a3 - v3 - 16) >> 4) + 1;
v7 = 16 * v6;
if ( a3 - 15 == v3 )
goto LABEL_14;
v8.n128_u64[0] = 0xFF000000FFLL;
v8.n128_u64[1] = 0xFF000000FFLL;
v9 = (int8x16_t *)(result + 4LL * v3);
v10 = (int8x16_t *)&a2[v3];
v11 = 0;
do
{
v12 = v9 + 3;
++v11;
v13 = v9 + 1;
v14 = *v9;
v15 = v9[2];
v9 += 4;
*v10++ = vmovn_hight_s16(
vmovn_s16(
vmovn_hight_s32(
vmovn_s32(
vshrq_n_s32(
vaddq_s32(
vmlaq_s32(
vmlaq_s32(
vmulq_s32(vandq_s8(vshrq_n_u32(v14, 8u), v8), (int32x4_t)xmmword_C96A90),
vandq_s8(vshrq_n_u32(v14, 0x10u), v8),
(int32x4_t)xmmword_C96A80),
vandq_s8(v14, v8),
(int32x4_t)xmmword_C96AA0),
(int32x4_t)xmmword_C96AB0),
0x10u)),
vshrq_n_s32(
vaddq_s32(
vmlaq_s32(
vmlaq_s32(
vmulq_s32(vandq_s8(vshrq_n_u32(*v13, 8u), v8), (int32x4_t)xmmword_C96A90),
vandq_s8(vshrq_n_u32(*v13, 0x10u), v8),
(int32x4_t)xmmword_C96A80),
vandq_s8(*v13, v8),
(int32x4_t)xmmword_C96AA0),
(int32x4_t)xmmword_C96AB0),
0x10u))),
vmovn_hight_s32(
vmovn_s32(
vshrq_n_s32(
vaddq_s32(
vmlaq_s32(
vmlaq_s32(
vmulq_s32(vandq_s8(vshrq_n_u32(v15, 8u), v8), (int32x4_t)xmmword_C96A90),
vandq_s8(vshrq_n_u32(v15, 0x10u), v8),
(int32x4_t)xmmword_C96A80),
vandq_s8(v15, v8),
(int32x4_t)xmmword_C96AA0),
(int32x4_t)xmmword_C96AB0),
0x10u)),
vshrq_n_s32(
vaddq_s32(
vmlaq_s32(
vmlaq_s32(
vmulq_s32(vandq_s8(vshrq_n_u32(*v12, 8u), v8), (int32x4_t)xmmword_C96A90),
vandq_s8(vshrq_n_u32(*v12, 0x10u), v8),
(int32x4_t)xmmword_C96A80),
vandq_s8(*v12, v8),
(int32x4_t)xmmword_C96AA0),
(int32x4_t)xmmword_C96AB0),
0x10u)));
}
while ( v11 < v6 );
v4 += v7;
if ( v5 != v7 )
{
LABEL_14:
a2[v4] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v4))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v4))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v4)
+ 1081344) >> 16;
if ( a3 > v4 + 1 )
{
v16 = v4 + 1;
a2[v16] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v16))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v16))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v16)
+ 1081344) >> 16;
if ( a3 > v4 + 2 )
{
v17 = v4 + 2;
a2[v17] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v17))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v17))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v17)
+ 1081344) >> 16;
if ( a3 > v4 + 3 )
{
v18 = v4 + 3;
a2[v18] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v18))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v18))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v18)
+ 1081344) >> 16;
if ( a3 > v4 + 4 )
{
v19 = v4 + 4;
a2[v19] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v19))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v19))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v19)
+ 1081344) >> 16;
if ( a3 > v4 + 5 )
{
v20 = v4 + 5;
a2[v20] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v20))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v20))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v20)
+ 1081344) >> 16;
if ( a3 > v4 + 6 )
{
v21 = v4 + 6;
a2[v21] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v21))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v21))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v21)
+ 1081344) >> 16;
if ( a3 > v4 + 7 )
{
v22 = v4 + 7;
a2[v22] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v22))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v22))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v22)
+ 1081344) >> 16;
if ( a3 > v4 + 8 )
{
v23 = v4 + 8;
a2[v23] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v23))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v23))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v23)
+ 1081344) >> 16;
if ( a3 > v4 + 9 )
{
v24 = v4 + 9;
a2[v24] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v24))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v24))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v24)
+ 1081344) >> 16;
if ( a3 > v4 + 10 )
{
v25 = v4 + 10;
a2[v25] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v25))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v25))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v25)
+ 1081344) >> 16;
if ( a3 > v4 + 11 )
{
v26 = v4 + 11;
a2[v26] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v26))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v26))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v26)
+ 1081344) >> 16;
if ( a3 > v4 + 12 )
{
v28 = v4 + 13;
v27 = v4 + 12;
a2[v27] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v27))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v27))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v27)
+ 1081344) >> 16;
if ( a3 > v4 + 13 )
{
v29 = v4 + 14;
a2[v28] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v28))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v28))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4LL * v28)
+ 1081344) >> 16;
if ( a3 > v29 )
{
result = (unsigned int)((33059
* (unsigned __int8)BYTE1(*(_DWORD *)(result + 4LL * v29))
+ 16839
* (unsigned __int8)BYTE2(*(_DWORD *)(result + 4LL * v29))
+ 6420 * (unsigned __int8)*(_DWORD *)(result + 4LL * v29)
+ 1081344) >> 16);
a2[v29] = result;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
else
{
v30 = 0;
do
{
a2[v30] = (33059 * (unsigned __int8)BYTE1(*(_DWORD *)(result + 4 * v30))
+ 16839 * (unsigned __int8)BYTE2(*(_DWORD *)(result + 4 * v30))
+ 6420 * (unsigned int)(unsigned __int8)*(_DWORD *)(result + 4 * v30)
+ 1081344) >> 16;
++v30;
}
while ( a3 > (int)v30 );
}
}
return result;
}