//
// sub_719550 from 0x719550 to 0x719e26 (2262 bytes)
//
// 0 xrefs:
//
// 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
//
void *__fastcall sub_719550(
unsigned __int8 *a1,
unsigned __int8 *a2,
char *a3,
char *a4,
unsigned __int8 *a5,
unsigned __int8 *a6,
_BYTE *a7,
_BYTE *a8,
int a9)
{
unsigned __int64 v9; // d16
int16x8_t v10; // q1
int v11; // r9
int v12; // r4
int16x8_t v13; // q0
int v14; // r0
int v15; // r8
int v16; // lr
int v17; // r9
int v18; // r4
int v19; // r12
int v20; // r0
int v21; // r1
char v22; // r2
int v23; // r3
char v24; // r3
int v25; // lr
char v26; // lr
int v27; // r8
int v28; // lr
int v29; // r2
int v30; // r12
int v31; // r3
char v32; // r3
int v33; // r3
char v34; // r3
int v35; // lr
char v36; // lr
unsigned __int8 *v37; // r1
uint8x8_t *v38; // r11
unsigned __int8 *v39; // r0
_BYTE *v40; // r4
char *v41; // r2
char *v42; // r3
uint8x8_t v43; // d28
uint8x8_t v44; // d27
unsigned __int64 v45; // d17
uint8x8_t v46; // d19
int8x8x2_t v47; // q2
uint8x8_t v48; // d26
uint8x8_t v49; // d18
uint8x8_t v50; // d17
int16x4_t v51; // d6
int16x8_t v52; // q5
uint8x8_t v53; // d16
unsigned __int64 v54; // d16
uint8x8_t v55; // d17
uint8x8_t v56; // d16
uint8x8_t v57; // d24
int16x8_t v58; // q14
int16x8_t v59; // q8
int16x8_t v60; // q9
int16x8_t v61; // q12
int16x8_t v62; // q8
int16x8_t v63; // q13
int16x4_t v64; // d5
int16x8_t v65; // q12
int16x8_t v66; // q8
int16x4_t v67; // d4
int16x8_t v68; // q13
int16x8_t v69; // q12
int16x8_t v70; // q8
int16x8_t v71; // q13
char *v72; // r5
int16x8_t v73; // q8
uint8x8_t v74; // d18
void *result; // r0
int v76; // r2
bool v77; // cc
int16x8_t v78; // q8
uint8x8_t v79; // d18
__int8 *v80; // r12
uint8x8_t *v81; // r11
uint8x8_t *v82; // r6
unsigned __int8 *v83; // r7
_BYTE *v84; // r4
int v85; // r3
int v86; // t1
int v87; // r0
int v88; // t1
int v89; // r1
int v90; // t1
int v91; // r3
int v92; // r2
char v93; // r5
int v94; // r2
char v95; // r5
int v96; // r3
char v97; // r1
__int8 *v98; // r12
__int8 *v99; // lr
int v100; // r5
_BYTE *v101; // r4
unsigned __int8 *v102; // r8
int v103; // r3
int v104; // t1
int v105; // r0
int v106; // t1
int v107; // r2
int v108; // r1
int v109; // t1
int v110; // r3
int v111; // r2
char v112; // r7
int v113; // r0
char v114; // r2
int v115; // r3
char v116; // r1
_BYTE *v117; // [sp+0h] [bp-104h]
int v118; // [sp+0h] [bp-104h]
unsigned __int64 *v119; // [sp+4h] [bp-100h]
int v120; // [sp+4h] [bp-100h]
int16x4_t v121; // [sp+8h] [bp-FCh]
unsigned __int64 v122; // [sp+18h] [bp-ECh]
uint8x8_t *v123; // [sp+40h] [bp-C4h]
uint8x8_t *v124; // [sp+44h] [bp-C0h]
int v125; // [sp+48h] [bp-BCh]
unsigned __int64 v126; // [sp+50h] [bp-B4h]
unsigned __int64 v127; // [sp+58h] [bp-ACh]
unsigned __int64 v128; // [sp+60h] [bp-A4h]
int v130; // [sp+70h] [bp-94h]
size_t v131; // [sp+80h] [bp-84h]
char *v132; // [sp+84h] [bp-80h]
char *v133; // [sp+88h] [bp-7Ch]
int v134; // [sp+8Ch] [bp-78h]
int v136; // [sp+94h] [bp-70h]
_BYTE v137[9]; // [sp+98h] [bp-6Ch] BYREF
_BYTE v138[9]; // [sp+A4h] [bp-60h] BYREF
uint8x8_t v139; // [sp+B0h] [bp-54h] BYREF
uint8x8_t v140; // [sp+B8h] [bp-4Ch] BYREF
uint8x8_t v141; // [sp+C0h] [bp-44h] BYREF
uint8x8_t v142; // [sp+C8h] [bp-3Ch] BYREF
uint8x8_t v143; // [sp+D0h] [bp-34h] BYREF
uint8x8_t v144; // [sp+D8h] [bp-2Ch] BYREF
_DWORD v145[9]; // [sp+E0h] [bp-24h] BYREF
int8x8x2_t v146; // 0:^20.16
int8x8x2_t v147; // 0:d8.8,8:d9.8
int8x8x2_t v148; // 0:d16.8,8:d17.8
int8x8x2_t v149; // 0:d24.8,8:d25.8
int8x8x2_t v150; // 0:d26.8,8:d27.8
int8x8x4_t v151; // 0:d12.8,8:d13.8,16:d14.8,24:d15.8
int8x8x4_t v152; // 0:d20.8,8:d21.8,16:d22.8,24:d23.8
v10.n128_u64[0] = 0x2204220422042204LL;
v10.n128_u64[1] = 0x2204220422042204LL;
v11 = (unsigned __int8)*a4;
v12 = *a1;
v133 = a4;
v132 = a3;
v13.n128_u64[0] = 0xBAEBBAEBBAEBBAEBLL;
v13.n128_u64[1] = 0xBAEBBAEBBAEBBAEBLL;
v14 = (unsigned __int8)*a3;
v15 = ((v11 + *a6) >> 1) + 1;
v16 = (19077 * v12) >> 8;
v17 = (v11 + v15) >> 1;
v18 = (a9 + 1) >> 1;
v19 = ((*a5 + v14) >> 1) + 1;
v130 = (v18 - 1) >> 3;
v134 = 16 * v130;
v20 = (v14 + v19) >> 1;
v131 = v18 - 8 * v130;
v21 = v16 + ((26149 * v17) >> 8) - 14234;
v136 = 16 * v130 + 1;
v22 = (unsigned int)v21 >> 6;
*a7 = -1;
if ( (v21 & 0xFFFFC000) != 0 )
{
if ( v21 < 0 )
v22 = 0;
else
v22 = -1;
}
a7[1] = v22;
v23 = v16 - ((6419 * v20) >> 8) - ((13320 * v17) >> 8) + 8708;
if ( (v23 & 0xFFFFC000) != 0 )
{
if ( v23 < 0 )
v24 = 0;
else
v24 = -1;
}
else
{
v24 = (unsigned int)v23 >> 6;
}
a7[2] = v24;
v25 = v16 + ((33050 * v20) >> 8) - 17685;
if ( (v25 & 0xFFFFC000) != 0 )
{
if ( v25 < 0 )
v26 = 0;
else
v26 = -1;
}
else
{
v26 = (unsigned int)v25 >> 6;
}
a7[3] = v26;
if ( a2 )
{
v27 = (v15 + *a6) >> 1;
v28 = (19077 * *a2) >> 8;
v29 = *a5;
*a8 = -1;
v30 = (v19 + v29) >> 1;
v31 = v28 + ((26149 * v27) >> 8) - 14234;
if ( (v31 & 0xFFFFC000) != 0 )
{
if ( v31 < 0 )
v32 = 0;
else
v32 = -1;
}
else
{
v32 = (unsigned int)v31 >> 6;
}
a8[1] = v32;
v33 = v28 - ((6419 * v30) >> 8) - ((13320 * v27) >> 8) + 8708;
if ( (v33 & 0xFFFFC000) != 0 )
{
if ( v33 < 0 )
v34 = 0;
else
v34 = -1;
}
else
{
v34 = (unsigned int)v33 >> 6;
}
a8[2] = v34;
v35 = v28 + ((33050 * v30) >> 8) - 17685;
if ( (v35 & 0xFFFFC000) != 0 )
{
if ( v35 < 0 )
v36 = 0;
else
v36 = -1;
}
else
{
v36 = (unsigned int)v35 >> 6;
}
a8[3] = v36;
}
if ( v130 > 0 )
{
v37 = a5;
v38 = (uint8x8_t *)(a1 + 9);
v39 = a6;
v40 = a7;
v119 = (unsigned __int64 *)(a1 + 1);
v123 = (uint8x8_t *)(a2 + 1);
v124 = (uint8x8_t *)(a2 + 9);
v41 = v133;
v42 = v132;
v125 = 0;
v117 = a8;
v121.n64_u64[0] = v9;
do
{
v43.n64_u64[0] = *(unsigned __int64 *)(v42 + 1);
v152.val[0].n64_u64[0] = -1;
v44.n64_u64[0] = *(unsigned __int64 *)(v37 + 1);
v45 = v121.n64_u64[0];
LOWORD(v45) = 282;
v46.n64_u64[0] = *(unsigned __int64 *)(v41 + 1);
v47 = (int8x8x2_t)vaddw_u8(vaddw_u8(vaddl_u8(*(uint8x8_t *)v42, v43), *(uint8x8_t *)v37), v44);
v121.n64_u64[0] = v45;
v48.n64_u64[0] = *(unsigned __int64 *)v41;
v49.n64_u64[0] = *(unsigned __int64 *)(v39 + 1);
v50.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16((int16x8_t)v47, vshll_n_u8(v43, 1u)), vshll_n_u8(*(uint8x8_t *)v37, 1u)),
3u).n64_u64[0];
v51.n64_u64[0] = v126;
v51.n64_u16[0] = 282;
v126 = v51.n64_u64[0];
v52 = vaddw_u8(vaddw_u8(vaddl_u8(*(uint8x8_t *)v41, v46), *(uint8x8_t *)v39), v49);
v53.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16((int16x8_t)v47, vshll_n_u8(*(uint8x8_t *)v42, 1u)), vshll_n_u8(v44, 1u)),
3u).n64_u64[0];
v146.val[0] = vrhadd_u8(*(uint8x8_t *)v37, v53);
v122 = vrhadd_u8(v43, v53).n64_u64[0];
v54 = vrhadd_u8(v44, v50).n64_u64[0];
v47.val[0] = vrhadd_u8(*(uint8x8_t *)v42, v50);
v47.val[1].n64_u64[0] = v122;
v55.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16(v52, vshll_n_u8(v46, 1u)), vshll_n_u8(*(uint8x8_t *)v39, 1u)),
3u).n64_u64[0];
v146.val[1].n64_u64[0] = v54;
v147.val[1] = vrhadd_u8(v49, v55);
v56.n64_u64[0] = *v119;
v57.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16(v52, vshll_n_u8(*(uint8x8_t *)v41, 1u)), vshll_n_u8(v49, 1u)),
3u).n64_u64[0];
v147.val[0] = vrhadd_u8(*(uint8x8_t *)v39, v57);
vst2_s8((char *)&v139, v47);
vst2_s8((char *)&v143, v146);
v58 = vqdmulhq_lane_s16(vshll_n_u8(v56, 7u), (int16x4_t)0x3408191366254A85LL, 0);
v148.val[0] = vrhadd_u8(v48, v55);
v148.val[1] = vrhadd_u8(v46, v57);
vst2_s8((char *)&v141, v148);
vst2_s8((char *)v145, v147);
v59 = vshll_n_u8(v141, 7u);
v60 = vshll_n_u8(v139, 7u);
v152.val[1] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v59, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v58, vdupq_n_s16(0xC866u))),
6u);
v152.val[2] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v58, v10),
vqaddq_s16(
vqdmulhq_lane_s16(v60, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v59, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v152.val[3] = vqshrun_n_s16(
vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v60, v121, 0), vqaddq_s16(v58, v13)), v60),
6u);
vst4_s8(v40 + 4, v152);
v61 = vshll_n_u8(v142, 7u);
v62 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v38->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0);
v63 = vshll_n_u8(v140, 7u);
v152.val[1] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v61, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v62, vdupq_n_s16(0xC866u))),
6u);
v152.val[2] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v62, v10),
vqaddq_s16(
vqdmulhq_lane_s16(v63, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v61, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v152.val[3] = vqshrun_n_s16(vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v63, v51, 0), vqaddq_s16(v62, v13)), v63), 6u);
vst4_s8(v40 + 36, v152);
if ( a2 )
{
v151.val[0].n64_u64[0] = -1;
v64.n64_u64[0] = v127;
v65 = vshll_n_u8(*(uint8x8_t *)v145, 7u);
v64.n64_u16[0] = 282;
v66 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v123->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0);
v67.n64_u64[0] = v128;
v68 = vshll_n_u8(v143, 7u);
v67.n64_u16[0] = 282;
v127 = v64.n64_u64[0];
v128 = v67.n64_u64[0];
v151.val[1] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v65, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v66, vdupq_n_s16(0xC866u))),
6u);
v151.val[2] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v66, v10),
vqaddq_s16(
vqdmulhq_lane_s16(v68, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v65, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v151.val[3] = vqshrun_n_s16(
vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v68, v64, 0), vqaddq_s16(v66, v13)), v68),
6u);
vst4_s8(v117 + 4, v151);
v69 = vshll_n_u8(*(uint8x8_t *)&v145[2], 7u);
v70 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v124->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0);
v71 = vshll_n_u8(v144, 7u);
v151.val[1] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v69, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v70, vdupq_n_s16(0xC866u))),
6u);
v151.val[2] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v70, v10),
vqaddq_s16(
vqdmulhq_lane_s16(v71, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v69, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v151.val[3] = vqshrun_n_s16(
vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v71, v67, 0), vqaddq_s16(v70, v13)), v71),
6u);
vst4_s8(v117 + 36, v151);
}
v42 += 8;
v37 += 8;
v119 += 2;
v41 += 8;
++v125;
v123 += 2;
v39 += 8;
v40 += 64;
v38 += 2;
v117 += 64;
v124 += 2;
}
while ( v125 != v130 );
v132 += 8 * v125;
a5 += 8 * v125;
v133 += 8 * v125;
a6 += 8 * v125;
}
memcpy(v137, v132, v131);
memcpy(v138, a5, v131);
v72 = (char *)&v145[7] + v131 + 3;
memset(&v137[v131], (unsigned __int8)*(v72 - 104), 9 - v131);
memset(&v138[v131], (unsigned __int8)*(v72 - 92), 9 - v131);
v73 = vaddw_u8(
vaddw_u8(vaddl_u8(*(uint8x8_t *)v137, *(uint8x8_t *)&v137[1]), *(uint8x8_t *)v138),
*(uint8x8_t *)&v138[1]);
v74.n64_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v73, vshll_n_u8(*(uint8x8_t *)&v137[1], 1u)),
vshll_n_u8(*(uint8x8_t *)v138, 1u)),
3u).n64_u64[0];
v73.n128_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v73, vshll_n_u8(*(uint8x8_t *)v137, 1u)),
vshll_n_u8(*(uint8x8_t *)&v138[1], 1u)),
3u).n64_u64[0];
v150.val[0] = vrhadd_u8(*(uint8x8_t *)v137, v74);
v149.val[0] = vrhadd_u8(*(uint8x8_t *)v138, (uint8x8_t)v73.n128_u64[0]);
v150.val[1] = vrhadd_u8(*(uint8x8_t *)&v137[1], (uint8x8_t)v73.n128_u64[0]);
v149.val[1] = vrhadd_u8(*(uint8x8_t *)&v138[1], v74);
vst2_s8((char *)&v139, v150);
vst2_s8((char *)&v143, v149);
memcpy(v137, v133, v131);
memcpy(v138, a6, v131);
memset(&v137[v131], (unsigned __int8)*(v72 - 104), 9 - v131);
result = memset(&v138[v131], (unsigned __int8)*(v72 - 92), 9 - v131);
v76 = a9 - v136;
v77 = a9 - v136 <= 0;
v118 = a9 - v136;
v78 = vaddw_u8(
vaddw_u8(vaddl_u8(*(uint8x8_t *)v137, *(uint8x8_t *)&v137[1]), *(uint8x8_t *)v138),
*(uint8x8_t *)&v138[1]);
v79.n64_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v78, vshll_n_u8(*(uint8x8_t *)&v137[1], 1u)),
vshll_n_u8(*(uint8x8_t *)v138, 1u)),
3u).n64_u64[0];
v78.n128_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v78, vshll_n_u8(*(uint8x8_t *)v137, 1u)),
vshll_n_u8(*(uint8x8_t *)&v138[1], 1u)),
3u).n64_u64[0];
v150.val[0] = vrhadd_u8(*(uint8x8_t *)v137, v79);
v150.val[1] = vrhadd_u8(*(uint8x8_t *)&v137[1], (uint8x8_t)v78.n128_u64[0]);
v149.val[0] = vrhadd_u8(*(uint8x8_t *)v138, (uint8x8_t)v78.n128_u64[0]);
v149.val[1] = vrhadd_u8(*(uint8x8_t *)&v138[1], v79);
vst2_s8((char *)&v141, v150);
vst2_s8((char *)v145, v149);
if ( !v77 )
{
v80 = &v140.n64_i8[7];
v81 = (uint8x8_t *)((char *)&v139 + v76);
v82 = &v139;
v83 = &a1[v134];
v120 = v130 << 6;
v84 = &a7[64 * v130];
do
{
v86 = *++v83;
v85 = v86;
v88 = (unsigned __int8)*++v80;
v87 = v88;
v90 = v82->n64_u8[0];
v82 = (uint8x8_t *)((char *)v82 + 1);
v89 = v90;
v84[4] = -1;
v91 = (19077 * v85) >> 8;
v92 = v91 + ((26149 * v87) >> 8) - 14234;
if ( v92 < 0 )
v93 = 0;
else
v93 = -1;
if ( (v92 & 0xFFFFC000) == 0 )
v93 = (unsigned int)v92 >> 6;
v84[5] = v93;
v94 = v91 - ((6419 * v89) >> 8) - ((13320 * v87) >> 8) + 8708;
if ( v94 < 0 )
v95 = 0;
else
v95 = -1;
result = (void *)(v94 & 0xFFFFC000);
if ( (v94 & 0xFFFFC000) == 0 )
v95 = (unsigned int)v94 >> 6;
v84[6] = v95;
v96 = v91 + ((33050 * v89) >> 8) - 17685;
if ( v96 < 0 )
v97 = 0;
else
v97 = -1;
if ( (v96 & 0xFFFFC000) == 0 )
v97 = (unsigned int)v96 >> 6;
v84[7] = v97;
v84 += 4;
}
while ( v82 != v81 );
if ( a2 )
{
v98 = &v142.n64_i8[7];
v99 = &v144.n64_i8[7];
v100 = 0;
v101 = &a8[v120];
v102 = &a2[v134];
do
{
v104 = *++v102;
v103 = v104;
v106 = (unsigned __int8)*++v99;
v105 = v106;
++v100;
a8[4 * v100 + v120] = -1;
v107 = 26149 * v106;
v109 = (unsigned __int8)*++v98;
v108 = v109;
v110 = (19077 * v103) >> 8;
v111 = v110 + (v107 >> 8) - 14234;
if ( v111 < 0 )
v112 = 0;
else
v112 = -1;
if ( (v111 & 0xFFFFC000) == 0 )
v112 = (unsigned int)v111 >> 6;
v101[5] = v112;
v113 = v110 - ((6419 * v108) >> 8) - ((13320 * v105) >> 8) + 8708;
if ( v113 < 0 )
v114 = 0;
else
v114 = -1;
if ( (v113 & 0xFFFFC000) == 0 )
v114 = (unsigned int)v113 >> 6;
result = &stru_810C + 14;
v101[6] = v114;
v115 = v110 + ((33050 * v108) >> 8) - 17685;
if ( v115 < 0 )
v116 = 0;
else
v116 = -1;
if ( (v115 & 0xFFFFC000) == 0 )
v116 = (unsigned int)v115 >> 6;
v101 += 4;
v101[3] = v116;
}
while ( v118 > v100 );
}
}
return result;
}