// File: /workspace/github_c_makefile_star2_O1/tvlabs[P]edge264/./edge264_residual.c
// Function: add_idct8x8
static void add_idct8x8(Edge264Context *ctx, int iYCbCr, uint8_t *p)
{
	// loading and scaling
	unsigned qP = ctx->t.QP[iYCbCr];
	if (ctx->t.samples_clip[iYCbCr][0] == 255) {
		int div = qP / 6;
		i8x16 vm = load64(&normAdjust8x8[qP % 6]);
		i8x16 *wS = ctx->t.pps.weightScale8x8_v + (iYCbCr * 2 + mb->mbIsInterFlag) * 4;
		i8x16 nA0 = shuffle(vm, (i8x16){0, 3, 4, 3, 0, 3, 4, 3, 3, 1, 5, 1, 3, 1, 5, 1});
		i8x16 nA1 = shuffle(vm, (i8x16){4, 5, 2, 5, 4, 5, 2, 5, 3, 1, 5, 1, 3, 1, 5, 1});
		i16x8 LS0 = mullou8(wS[0], nA0);
		i16x8 LS1 = mulhiu8(wS[0], nA0);
		i16x8 LS2 = mullou8(wS[1], nA1);
		i16x8 LS3 = mulhiu8(wS[1], nA1);
		i16x8 LS4 = mullou8(wS[2], nA0);
		i16x8 LS5 = mulhiu8(wS[2], nA0);
		i16x8 LS6 = mullou8(wS[3], nA1);
		i16x8 LS7 = mulhiu8(wS[3], nA1);
		i32x4 *c = ctx->c_v;
		i16x8 d0, d1, d2, d3, d4, d5, d6, d7;
		if (__builtin_expect(div < 6, 1)) {
			int mul = 1 << div; // for NEON
			i32x4 off = set32(1 << (5 - div)); // for SSE
			i32x4 sh = {6 - div}; // for SSE
			d0 = scale32(c[0], c[1], LS0, mul, off, sh);
			d1 = scale32(c[2], c[3], LS1, mul, off, sh);
			d2 = scale32(c[4], c[5], LS2, mul, off, sh);
			d3 = scale32(c[6], c[7], LS3, mul, off, sh);
			d4 = scale32(c[8], c[9], LS4, mul, off, sh);
			d5 = scale32(c[10], c[11], LS5, mul, off, sh);
			d6 = scale32(c[12], c[13], LS6, mul, off, sh);
			d7 = scale32(c[14], c[15], LS7, mul, off, sh);
		} else {
			int sh = div - 6;
			// FIXME use shift function for SSE
			d0 = packs32(c[0], c[1]) * (LS0 << sh);
			d1 = packs32(c[2], c[3]) * (LS1 << sh);
			d2 = packs32(c[4], c[5]) * (LS2 << sh);
			d3 = packs32(c[6], c[7]) * (LS3 << sh);
			d4 = packs32(c[8], c[9]) * (LS4 << sh);
			d5 = packs32(c[10], c[11]) * (LS5 << sh);
			d6 = packs32(c[12], c[13]) * (LS6 << sh);
			d7 = packs32(c[14], c[15]) * (LS7 << sh);
		}
		c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = c[10] = c[11] = c[12] = c[13] = c[14] = c[15] = (i8x16){};
		
		for (int i = 2;;) {
			// 1D transform
			i16x8 e0 = d0 + d4;
			i16x8 e1 = d5 - d3 - ((d7 >> 1) + d7);
			i16x8 e2 = d0 - d4;
			i16x8 e3 = d1 + d7 - ((d3 >> 1) + d3);
			i16x8 e4 = (d2 >> 1) - d6;
			i16x8 e5 = d7 - d1 + ((d5 >> 1) + d5);
			i16x8 e6 = (d6 >> 1) + d2;
			i16x8 e7 = d3 + d5 + ((d1 >> 1) + d1);
			i16x8 f0 = e0 + e6;
			i16x8 f1 = (e7 >> 2) + e1;
			i16x8 f2 = e2 + e4;
			i16x8 f3 = (e5 >> 2) + e3;
			i16x8 f4 = e2 - e4;
			i16x8 f5 = (e3 >> 2) - e5;
			i16x8 f6 = e0 - e6;
			i16x8 f7 = e7 - (e1 >> 2);
			
			// Compilers freak out whenever output uses other registers.
			d0 = f0 + f7;
			d1 = f2 + f5;
			d2 = f4 + f3;
			d3 = f6 + f1;
			d4 = f6 - f1;
			d5 = f4 - f3;
			d6 = f2 - f5;
			d7 = f0 - f7;
			if (--i == 0)
				break;
			
			// matrix transposition
			i16x8 x0 = ziplo16(d0, d1);
			i16x8 x1 = ziplo16(d2, d3);
			i16x8 x2 = ziplo16(d4, d5);
			i16x8 x3 = ziplo16(d6, d7);
			i16x8 x4 = ziphi16(d0, d1);
			i16x8 x5 = ziphi16(d2, d3);
			i16x8 x6 = ziphi16(d4, d5);
			i16x8 x7 = ziphi16(d6, d7);
			i16x8 x8 = ziplo32(x0, x1);
			i16x8 x9 = ziplo32(x2, x3);
			i16x8 xA = ziplo32(x4, x5);
			i16x8 xB = ziplo32(x6, x7);
			i16x8 xC = ziphi32(x0, x1);
			i16x8 xD = ziphi32(x2, x3);
			i16x8 xE = ziphi32(x4, x5);
			i16x8 xF = ziphi32(x6, x7);
			d0 = (i16x8)ziplo64(x8, x9) + 32;
			d1 = ziphi64(x8, x9);
			d2 = ziplo64(xC, xD);
			d3 = ziphi64(xC, xD);
			d4 = ziplo64(xA, xB);
			d5 = ziphi64(xA, xB);
			d6 = ziplo64(xE, xF);
			d7 = ziphi64(xE, xF);
		}
		
		// final residual values
		i16x8 r0 = d0 >> 6;
		i16x8 r1 = d1 >> 6;
		i16x8 r2 = d2 >> 6;
		i16x8 r3 = d3 >> 6;
		i16x8 r4 = d4 >> 6;
		i16x8 r5 = d5 >> 6;
		i16x8 r6 = d6 >> 6;
		i16x8 r7 = d7 >> 6;
		
		// addition to values in place, clipping and storage
		size_t stride = ctx->t.stride[iYCbCr];
		INIT_P();
		i8x16 p0 = addlou8s16(load64(P(0, 0)), r0);
		i8x16 p1 = addlou8s16(load64(P(0, 1)), r1);
		i8x16 p2 = addlou8s16(load64(P(0, 2)), r2);
		i8x16 p3 = addlou8s16(load64(P(0, 3)), r3);
		i8x16 p4 = addlou8s16(load64(P(0, 4)), r4);
		i8x16 p5 = addlou8s16(load64(P(0, 5)), r5);
		i8x16 p6 = addlou8s16(load64(P(0, 6)), r6);
		i8x16 p7 = addlou8s16(load64(P(0, 7)), r7);
		i64x2 u0 = packus16(p0, p1);
		i64x2 u1 = packus16(p2, p3);
		i64x2 u2 = packus16(p4, p5);
		i64x2 u3 = packus16(p6, p7);
		*(int64_t *)P(0, 0) = u0[0];
		*(int64_t *)P(0, 1) = u0[1];
		*(int64_t *)P(0, 2) = u1[0];
		*(int64_t *)P(0, 3) = u1[1];
		*(int64_t *)P(0, 4) = u2[0];
		*(int64_t *)P(0, 5) = u2[1];
		*(int64_t *)P(0, 6) = u3[0];
		*(int64_t *)P(0, 7) = u3[1];
	} // FIXME else 16bit
}

// Assembly:
movslq %esi, %rax
movq %rax, %rcx
shlq $0x4, %rcx
cmpw $0xff, 0x170(%rdi,%rcx)
jne 0x13eac
movsbl 0x50(%rdi,%rax), %r8d
movl $0xaaaaaaab, %esi       # imm = 0xAAAAAAAB
imulq %r8, %rsi
shrq $0x22, %rsi
leal (%rsi,%rsi), %ecx
leal (%rcx,%rcx,2), %ecx
movl %r8d, %r9d
subl %ecx, %r9d
movq 0x680(%rdi), %rcx
movsbl 0x2(%rcx), %ecx
leal (,%rax,8), %r10d
leal (%r10,%rcx,4), %ecx
movslq %ecx, %r10
leaq 0x23131(%rip), %rcx     # 0x36b20
vmovq (%rcx,%r9,8), %xmm0
shlq $0x4, %r10
leaq 0x1b60(%rdi), %rcx
vpshufb 0x1fd77(%rip), %xmm0, %xmm2 # 0x33780
vpshufb 0x1fd7e(%rip), %xmm0, %xmm4 # 0x33790
vmovdqa 0x290(%rdi,%r10), %xmm0
vmovdqa 0x2a0(%rdi,%r10), %xmm5
vmovdqa 0x2b0(%rdi,%r10), %xmm6
vmovdqa 0x2c0(%rdi,%r10), %xmm7
vpmovzxbw %xmm0, %xmm1    # xmm1 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
vpmovzxbw %xmm2, %xmm9    # xmm9 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero,xmm2[4],zero,xmm2[5],zero,xmm2[6],zero,xmm2[7],zero
vpmullw %xmm1, %xmm9, %xmm1
vpxor %xmm8, %xmm8, %xmm8
vpunpckhbw %xmm8, %xmm0, %xmm0 # xmm0 = xmm0[8],xmm8[8],xmm0[9],xmm8[9],xmm0[10],xmm8[10],xmm0[11],xmm8[11],xmm0[12],xmm8[12],xmm0[13],xmm8[13],xmm0[14],xmm8[14],xmm0[15],xmm8[15]
vpunpckhbw %xmm8, %xmm2, %xmm10 # xmm10 = xmm2[8],xmm8[8],xmm2[9],xmm8[9],xmm2[10],xmm8[10],xmm2[11],xmm8[11],xmm2[12],xmm8[12],xmm2[13],xmm8[13],xmm2[14],xmm8[14],xmm2[15],xmm8[15]
vpmullw %xmm0, %xmm10, %xmm0
vpmovzxbw %xmm5, %xmm2    # xmm2 = xmm5[0],zero,xmm5[1],zero,xmm5[2],zero,xmm5[3],zero,xmm5[4],zero,xmm5[5],zero,xmm5[6],zero,xmm5[7],zero
vpmovzxbw %xmm4, %xmm11   # xmm11 = xmm4[0],zero,xmm4[1],zero,xmm4[2],zero,xmm4[3],zero,xmm4[4],zero,xmm4[5],zero,xmm4[6],zero,xmm4[7],zero
vpmullw %xmm2, %xmm11, %xmm3
vpunpckhbw %xmm8, %xmm5, %xmm2 # xmm2 = xmm5[8],xmm8[8],xmm5[9],xmm8[9],xmm5[10],xmm8[10],xmm5[11],xmm8[11],xmm5[12],xmm8[12],xmm5[13],xmm8[13],xmm5[14],xmm8[14],xmm5[15],xmm8[15]
vpunpckhbw %xmm8, %xmm4, %xmm12 # xmm12 = xmm4[8],xmm8[8],xmm4[9],xmm8[9],xmm4[10],xmm8[10],xmm4[11],xmm8[11],xmm4[12],xmm8[12],xmm4[13],xmm8[13],xmm4[14],xmm8[14],xmm4[15],xmm8[15]
vpmullw %xmm2, %xmm12, %xmm2
vpmovzxbw %xmm6, %xmm4    # xmm4 = xmm6[0],zero,xmm6[1],zero,xmm6[2],zero,xmm6[3],zero,xmm6[4],zero,xmm6[5],zero,xmm6[6],zero,xmm6[7],zero
vpmullw %xmm4, %xmm9, %xmm4
vpunpckhbw %xmm8, %xmm6, %xmm5 # xmm5 = xmm6[8],xmm8[8],xmm6[9],xmm8[9],xmm6[10],xmm8[10],xmm6[11],xmm8[11],xmm6[12],xmm8[12],xmm6[13],xmm8[13],xmm6[14],xmm8[14],xmm6[15],xmm8[15]
vpmullw %xmm5, %xmm10, %xmm5
vpmovzxbw %xmm7, %xmm6    # xmm6 = xmm7[0],zero,xmm7[1],zero,xmm7[2],zero,xmm7[3],zero,xmm7[4],zero,xmm7[5],zero,xmm7[6],zero,xmm7[7],zero
vpmullw %xmm6, %xmm11, %xmm6
vpunpckhbw %xmm8, %xmm7, %xmm7 # xmm7 = xmm7[8],xmm8[8],xmm7[9],xmm8[9],xmm7[10],xmm8[10],xmm7[11],xmm8[11],xmm7[12],xmm8[12],xmm7[13],xmm8[13],xmm7[14],xmm8[14],xmm7[15],xmm8[15]
vpmullw %xmm7, %xmm12, %xmm7
cmpl $0x23, %r8d
ja 0x13eb0
movb $0x5, %r8b
subb %sil, %r8b
movl $0x1, %r9d
shlxl %r8d, %r9d, %r8d
vpbroadcastd %r8d, %xmm9
movl $0x6, %r8d
subl %esi, %r8d
vpmovzxwd %xmm1, %xmm10   # xmm10 = xmm1[0],zero,xmm1[1],zero,xmm1[2],zero,xmm1[3],zero
vpmaddwd 0x1b60(%rdi), %xmm10, %xmm10
vpaddd %xmm9, %xmm10, %xmm11
vmovd %r8d, %xmm10
vpsrad %xmm10, %xmm11, %xmm11
vpunpckhwd %xmm8, %xmm1, %xmm1 # xmm1 = xmm1[4],xmm8[4],xmm1[5],xmm8[5],xmm1[6],xmm8[6],xmm1[7],xmm8[7]
vpmaddwd 0x1b70(%rdi), %xmm1, %xmm1
vpaddd %xmm1, %xmm9, %xmm1
vpsrad %xmm10, %xmm1, %xmm1
vpackssdw %xmm1, %xmm11, %xmm1
vpmovzxwd %xmm0, %xmm11   # xmm11 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero
vpmaddwd 0x1b80(%rdi), %xmm11, %xmm11
vpaddd %xmm9, %xmm11, %xmm11
vpsrad %xmm10, %xmm11, %xmm11
vpunpckhwd %xmm8, %xmm0, %xmm0 # xmm0 = xmm0[4],xmm8[4],xmm0[5],xmm8[5],xmm0[6],xmm8[6],xmm0[7],xmm8[7]
vpmaddwd 0x1b90(%rdi), %xmm0, %xmm0
vpaddd %xmm0, %xmm9, %xmm0
vpsrad %xmm10, %xmm0, %xmm0
vpackssdw %xmm0, %xmm11, %xmm0
vpmovzxwd %xmm3, %xmm11   # xmm11 = xmm3[0],zero,xmm3[1],zero,xmm3[2],zero,xmm3[3],zero
vpmaddwd 0x1ba0(%rdi), %xmm11, %xmm11
vpaddd %xmm9, %xmm11, %xmm11
vpsrad %xmm10, %xmm11, %xmm11
vpunpckhwd %xmm8, %xmm3, %xmm3 # xmm3 = xmm3[4],xmm8[4],xmm3[5],xmm8[5],xmm3[6],xmm8[6],xmm3[7],xmm8[7]
vpmaddwd 0x1bb0(%rdi), %xmm3, %xmm3
vpaddd %xmm3, %xmm9, %xmm3
vpsrad %xmm10, %xmm3, %xmm3
vpmovzxwd %xmm2, %xmm12   # xmm12 = xmm2[0],zero,xmm2[1],zero,xmm2[2],zero,xmm2[3],zero
vpmaddwd 0x1bc0(%rdi), %xmm12, %xmm12
vpaddd %xmm9, %xmm12, %xmm12
vpsrad %xmm10, %xmm12, %xmm12
vpunpckhwd %xmm8, %xmm2, %xmm2 # xmm2 = xmm2[4],xmm8[4],xmm2[5],xmm8[5],xmm2[6],xmm8[6],xmm2[7],xmm8[7]
vpmaddwd 0x1bd0(%rdi), %xmm2, %xmm2
vpaddd %xmm2, %xmm9, %xmm2
vpsrad %xmm10, %xmm2, %xmm13
vpackssdw %xmm3, %xmm11, %xmm2
vpackssdw %xmm13, %xmm12, %xmm3
vpmovzxwd %xmm4, %xmm11   # xmm11 = xmm4[0],zero,xmm4[1],zero,xmm4[2],zero,xmm4[3],zero
vpmaddwd 0x1be0(%rdi), %xmm11, %xmm11
vpaddd %xmm9, %xmm11, %xmm11
vpsrad %xmm10, %xmm11, %xmm11
vpunpckhwd %xmm8, %xmm4, %xmm4 # xmm4 = xmm4[4],xmm8[4],xmm4[5],xmm8[5],xmm4[6],xmm8[6],xmm4[7],xmm8[7]
vpmaddwd 0x1bf0(%rdi), %xmm4, %xmm4
vpaddd %xmm4, %xmm9, %xmm4
vpsrad %xmm10, %xmm4, %xmm4
vpackssdw %xmm4, %xmm11, %xmm4
vpmovzxwd %xmm5, %xmm11   # xmm11 = xmm5[0],zero,xmm5[1],zero,xmm5[2],zero,xmm5[3],zero
vpmaddwd 0x1c00(%rdi), %xmm11, %xmm11
vpaddd %xmm9, %xmm11, %xmm11
vpsrad %xmm10, %xmm11, %xmm11
vpunpckhwd %xmm8, %xmm5, %xmm5 # xmm5 = xmm5[4],xmm8[4],xmm5[5],xmm8[5],xmm5[6],xmm8[6],xmm5[7],xmm8[7]
vpmaddwd 0x1c10(%rdi), %xmm5, %xmm5
vpaddd %xmm5, %xmm9, %xmm5
vpsrad %xmm10, %xmm5, %xmm5
vpmovzxwd %xmm6, %xmm12   # xmm12 = xmm6[0],zero,xmm6[1],zero,xmm6[2],zero,xmm6[3],zero
vpmaddwd 0x1c20(%rdi), %xmm12, %xmm12
vpaddd %xmm9, %xmm12, %xmm12
vpsrad %xmm10, %xmm12, %xmm12
vpunpckhwd %xmm8, %xmm6, %xmm6 # xmm6 = xmm6[4],xmm8[4],xmm6[5],xmm8[5],xmm6[6],xmm8[6],xmm6[7],xmm8[7]
vpmaddwd 0x1c30(%rdi), %xmm6, %xmm6
vpackssdw %xmm5, %xmm11, %xmm5
vpaddd %xmm6, %xmm9, %xmm6
vpsrad %xmm10, %xmm6, %xmm6
vpackssdw %xmm6, %xmm12, %xmm6
vpmovzxwd %xmm7, %xmm11   # xmm11 = xmm7[0],zero,xmm7[1],zero,xmm7[2],zero,xmm7[3],zero
vpmaddwd 0x1c40(%rdi), %xmm11, %xmm11
vpaddd %xmm9, %xmm11, %xmm11
vpsrad %xmm10, %xmm11, %xmm11
vpunpckhwd %xmm8, %xmm7, %xmm7 # xmm7 = xmm7[4],xmm8[4],xmm7[5],xmm8[5],xmm7[6],xmm8[6],xmm7[7],xmm8[7]
vpmaddwd 0x1c50(%rdi), %xmm7, %xmm7
vpaddd %xmm7, %xmm9, %xmm7
vpsrad %xmm10, %xmm7, %xmm7
vpackssdw %xmm7, %xmm11, %xmm8
vpxor %xmm7, %xmm7, %xmm7
vmovdqu %ymm7, 0xe0(%rcx)
vmovdqu %ymm7, 0xc0(%rcx)
vmovdqu %ymm7, 0xa0(%rcx)
vmovdqu %ymm7, 0x80(%rcx)
vmovdqu %ymm7, 0x60(%rcx)
vmovdqu %ymm7, 0x40(%rcx)
vmovdqu %ymm7, 0x20(%rcx)
vmovdqu %ymm7, (%rcx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
vpbroadcastw 0x1febc(%rip), %xmm7 # 0x33b54
vpaddw %xmm4, %xmm1, %xmm9
vpsraw $0x1, %xmm8, %xmm10
vpaddw %xmm3, %xmm8, %xmm11
vpaddw %xmm11, %xmm10, %xmm10
vpsubw %xmm10, %xmm5, %xmm10
vpsubw %xmm4, %xmm1, %xmm1
vpsraw $0x1, %xmm3, %xmm4
vpaddw %xmm4, %xmm3, %xmm4
vpsubw %xmm4, %xmm8, %xmm4
vpaddw %xmm0, %xmm4, %xmm4
vpsraw $0x1, %xmm2, %xmm11
vpsubw %xmm6, %xmm11, %xmm11
vpsubw %xmm0, %xmm8, %xmm8
vpsraw $0x1, %xmm5, %xmm12
vpaddw %xmm5, %xmm12, %xmm12
vpaddw %xmm8, %xmm12, %xmm8
vpsraw $0x1, %xmm6, %xmm6
vpaddw %xmm6, %xmm2, %xmm2
vpsraw $0x1, %xmm0, %xmm6
vpaddw %xmm5, %xmm3, %xmm3
vpaddw %xmm0, %xmm3, %xmm0
vpaddw %xmm6, %xmm0, %xmm0
vpaddw %xmm2, %xmm9, %xmm12
vpsraw $0x2, %xmm0, %xmm3
vpaddw %xmm3, %xmm10, %xmm5
vpaddw %xmm1, %xmm11, %xmm6
vpsraw $0x2, %xmm8, %xmm3
vpaddw %xmm4, %xmm3, %xmm13
vpsubw %xmm11, %xmm1, %xmm11
vpsraw $0x2, %xmm4, %xmm1
vpsubw %xmm8, %xmm1, %xmm8
vpsubw %xmm2, %xmm9, %xmm4
vpsraw $0x2, %xmm10, %xmm1
vpsubw %xmm1, %xmm0, %xmm9
vpaddw %xmm9, %xmm12, %xmm1
vpaddw %xmm6, %xmm8, %xmm0
vpaddw %xmm11, %xmm13, %xmm2
vpaddw %xmm4, %xmm5, %xmm3
vpsubw %xmm5, %xmm4, %xmm4
vpsubw %xmm13, %xmm11, %xmm5
vpsubw %xmm8, %xmm6, %xmm6
vpsubw %xmm9, %xmm12, %xmm8
testl %ecx, %ecx
je 0x13dcb
vpunpcklwd %xmm0, %xmm1, %xmm9 # xmm9 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
vpunpcklwd %xmm3, %xmm2, %xmm10 # xmm10 = xmm2[0],xmm3[0],xmm2[1],xmm3[1],xmm2[2],xmm3[2],xmm2[3],xmm3[3]
vpunpcklwd %xmm5, %xmm4, %xmm11 # xmm11 = xmm4[0],xmm5[0],xmm4[1],xmm5[1],xmm4[2],xmm5[2],xmm4[3],xmm5[3]
vpunpcklwd %xmm8, %xmm6, %xmm12 # xmm12 = xmm6[0],xmm8[0],xmm6[1],xmm8[1],xmm6[2],xmm8[2],xmm6[3],xmm8[3]
vpunpckhwd %xmm0, %xmm1, %xmm0 # xmm0 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
vpunpckhwd %xmm3, %xmm2, %xmm1 # xmm1 = xmm2[4],xmm3[4],xmm2[5],xmm3[5],xmm2[6],xmm3[6],xmm2[7],xmm3[7]
vpunpckhwd %xmm5, %xmm4, %xmm2 # xmm2 = xmm4[4],xmm5[4],xmm4[5],xmm5[5],xmm4[6],xmm5[6],xmm4[7],xmm5[7]
vpunpckhwd %xmm8, %xmm6, %xmm3 # xmm3 = xmm6[4],xmm8[4],xmm6[5],xmm8[5],xmm6[6],xmm8[6],xmm6[7],xmm8[7]
vpunpckldq %xmm10, %xmm9, %xmm4 # xmm4 = xmm9[0],xmm10[0],xmm9[1],xmm10[1]
vpunpckldq %xmm12, %xmm11, %xmm5 # xmm5 = xmm11[0],xmm12[0],xmm11[1],xmm12[1]
vpunpckldq %xmm1, %xmm0, %xmm6 # xmm6 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
vpunpckldq %xmm3, %xmm2, %xmm8 # xmm8 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
vpunpckhdq %xmm10, %xmm9, %xmm9 # xmm9 = xmm9[2],xmm10[2],xmm9[3],xmm10[3]
vpunpckhdq %xmm12, %xmm11, %xmm10 # xmm10 = xmm11[2],xmm12[2],xmm11[3],xmm12[3]
vpunpckhdq %xmm1, %xmm0, %xmm11 # xmm11 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
vpunpckhdq %xmm3, %xmm2, %xmm12 # xmm12 = xmm2[2],xmm3[2],xmm2[3],xmm3[3]
vpunpcklqdq %xmm5, %xmm4, %xmm0 # xmm0 = xmm4[0],xmm5[0]
vpaddw %xmm7, %xmm0, %xmm1
vpunpckhqdq %xmm5, %xmm4, %xmm0 # xmm0 = xmm4[1],xmm5[1]
vpunpcklqdq %xmm10, %xmm9, %xmm2 # xmm2 = xmm9[0],xmm10[0]
vpunpckhqdq %xmm10, %xmm9, %xmm3 # xmm3 = xmm9[1],xmm10[1]
vpunpcklqdq %xmm8, %xmm6, %xmm4 # xmm4 = xmm6[0],xmm8[0]
vpunpckhqdq %xmm8, %xmm6, %xmm5 # xmm5 = xmm6[1],xmm8[1]
vpunpcklqdq %xmm12, %xmm11, %xmm6 # xmm6 = xmm11[0],xmm12[0]
vpunpckhqdq %xmm12, %xmm11, %xmm8 # xmm8 = xmm11[1],xmm12[1]
incl %ecx
cmpl $0x1, %ecx
jne 0x13c98
vpsraw $0x6, %xmm1, %xmm1
vpsraw $0x6, %xmm0, %xmm0
vpsraw $0x6, %xmm2, %xmm2
vpsraw $0x6, %xmm3, %xmm3
vpsraw $0x6, %xmm4, %xmm4
vpsraw $0x6, %xmm5, %xmm5
vpsraw $0x6, %xmm6, %xmm6
vpsraw $0x6, %xmm8, %xmm7
movzwl 0x34(%rdi,%rax,2), %ecx
leaq (%rdx,%rcx,8), %rax
subq %rcx, %rax
vpmovzxbw (%rdx), %xmm8
vpaddw %xmm1, %xmm8, %xmm1
vpmovzxbw (%rdx,%rcx), %xmm8
vpaddw %xmm0, %xmm8, %xmm0
vpackuswb %xmm0, %xmm1, %xmm0
leal (%rcx,%rcx), %esi
vpmovzxbw (%rdx,%rsi), %xmm1
vpaddw %xmm1, %xmm2, %xmm1
movl %ecx, %edi
shll $0x2, %edi
movq %rax, %r8
subq %rdi, %r8
vpmovzxbw (%r8), %xmm2
vpaddw %xmm2, %xmm3, %xmm2
vpackuswb %xmm2, %xmm1, %xmm1
vpmovzxbw (%rdx,%rdi), %xmm2
vpaddw %xmm2, %xmm4, %xmm2
movq %rax, %r9
subq %rsi, %r9
vpmovzxbw (%r9), %xmm3
vpaddw %xmm3, %xmm5, %xmm3
movq %rax, %r10
subq %rcx, %r10
vpmovzxbw (%r10), %xmm4
vpmovzxbw (%rax), %xmm5
vpackuswb %xmm3, %xmm2, %xmm2
vmovq %xmm0, (%rdx)
vpextrq $0x1, %xmm0, (%rdx,%rcx)
vpaddw %xmm4, %xmm6, %xmm0
vmovq %xmm1, (%rdx,%rsi)
vpextrq $0x1, %xmm1, (%r8)
vpaddw %xmm5, %xmm7, %xmm1
vmovq %xmm2, (%rdx,%rdi)
vpextrq $0x1, %xmm2, (%r9)
vpackuswb %xmm1, %xmm0, %xmm0
vmovq %xmm0, (%r10)
vpextrq $0x1, %xmm0, (%rax)
vzeroupper
retq
vmovdqa 0x1b60(%rdi), %xmm8
vmovdqa 0x1b80(%rdi), %xmm9
vmovdqa 0x1ba0(%rdi), %xmm10
vmovdqa 0x1bc0(%rdi), %xmm11
vpackssdw 0x1b70(%rdi), %xmm8, %xmm8
addl $-0x6, %esi
movzwl %si, %esi
vmovd %esi, %xmm12
vpsllw %xmm12, %xmm1, %xmm1
vpackssdw 0x1b90(%rdi), %xmm9, %xmm9
vpmullw %xmm1, %xmm8, %xmm1
vpsllw %xmm12, %xmm0, %xmm0
vpmullw %xmm0, %xmm9, %xmm0
vpackssdw 0x1bb0(%rdi), %xmm10, %xmm8
vpsllw %xmm12, %xmm3, %xmm3
vpackssdw 0x1bd0(%rdi), %xmm11, %xmm9
vpsllw %xmm12, %xmm2, %xmm10
vpmullw %xmm3, %xmm8, %xmm2
vpmullw %xmm10, %xmm9, %xmm3
vmovdqa 0x1be0(%rdi), %xmm8
vpackssdw 0x1bf0(%rdi), %xmm8, %xmm8
vpsllw %xmm12, %xmm4, %xmm4
vmovdqa 0x1c00(%rdi), %xmm9
vpackssdw 0x1c10(%rdi), %xmm9, %xmm9
vpmullw %xmm4, %xmm8, %xmm4
vpsllw %xmm12, %xmm5, %xmm5
vpmullw %xmm5, %xmm9, %xmm5
vmovdqa 0x1c20(%rdi), %xmm8
vpackssdw 0x1c30(%rdi), %xmm8, %xmm8
vpsllw %xmm12, %xmm6, %xmm6
vmovdqa 0x1c40(%rdi), %xmm9
vpmullw %xmm6, %xmm8, %xmm6
vpackssdw 0x1c50(%rdi), %xmm9, %xmm8
vpsllw %xmm12, %xmm7, %xmm7
vpmullw %xmm7, %xmm8, %xmm8
jmp 0x13c53