// // sub_7172B8 from 0x7172b8 to 0x717b70 (2232 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 // int __fastcall sub_7172B8( 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; // lr 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; // r1 int v23; // r3 char v24; // r3 int v25; // lr char v26; // lr int v27; // r8 int v28; // lr int v29; // r12 int v30; // r2 char v31; // r2 int v32; // r3 char v33; // r3 int v34; // lr char v35; // lr 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 uint8x8_t v46; // d25 int8x8x2_t v47; // q2 uint8x8_t v48; // d19 uint8x8_t v49; // d17 int16x8_t v50; // q1 uint8x8_t v51; // d16 uint8x8_t v52; // d17 uint8x8_t v53; // d16 uint8x8_t v54; // d18 int16x8_t v55; // q13 int16x8_t v56; // q9 int16x8_t v57; // q8 int16x8_t v58; // q9 int16x8_t v59; // q10 int16x8_t v60; // q8 int16x4_t v61; // d5 int16x8_t v62; // q9 int16x8_t v63; // q13 int16x8_t v64; // q10 int16x4_t v65; // d5 int16x8_t v66; // q8 int16x8_t v67; // q9 int16x8_t v68; // q10 int16x8_t v69; // q8 char *v70; // r5 int16x8_t v71; // q8 uint8x8_t v72; // d18 int result; // r0 int v74; // r2 bool v75; // cc int16x8_t v76; // q8 uint8x8_t v77; // d18 __int8 *v78; // r12 uint8x8_t *v79; // r11 uint8x8_t *v80; // r6 unsigned __int8 *v81; // r7 char *v82; // r4 int v83; // r3 int v84; // t1 int v85; // r2 int v86; // t1 int v87; // r0 int v88; // t1 int v89; // r3 int v90; // r1 char v91; // r5 int v92; // r2 char v93; // r5 int v94; // r3 char v95; // r1 __int8 *v96; // r8 __int8 *v97; // r12 int v98; // r7 unsigned __int8 *v99; // r9 char *v100; // r6 char *v101; // r4 int v102; // r3 int v103; // t1 int v104; // r2 int v105; // t1 int v106; // r0 int v107; // t1 int v108; // r3 int v109; // r1 char v110; // lr int v111; // r2 char v112; // r1 int v113; // r3 char v114; // r1 char *v115; // [sp+0h] [bp-E4h] int v116; // [sp+0h] [bp-E4h] unsigned __int64 *v117; // [sp+4h] [bp-E0h] 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)*a3; v126 = a3; v127 = a4; v13 = 19077 * *a1; v14 = (unsigned __int8)*a4; v15 = ((v12 + *a5) >> 1) + 1; v16 = (v12 + v15) >> 1; v17 = v13 >> 8; v18 = (a9 + 1) >> 1; v19 = ((*a6 + v14) >> 1) + 1; v124 = (v18 - 1) >> 3; v128 = 16 * v124; v20 = (v14 + v19) >> 1; v21 = v17 + ((33050 * v16) >> 8) - 17685; v130 = 16 * v124 + 1; v125 = v18 - 8 * v124; if ( (v21 & 0xFFFFC000) != 0 ) { if ( v21 < 0 ) v22 = 0; else v22 = -1; } else { v22 = (unsigned int)v21 >> 6; } *a7 = v22; v23 = v17 - ((6419 * v16) >> 8) - ((13320 * v20) >> 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 + ((26149 * v20) >> 8) - 14234; if ( (v25 & 0xFFFFC000) != 0 ) { if ( v25 < 0 ) v26 = 0; else v26 = -1; } else { v26 = (unsigned int)v25 >> 6; } a7[2] = v26; if ( a2 ) { v27 = (v15 + *a5) >> 1; v28 = (19077 * *a2) >> 8; v29 = (v19 + *a6) >> 1; v30 = v28 + ((33050 * v27) >> 8) - 17685; if ( (v30 & 0xFFFFC000) != 0 ) { if ( v30 < 0 ) v31 = 0; else v31 = -1; } else { v31 = (unsigned int)v30 >> 6; } *a8 = v31; v32 = v28 - ((6419 * v27) >> 8) - ((13320 * v29) >> 8) + 8708; if ( (v32 & 0xFFFFC000) != 0 ) { if ( v32 < 0 ) v33 = 0; else v33 = -1; } else { v33 = (unsigned int)v32 >> 6; } a8[1] = v33; v34 = v28 + ((26149 * v29) >> 8) - 14234; 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; v117 = (unsigned __int64 *)(a1 + 1); v118 = (uint8x8_t *)(a2 + 1); v119 = (uint8x8_t *)(a2 + 9); v41 = v127; v42 = v126; v120 = 0; v115 = 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.n64_u64[0] = *(unsigned __int64 *)v41; v47 = (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; v48.n64_u64[0] = *(unsigned __int64 *)(v39 + 1); v49.n64_u64[0] = vshrn_n_s16( vaddq_s16(vaddq_s16((int16x8_t)v47, vshll_n_u8(v43, 1u)), vshll_n_u8(*(uint8x8_t *)v36, 1u)), 3u).n64_u64[0]; v50 = vaddw_u8(vaddw_u8(vaddl_u8(*(uint8x8_t *)v41, v45), *(uint8x8_t *)v39), v48); v51.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]; v140.val[0] = vrhadd_u8(*(uint8x8_t *)v36, v51); v47.val[0] = vrhadd_u8(*(uint8x8_t *)v42, v49); v47.val[1] = vrhadd_u8(v43, v51); v140.val[1] = vrhadd_u8(v44, v49); v52.n64_u64[0] = vshrn_n_s16( vaddq_s16(vaddq_s16(v50, vshll_n_u8(v45, 1u)), vshll_n_u8(*(uint8x8_t *)v39, 1u)), 3u).n64_u64[0]; v53.n64_u64[0] = *v117; v54.n64_u64[0] = vshrn_n_s16( vaddq_s16(vaddq_s16(v50, vshll_n_u8(*(uint8x8_t *)v41, 1u)), vshll_n_u8(v48, 1u)), 3u).n64_u64[0]; v141.val[1] = vrhadd_u8(v48, v52); v141.val[0] = vrhadd_u8(*(uint8x8_t *)v39, v54); v144.val[1] = vrhadd_u8(v45, v54); vst2_s8((char *)&v133, v47); v144.val[0] = vrhadd_u8(v46, v52); vst2_s8((char *)&v137, v140); vst2_s8((char *)&v135, v144); v55 = vqdmulhq_lane_s16(vshll_n_u8(v53, 7u), (int16x4_t)0x3408191366254A85LL, 0); vst2_s8((char *)v139, v141); v56 = vshll_n_u8(v133, 7u); v57 = vshll_n_u8(v135, 7u); v146.val[0] = vqshrun_n_s16(vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v56, v9, 0), vqaddq_s16(v55, v11)), v56), 6u); v146.val[2] = vqshrun_n_s16( vqaddq_s16( vqdmulhq_lane_s16(v57, (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(v56, (int16x4_t)0x3408191366254A85LL, 2), vqdmulhq_lane_s16(v57, (int16x4_t)0x3408191366254A85LL, 3))), 6u); vst3_s8(v40 + 3, v146); v58 = vshll_n_u8(v134, 7u); v59 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v38->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0); v60 = vshll_n_u8(v136, 7u); v146.val[0] = vqshrun_n_s16(vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v58, v37, 0), vqaddq_s16(v59, v11)), v58), 6u); v146.val[1] = vqshrun_n_s16( vqsubq_s16( vqaddq_s16(v59, vdupq_n_s16(0x2204u)), vqaddq_s16( vqdmulhq_lane_s16(v58, (int16x4_t)0x3408191366254A85LL, 2), vqdmulhq_lane_s16(v60, (int16x4_t)0x3408191366254A85LL, 3))), 6u); v146.val[2] = vqshrun_n_s16( vqaddq_s16( vqdmulhq_lane_s16(v60, (int16x4_t)0x3408191366254A85LL, 1), vqaddq_s16(v59, vdupq_n_s16(0xC866u))), 6u); vst3_s8(v40 + 27, v146); if ( a2 ) { v61.n64_u64[0] = v121; v61.n64_u16[0] = 282; v62 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v118->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0); v121 = v61.n64_u64[0]; v63 = vshll_n_u8(v137, 7u); v64 = vqdmulhq_lane_s16(v63, v61, 0); v65.n64_u64[0] = v122; v65.n64_u16[0] = 282; v66 = vshll_n_u8(*(uint8x8_t *)v139, 7u); v122 = v65.n64_u64[0]; v145.val[0] = vqshrun_n_s16(vqaddq_s16(vqaddq_s16(v64, vqaddq_s16(v62, v11)), v63), 6u); v145.val[2] = vqshrun_n_s16( vqaddq_s16( vqdmulhq_lane_s16(v66, (int16x4_t)0x3408191366254A85LL, 1), vqaddq_s16(v62, vdupq_n_s16(0xC866u))), 6u); v145.val[1] = vqshrun_n_s16( vqsubq_s16( vqaddq_s16(v62, vdupq_n_s16(0x2204u)), vqaddq_s16( vqdmulhq_lane_s16(v63, (int16x4_t)0x3408191366254A85LL, 2), vqdmulhq_lane_s16(v66, (int16x4_t)0x3408191366254A85LL, 3))), 6u); vst3_s8(v115 + 3, v145); v67 = vshll_n_u8(v138, 7u); v68 = vqdmulhq_lane_s16(vshll_n_u8((uint8x8_t)v119->n64_u64[0], 7u), (int16x4_t)0x3408191366254A85LL, 0); v69 = vshll_n_u8(*(uint8x8_t *)&v139[2], 7u); v145.val[0] = vqshrun_n_s16( vqaddq_s16(vqaddq_s16(vqdmulhq_lane_s16(v67, v65, 0), vqaddq_s16(v68, v11)), v67), 6u); v145.val[1] = vqshrun_n_s16( vqsubq_s16( vqaddq_s16(v68, vdupq_n_s16(0x2204u)), vqaddq_s16( vqdmulhq_lane_s16(v67, (int16x4_t)0x3408191366254A85LL, 2), vqdmulhq_lane_s16(v69, (int16x4_t)0x3408191366254A85LL, 3))), 6u); v145.val[2] = vqshrun_n_s16( vqaddq_s16( vqdmulhq_lane_s16(v69, (int16x4_t)0x3408191366254A85LL, 1), vqaddq_s16(v68, vdupq_n_s16(0xC866u))), 6u); vst3_s8(v115 + 27, v145); } v42 += 8; v36 += 8; v117 += 2; v41 += 8; ++v120; v118 += 2; v39 += 8; v40 += 48; v38 += 2; v115 += 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); v70 = (char *)&v139[7] + v125 + 3; memset(&v131[v125], (unsigned __int8)*(v70 - 104), 9 - v125); memset(&v132[v125], (unsigned __int8)*(v70 - 92), 9 - v125); v71 = vaddw_u8( vaddw_u8(vaddl_u8(*(uint8x8_t *)v131, *(uint8x8_t *)&v131[1]), *(uint8x8_t *)v132), *(uint8x8_t *)&v132[1]); v72.n64_u64[0] = vshrn_n_s16( vaddq_s16( vaddq_s16(v71, vshll_n_u8(*(uint8x8_t *)&v131[1], 1u)), vshll_n_u8(*(uint8x8_t *)v132, 1u)), 3u).n64_u64[0]; v71.n128_u64[0] = vshrn_n_s16( vaddq_s16( vaddq_s16(v71, 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, v72); v142.val[0] = vrhadd_u8(*(uint8x8_t *)v132, (uint8x8_t)v71.n128_u64[0]); v143.val[1] = vrhadd_u8(*(uint8x8_t *)&v131[1], (uint8x8_t)v71.n128_u64[0]); v142.val[1] = vrhadd_u8(*(uint8x8_t *)&v132[1], v72); vst2_s8((char *)&v133, v143); vst2_s8((char *)&v137, v142); memcpy(v131, v127, v125); memcpy(v132, a6, v125); memset(&v131[v125], (unsigned __int8)*(v70 - 104), 9 - v125); result = (int)memset(&v132[v125], (unsigned __int8)*(v70 - 92), 9 - v125); v74 = a9 - v130; v75 = a9 - v130 <= 0; v116 = a9 - v130; v76 = vaddw_u8( vaddw_u8(vaddl_u8(*(uint8x8_t *)v131, *(uint8x8_t *)&v131[1]), *(uint8x8_t *)v132), *(uint8x8_t *)&v132[1]); v77.n64_u64[0] = vshrn_n_s16( vaddq_s16( vaddq_s16(v76, vshll_n_u8(*(uint8x8_t *)&v131[1], 1u)), vshll_n_u8(*(uint8x8_t *)v132, 1u)), 3u).n64_u64[0]; v76.n128_u64[0] = vshrn_n_s16( vaddq_s16( vaddq_s16(v76, 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, v77); v143.val[1] = vrhadd_u8(*(uint8x8_t *)&v131[1], (uint8x8_t)v76.n128_u64[0]); v142.val[0] = vrhadd_u8(*(uint8x8_t *)v132, (uint8x8_t)v76.n128_u64[0]); v142.val[1] = vrhadd_u8(*(uint8x8_t *)&v132[1], v77); vst2_s8((char *)&v135, v143); vst2_s8((char *)v139, v142); if ( !v75 ) { v78 = &v134.n64_i8[7]; v79 = (uint8x8_t *)((char *)&v133 + v74); v80 = &v133; v81 = &a1[v128]; v82 = &a7[48 * v124]; do { v84 = *++v81; v83 = v84; v86 = v80->n64_u8[0]; v80 = (uint8x8_t *)((char *)v80 + 1); v85 = v86; v88 = (unsigned __int8)*++v78; v87 = v88; v89 = (19077 * v83) >> 8; v90 = v89 + ((33050 * v85) >> 8) - 17685; if ( v90 < 0 ) v91 = 0; else v91 = -1; if ( (v90 & 0xFFFFC000) == 0 ) v91 = (unsigned int)v90 >> 6; v82[3] = v91; v92 = v89 - ((6419 * v85) >> 8) - ((13320 * v87) >> 8) + 8708; if ( v92 < 0 ) v93 = 0; else v93 = -1; if ( (v92 & 0xFFFFC000) == 0 ) v93 = (unsigned int)v92 >> 6; result = 26149 * v87; v82[4] = v93; v94 = v89 + (result >> 8) - 14234; if ( v94 < 0 ) v95 = 0; else v95 = -1; if ( (v94 & 0xFFFFC000) == 0 ) v95 = (unsigned int)v94 >> 6; v82[5] = v95; v82 += 3; } while ( v80 != v79 ); if ( a2 ) { v96 = &v136.n64_i8[7]; v97 = &v138.n64_i8[7]; v98 = 0; v99 = &a2[v128]; v100 = &a8[48 * v124]; v101 = v100; do { v103 = *++v99; v102 = v103; v105 = (unsigned __int8)*++v96; v104 = v105; v107 = (unsigned __int8)*++v97; v106 = v107; v108 = (19077 * v102) >> 8; v109 = v108 + ((33050 * v104) >> 8) - 17685; if ( v109 < 0 ) v110 = 0; else v110 = -1; if ( (v109 & 0xFFFFC000) == 0 ) v110 = (unsigned int)v109 >> 6; v100[3] = v110; v111 = v108 - ((6419 * v104) >> 8) - ((13320 * v106) >> 8) + 8708; if ( v111 < 0 ) v112 = 0; else v112 = -1; if ( (v111 & 0xFFFFC000) == 0 ) v112 = (unsigned int)v111 >> 6; v101[4] = v112; result = 26149 * v106; v113 = v108 + (result >> 8) - 14234; if ( v113 < 0 ) v114 = 0; else v114 = -1; if ( (v113 & 0xFFFFC000) == 0 ) v114 = (unsigned int)v113 >> 6; ++v98; v101[5] = v114; v100 += 3; v101 += 3; } while ( v116 > v98 ); } } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source