//
// sub_9265B8 from 0x9265b8 to 0x926e78 (2240 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:04:44 +0000
//
void *__fastcall sub_9265B8(
unsigned __int8 *a1,
unsigned __int8 *a2,
char *a3,
char *a4,
unsigned __int8 *a5,
unsigned __int8 *a6,
char *a7,
char *a8,
int a9)
{
int16x4_t v9; // d6
unsigned __int64 v10; // d31
int16x8_t v11; // q0
int v12; // r9
int v13; // r4
int v14; // r0
int v15; // r8
int v16; // r9
int v17; // lr
int v18; // r2
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; // lr
int v28; // r8
int v29; // r12
int v30; // r2
char v31; // r2
int v32; // r3
char v33; // r3
int v34; // r12
char v35; // r12
unsigned __int8 *v36; // r1
int16x4_t v37; // d13
uint8x8_t *v38; // r11
unsigned __int8 *v39; // r0
char *v40; // r4
char *v41; // r2
char *v42; // r3
uint8x8_t v43; // d27
uint8x8_t v44; // d26
uint8x8_t v45; // d20
int8x8x2_t v46; // q2
uint8x8_t v47; // d17
uint8x8_t v48; // d19
int16x8_t v49; // q1
uint8x8_t v50; // d16
unsigned __int64 v51; // d16
uint8x8_t v52; // d17
uint8x8_t v53; // d18
uint8x8_t v54; // d16
int16x8_t v55; // q13
int16x8_t v56; // q9
int16x8_t v57; // q14
int16x8_t v58; // q10
int16x8_t v59; // q8
int16x8_t v60; // q13
int16x4_t v61; // d25
int16x4_t v62; // d4
int16x8_t v63; // q13
int16x8_t v64; // q8
int16x8_t v65; // q10
int16x8_t v66; // q13
int16x8_t v67; // q8
int16x8_t v68; // q10
char *v69; // r5
int16x8_t v70; // q8
uint8x8_t v71; // d18
void *result; // r0
int v73; // r2
bool v74; // cc
int16x8_t v75; // q8
uint8x8_t v76; // d18
__int8 *v77; // r12
uint8x8_t *v78; // r11
uint8x8_t *v79; // r6
unsigned __int8 *v80; // r7
char *v81; // r4
int v82; // r3
int v83; // t1
int v84; // r0
int v85; // t1
int v86; // r1
int v87; // t1
int v88; // r3
int v89; // r2
char v90; // r5
int v91; // r2
char v92; // r5
int v93; // r3
char v94; // r1
__int8 *v95; // r8
__int8 *v96; // r12
int v97; // r7
unsigned __int8 *v98; // r9
char *v99; // r6
char *v100; // r4
int v101; // r3
int v102; // t1
int v103; // r0
int v104; // t1
int v105; // r1
int v106; // t1
int v107; // r3
int v108; // r2
char v109; // lr
int v110; // r0
char v111; // r2
int v112; // r3
char v113; // r1
char *v114; // [sp+0h] [bp-E4h]
int v115; // [sp+0h] [bp-E4h]
unsigned __int64 *v116; // [sp+4h] [bp-E0h]
unsigned __int64 v117; // [sp+10h] [bp-D4h]
uint8x8_t *v118; // [sp+28h] [bp-BCh]
uint8x8_t *v119; // [sp+2Ch] [bp-B8h]
int v120; // [sp+30h] [bp-B4h]
unsigned __int64 v121; // [sp+38h] [bp-ACh]
unsigned __int64 v122; // [sp+40h] [bp-A4h]
int v124; // [sp+50h] [bp-94h]
size_t v125; // [sp+60h] [bp-84h]
char *v126; // [sp+64h] [bp-80h]
char *v127; // [sp+68h] [bp-7Ch]
int v128; // [sp+6Ch] [bp-78h]
int v130; // [sp+74h] [bp-70h]
_BYTE v131[9]; // [sp+78h] [bp-6Ch] BYREF
_BYTE v132[9]; // [sp+84h] [bp-60h] BYREF
uint8x8_t v133; // [sp+90h] [bp-54h] BYREF
uint8x8_t v134; // [sp+98h] [bp-4Ch] BYREF
uint8x8_t v135; // [sp+A0h] [bp-44h] BYREF
uint8x8_t v136; // [sp+A8h] [bp-3Ch] BYREF
uint8x8_t v137; // [sp+B0h] [bp-34h] BYREF
uint8x8_t v138; // [sp+B8h] [bp-2Ch] BYREF
_DWORD v139[9]; // [sp+C0h] [bp-24h] BYREF
int8x8x2_t v140; // 0:^18.16
int8x8x2_t v141; // 0:d8.8,8:d9.8
int8x8x2_t v142; // 0:d24.8,8:d25.8
int8x8x2_t v143; // 0:d26.8,8:d27.8
int8x8x2_t v144; // 0:d30.8,8:d31.8
int8x8x3_t v145; // 0:d10.8,8:d11.8,16:d12.8
int8x8x3_t v146; // 0:d22.8,8:d23.8,16:d24.8
v11.n128_u64[0] = 0xBAEBBAEBBAEBBAEBLL;
v11.n128_u64[1] = 0xBAEBBAEBBAEBBAEBLL;
v12 = (unsigned __int8)*a4;
v13 = *a1;
v127 = a4;
v126 = a3;
v14 = (unsigned __int8)*a3;
v15 = ((v12 + *a6) >> 1) + 1;
v16 = (v12 + v15) >> 1;
v17 = (19077 * v13) >> 8;
v18 = (a9 + 1) >> 1;
v19 = ((*a5 + v14) >> 1) + 1;
v124 = (v18 - 1) >> 3;
v128 = 16 * v124;
v20 = (v14 + v19) >> 1;
v21 = v17 + ((26149 * v16) >> 8) - 14234;
v130 = 16 * v124 + 1;
v125 = v18 - 8 * v124;
v22 = (unsigned int)v21 >> 6;
if ( (v21 & 0xFFFFC000) != 0 )
{
if ( v21 < 0 )
v22 = 0;
else
v22 = -1;
}
*a7 = v22;
v23 = v17 - ((6419 * v20) >> 8) - ((13320 * v16) >> 8) + 8708;
if ( (v23 & 0xFFFFC000) != 0 )
{
if ( v23 < 0 )
v24 = 0;
else
v24 = -1;
}
else
{
v24 = (unsigned int)v23 >> 6;
}
a7[1] = v24;
v25 = v17 + ((33050 * v20) >> 8) - 17685;
if ( (v25 & 0xFFFFC000) != 0 )
{
if ( v25 < 0 )
v26 = 0;
else
v26 = -1;
}
else
{
v26 = (unsigned int)v25 >> 6;
}
a7[2] = v26;
if ( a2 )
{
v27 = (*a6 + v15) >> 1;
v28 = (*a5 + v19) >> 1;
v29 = (19077 * *a2) >> 8;
v30 = v29 + ((26149 * v27) >> 8) - 14234;
if ( (v30 & 0xFFFFC000) != 0 )
{
if ( v30 < 0 )
v31 = 0;
else
v31 = -1;
}
else
{
v31 = (unsigned int)v30 >> 6;
}
*a8 = v31;
v32 = v29 - ((6419 * v28) >> 8) - ((13320 * v27) >> 8) + 8708;
if ( (v32 & 0xFFFFC000) != 0 )
{
if ( v32 < 0 )
v33 = 0;
else
v33 = -1;
}
else
{
v33 = (unsigned int)v32 >> 6;
}
a8[1] = v33;
v34 = v29 + ((33050 * v28) >> 8) - 17685;
if ( (v34 & 0xFFFFC000) != 0 )
{
if ( v34 < 0 )
v35 = 0;
else
v35 = -1;
}
else
{
v35 = (unsigned int)v34 >> 6;
}
a8[2] = v35;
}
if ( v124 > 0 )
{
v36 = a5;
v37.n64_u64[0] = v10;
v38 = (uint8x8_t *)(a1 + 9);
v39 = a6;
v40 = a7;
v116 = (unsigned __int64 *)(a1 + 1);
v118 = (uint8x8_t *)(a2 + 1);
v119 = (uint8x8_t *)(a2 + 9);
v41 = v127;
v42 = v126;
v120 = 0;
v114 = a8;
do
{
v43.n64_u64[0] = *(unsigned __int64 *)(v42 + 1);
v44.n64_u64[0] = *(unsigned __int64 *)(v36 + 1);
v45.n64_u64[0] = *(unsigned __int64 *)(v41 + 1);
v46 = (int8x8x2_t)vaddw_u8(vaddw_u8(vaddl_u8(*(uint8x8_t *)v42, v43), *(uint8x8_t *)v36), v44);
v9.n64_u16[0] = 282;
v37.n64_u16[0] = 282;
v47.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16((int16x8_t)v46, vshll_n_u8(v43, 1u)), vshll_n_u8(*(uint8x8_t *)v36, 1u)),
3u).n64_u64[0];
v48.n64_u64[0] = *(unsigned __int64 *)(v39 + 1);
v49 = vaddw_u8(vaddw_u8(vaddl_u8(*(uint8x8_t *)v41, v45), *(uint8x8_t *)v39), v48);
v50.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16((int16x8_t)v46, vshll_n_u8(*(uint8x8_t *)v42, 1u)), vshll_n_u8(v44, 1u)),
3u).n64_u64[0];
v140.val[0] = vrhadd_u8(*(uint8x8_t *)v36, v50);
v117 = vrhadd_u8(v43, v50).n64_u64[0];
v51 = vrhadd_u8(v44, v47).n64_u64[0];
v46.val[0] = vrhadd_u8(*(uint8x8_t *)v42, v47);
v46.val[1].n64_u64[0] = v117;
v52.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16(v49, vshll_n_u8(v45, 1u)), vshll_n_u8(*(uint8x8_t *)v39, 1u)),
3u).n64_u64[0];
v140.val[1].n64_u64[0] = v51;
v53.n64_u64[0] = vshrn_n_s16(
vaddq_s16(vaddq_s16(v49, vshll_n_u8(*(uint8x8_t *)v41, 1u)), vshll_n_u8(v48, 1u)),
3u).n64_u64[0];
v54.n64_u64[0] = *v116;
v144.val[0] = vrhadd_u8(*(uint8x8_t *)v41, v52);
v141.val[0] = vrhadd_u8(*(uint8x8_t *)v39, v53);
v144.val[1] = vrhadd_u8(v45, v53);
v141.val[1] = vrhadd_u8(v48, v52);
vst2_s8((char *)&v133, v46);
vst2_s8((char *)&v137, v140);
vst2_s8((char *)&v135, v144);
v55 = vqdmulhq_lane_s16(vshll_n_u8(v54, 7u), (int16x4_t)0x3408191366254A85LL, 0);
vst2_s8((char *)v139, v141);
v56 = vshll_n_u8(v135, 7u);
v57 = vshll_n_u8(v133, 7u);
v146.val[0] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v56, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v55, vdupq_n_s16(0xC866u))),
6u);
v146.val[1] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v55, vdupq_n_s16(0x2204u)),
vqaddq_s16(
vqdmulhq_lane_s16(v57, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v56, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v146.val[2] = vqshrun_n_s16(vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v57, v9, 0), vqaddq_s16(v55, v11)), v57), 6u);
vst3_s8(v40 + 3, v146);
v58 = vshll_n_u8(v136, 7u);
v59 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v38->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0);
v60 = vshll_n_u8(v134, 7u);
v146.val[0] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v58, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v59, vdupq_n_s16(0xC866u))),
6u);
v146.val[1] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v59, vdupq_n_s16(0x2204u)),
vqaddq_s16(
vqdmulhq_lane_s16(v60, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v58, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v146.val[2] = vqshrun_n_s16(vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v60, v37, 0), vqaddq_s16(v59, v11)), v60), 6u);
vst3_s8(v40 + 27, v146);
if ( a2 )
{
v61.n64_u64[0] = v121;
v61.n64_u16[0] = 282;
v62.n64_u64[0] = v122;
v63 = vshll_n_u8(*(uint8x8_t *)v139, 7u);
v62.n64_u16[0] = 282;
v64 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v118->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0);
v121 = v61.n64_u64[0];
v65 = vshll_n_u8(v137, 7u);
v122 = v62.n64_u64[0];
v145.val[0] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v63, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v64, vdupq_n_s16(0xC866u))),
6u);
v145.val[1] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v64, vdupq_n_s16(0x2204u)),
vqaddq_s16(
vqdmulhq_lane_s16(v65, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v63, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v145.val[2] = vqshrun_n_s16(
vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v65, v61, 0), vqaddq_s16(v64, v11)), v65),
6u);
vst3_s8(v114 + 3, v145);
v66 = vshll_n_u8(*(uint8x8_t *)&v139[2], 7u);
v67 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v119->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0);
v68 = vshll_n_u8(v138, 7u);
v145.val[0] = vqshrun_n_s16(
vqaddq_s16(
vqdmulhq_lane_s16(v66, (int16x4_t)0x3408191366254A85LL, 1),
vqaddq_s16(v67, vdupq_n_s16(0xC866u))),
6u);
v145.val[1] = vqshrun_n_s16(
vqsubq_s16(
vqaddq_s16(v67, vdupq_n_s16(0x2204u)),
vqaddq_s16(
vqdmulhq_lane_s16(v68, (int16x4_t)0x3408191366254A85LL, 2),
vqdmulhq_lane_s16(v66, (int16x4_t)0x3408191366254A85LL, 3))),
6u);
v145.val[2] = vqshrun_n_s16(
vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v68, v62, 0), vqaddq_s16(v67, v11)), v68),
6u);
vst3_s8(v114 + 27, v145);
}
v42 += 8;
v36 += 8;
v116 += 2;
v41 += 8;
++v120;
v118 += 2;
v39 += 8;
v40 += 48;
v38 += 2;
v114 += 48;
v119 += 2;
}
while ( v120 != v124 );
v126 += 8 * v120;
a5 += 8 * v120;
v127 += 8 * v120;
a6 += 8 * v120;
}
memcpy(v131, v126, v125);
memcpy(v132, a5, v125);
v69 = (char *)&v139[7] + v125 + 3;
memset(&v131[v125], (unsigned __int8)*(v69 - 104), 9 - v125);
memset(&v132[v125], (unsigned __int8)*(v69 - 92), 9 - v125);
v70 = vaddw_u8(
vaddw_u8(vaddl_u8(*(uint8x8_t *)v131, *(uint8x8_t *)&v131[1]), *(uint8x8_t *)v132),
*(uint8x8_t *)&v132[1]);
v71.n64_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v70, vshll_n_u8(*(uint8x8_t *)&v131[1], 1u)),
vshll_n_u8(*(uint8x8_t *)v132, 1u)),
3u).n64_u64[0];
v70.n128_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v70, vshll_n_u8(*(uint8x8_t *)v131, 1u)),
vshll_n_u8(*(uint8x8_t *)&v132[1], 1u)),
3u).n64_u64[0];
v143.val[0] = vrhadd_u8(*(uint8x8_t *)v131, v71);
v142.val[0] = vrhadd_u8(*(uint8x8_t *)v132, (uint8x8_t)v70.n128_u64[0]);
v143.val[1] = vrhadd_u8(*(uint8x8_t *)&v131[1], (uint8x8_t)v70.n128_u64[0]);
v142.val[1] = vrhadd_u8(*(uint8x8_t *)&v132[1], v71);
vst2_s8((char *)&v133, v143);
vst2_s8((char *)&v137, v142);
memcpy(v131, v127, v125);
memcpy(v132, a6, v125);
memset(&v131[v125], (unsigned __int8)*(v69 - 104), 9 - v125);
result = memset(&v132[v125], (unsigned __int8)*(v69 - 92), 9 - v125);
v73 = a9 - v130;
v74 = a9 - v130 <= 0;
v115 = a9 - v130;
v75 = vaddw_u8(
vaddw_u8(vaddl_u8(*(uint8x8_t *)v131, *(uint8x8_t *)&v131[1]), *(uint8x8_t *)v132),
*(uint8x8_t *)&v132[1]);
v76.n64_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v75, vshll_n_u8(*(uint8x8_t *)&v131[1], 1u)),
vshll_n_u8(*(uint8x8_t *)v132, 1u)),
3u).n64_u64[0];
v75.n128_u64[0] = vshrn_n_s16(
vaddq_s16(
vaddq_s16(v75, vshll_n_u8(*(uint8x8_t *)v131, 1u)),
vshll_n_u8(*(uint8x8_t *)&v132[1], 1u)),
3u).n64_u64[0];
v143.val[0] = vrhadd_u8(*(uint8x8_t *)v131, v76);
v143.val[1] = vrhadd_u8(*(uint8x8_t *)&v131[1], (uint8x8_t)v75.n128_u64[0]);
v142.val[0] = vrhadd_u8(*(uint8x8_t *)v132, (uint8x8_t)v75.n128_u64[0]);
v142.val[1] = vrhadd_u8(*(uint8x8_t *)&v132[1], v76);
vst2_s8((char *)&v135, v143);
vst2_s8((char *)v139, v142);
if ( !v74 )
{
v77 = &v134.n64_i8[7];
v78 = (uint8x8_t *)((char *)&v133 + v73);
v79 = &v133;
v80 = &a1[v128];
v81 = &a7[48 * v124];
do
{
v83 = *++v80;
v82 = v83;
v85 = (unsigned __int8)*++v77;
v84 = v85;
v87 = v79->n64_u8[0];
v79 = (uint8x8_t *)((char *)v79 + 1);
v86 = v87;
v88 = (19077 * v82) >> 8;
v89 = v88 + ((26149 * v84) >> 8) - 14234;
if ( v89 < 0 )
v90 = 0;
else
v90 = -1;
if ( (v89 & 0xFFFFC000) == 0 )
v90 = (unsigned int)v89 >> 6;
v81[3] = v90;
v91 = v88 - ((6419 * v86) >> 8) - ((13320 * v84) >> 8) + 8708;
if ( v91 < 0 )
v92 = 0;
else
v92 = -1;
result = (void *)(v91 & 0xFFFFC000);
if ( (v91 & 0xFFFFC000) == 0 )
v92 = (unsigned int)v91 >> 6;
v81[4] = v92;
v93 = v88 + ((33050 * v86) >> 8) - 17685;
if ( v93 < 0 )
v94 = 0;
else
v94 = -1;
if ( (v93 & 0xFFFFC000) == 0 )
v94 = (unsigned int)v93 >> 6;
v81[5] = v94;
v81 += 3;
}
while ( v79 != v78 );
if ( a2 )
{
v95 = &v136.n64_i8[7];
v96 = &v138.n64_i8[7];
v97 = 0;
v98 = &a2[v128];
v99 = &a8[48 * v124];
v100 = v99;
do
{
v102 = *++v98;
v101 = v102;
v104 = (unsigned __int8)*++v96;
v103 = v104;
v106 = (unsigned __int8)*++v95;
v105 = v106;
v107 = (19077 * v101) >> 8;
v108 = v107 + ((26149 * v103) >> 8) - 14234;
if ( v108 < 0 )
v109 = 0;
else
v109 = -1;
if ( (v108 & 0xFFFFC000) == 0 )
v109 = (unsigned int)v108 >> 6;
v99[3] = v109;
v110 = v107 - ((6419 * v105) >> 8) - ((13320 * v103) >> 8) + 8708;
if ( v110 < 0 )
v111 = 0;
else
v111 = -1;
if ( (v110 & 0xFFFFC000) == 0 )
v111 = (unsigned int)v110 >> 6;
result = &stru_810C + 14;
v100[4] = v111;
v112 = v107 + ((33050 * v105) >> 8) - 17685;
if ( v112 < 0 )
v113 = 0;
else
v113 = -1;
if ( (v112 & 0xFFFFC000) == 0 )
v113 = (unsigned int)v112 >> 6;
++v97;
v100[5] = v113;
v99 += 3;
v100 += 3;
}
while ( v115 > v97 );
}
}
return result;
}