// File: /workspace/github_c_makefile_star2_O0/tvlabs[P]edge264/./edge264_mvpred.c
// Function: decode_inter_8x16_left
static inline void decode_inter_8x16_left(Edge264Context *ctx, i16x8 mvd, int lx)
{
	// compare neighbouring indices and compute mvp
	i16x8 mvp, mvC;
	int refIdx = mb->refIdx[lx * 4];
	int refIdxA = mbA->refIdx[lx * 4 + 1];
	if (refIdx == refIdxA || ctx->unavail4x4[0] == 14) {
		mvp = (i32x4){mbA->mvs_s[lx * 16 + 5]};
	} else {
		int refIdxB = mbB->refIdx[lx * 4 + 2];
		int refIdxC;
		if (__builtin_expect(ctx->unavail4x4[0] & 2, 0)) {
			refIdxC = mbD->refIdx[lx * 4 + 3];
			mvC = (i32x4){mbD->mvs_s[lx * 16 + 15]};
		} else {
			refIdxC = mbB->refIdx[lx * 4 + 3];
			mvC = (i32x4){mbB->mvs_s[lx * 16 + 14]};
		}
		if (refIdx == refIdxB) {
			mvp = (i32x4){mbB->mvs_s[lx * 16 + 10]};
			if (refIdx == refIdxC) {
				i16x8 mvA = (i32x4){mbA->mvs_s[lx * 16 + 5]};
				mvp = median16(mvA, mvp, mvC);
			}
		} else { // refIdx != refIdxA/B
			mvp = mvC;
			if (refIdx != refIdxC) {
				i16x8 mvA = (i32x4){mbA->mvs_s[lx * 16 + 5]};
				i16x8 mvB = (i32x4){mbB->mvs_s[lx * 16 + 10]};
				mvp = median16(mvA, mvB, mvp);
			}
		}
	}
	
	// sum mvp and mvd, broadcast everything to memory and call decoding
	i16x8 mv = mvp + mvd;
	i16x8 mvs = broadcast32(mv, 0);
	mb->absMvd_l[lx * 4] = mb->absMvd_l[lx * 4 + 2] = ((i64x2)pack_absMvd(mvd))[0];
	mb->mvs_v[lx * 4] = mb->mvs_v[lx * 4 + 2] = mvs;
	decode_inter(ctx, lx * 16, 8, 16);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x1b8(%rbp)
vmovdqa %xmm0, -0x1d0(%rbp)
movl %esi, -0x1d4(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x680(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movsbl 0x10(%rax,%rcx), %eax
movl %eax, -0x204(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x688(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl 0x10(%rax,%rcx), %eax
movl %eax, -0x208(%rbp)
movl -0x204(%rbp), %eax
cmpl -0x208(%rbp), %eax
je 0x1fbae
movq -0x1b8(%rbp), %rax
movsbl 0x6d0(%rax), %eax
cmpl $0xe, %eax
jne 0x1fbee
movq -0x1b8(%rbp), %rax
movq 0x688(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xc4(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x220(%rbp)
vmovdqa -0x220(%rbp), %xmm0
vmovdqa %xmm0, -0x1f0(%rbp)
jmp 0x1fffa
movq -0x1b8(%rbp), %rax
movq 0x690(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsbl 0x10(%rax,%rcx), %eax
movl %eax, -0x224(%rbp)
movq -0x1b8(%rbp), %rax
movsbl 0x6d0(%rax), %eax
andl $0x2, %eax
cltq
cmpq $0x0, %rax
je 0x1fc91
movq -0x1b8(%rbp), %rax
movq 0x6a0(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movsbl 0x13(%rax,%rcx), %eax
movl %eax, -0x228(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x6a0(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xec(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x240(%rbp)
vmovdqa -0x240(%rbp), %xmm0
vmovdqa %xmm0, -0x200(%rbp)
jmp 0x1fcf1
movq -0x1b8(%rbp), %rax
movq 0x690(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movsbl 0x13(%rax,%rcx), %eax
movl %eax, -0x228(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x690(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xe8(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x250(%rbp)
vmovdqa -0x250(%rbp), %xmm0
vmovdqa %xmm0, -0x200(%rbp)
movl -0x204(%rbp), %eax
cmpl -0x224(%rbp), %eax
jne 0x1fe80
movq -0x1b8(%rbp), %rax
movq 0x690(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xd8(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x260(%rbp)
vmovdqa -0x260(%rbp), %xmm0
vmovdqa %xmm0, -0x1f0(%rbp)
movl -0x204(%rbp), %eax
cmpl -0x228(%rbp), %eax
jne 0x1fe7b
movq -0x1b8(%rbp), %rax
movq 0x688(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xc4(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x280(%rbp)
vmovdqa -0x280(%rbp), %xmm0
vmovdqa %xmm0, -0x270(%rbp)
vmovdqa -0x270(%rbp), %xmm2
vmovdqa -0x1f0(%rbp), %xmm1
vmovdqa -0x200(%rbp), %xmm0
vmovdqa %xmm2, -0x160(%rbp)
vmovdqa %xmm1, -0x170(%rbp)
vmovdqa %xmm0, -0x180(%rbp)
vmovdqa -0x160(%rbp), %xmm1
vmovdqa -0x170(%rbp), %xmm0
vmovdqa %xmm1, -0x120(%rbp)
vmovdqa %xmm0, -0x130(%rbp)
vmovdqa -0x120(%rbp), %xmm0
vmovdqa -0x130(%rbp), %xmm1
vpmaxsw %xmm1, %xmm0, %xmm1
vmovdqa -0x180(%rbp), %xmm0
vmovdqa %xmm1, -0xa0(%rbp)
vmovdqa %xmm0, -0xb0(%rbp)
vmovdqa -0xa0(%rbp), %xmm0
vmovdqa -0xb0(%rbp), %xmm1
vpminsw %xmm1, %xmm0, %xmm1
vmovdqa -0x160(%rbp), %xmm2
vmovdqa -0x170(%rbp), %xmm0
vmovdqa %xmm2, -0xc0(%rbp)
vmovdqa %xmm0, -0xd0(%rbp)
vmovdqa -0xc0(%rbp), %xmm0
vmovdqa -0xd0(%rbp), %xmm2
vpminsw %xmm2, %xmm0, %xmm0
vmovdqa %xmm1, -0x140(%rbp)
vmovdqa %xmm0, -0x150(%rbp)
vmovdqa -0x140(%rbp), %xmm0
vmovdqa -0x150(%rbp), %xmm1
vpmaxsw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x1f0(%rbp)
jmp 0x1fff8
vmovdqa -0x200(%rbp), %xmm0
vmovdqa %xmm0, -0x1f0(%rbp)
movl -0x204(%rbp), %eax
cmpl -0x228(%rbp), %eax
je 0x1fff6
movq -0x1b8(%rbp), %rax
movq 0x688(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xc4(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x2a0(%rbp)
vmovdqa -0x2a0(%rbp), %xmm0
vmovdqa %xmm0, -0x290(%rbp)
movq -0x1b8(%rbp), %rax
movq 0x690(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
vmovd 0xd8(%rax,%rcx,4), %xmm0
vmovdqa %xmm0, -0x2c0(%rbp)
vmovdqa -0x2c0(%rbp), %xmm0
vmovdqa %xmm0, -0x2b0(%rbp)
vmovdqa -0x290(%rbp), %xmm2
vmovdqa -0x2b0(%rbp), %xmm1
vmovdqa -0x1f0(%rbp), %xmm0
vmovdqa %xmm2, -0x190(%rbp)
vmovdqa %xmm1, -0x1a0(%rbp)
vmovdqa %xmm0, -0x1b0(%rbp)
vmovdqa -0x190(%rbp), %xmm1
vmovdqa -0x1a0(%rbp), %xmm0
vmovdqa %xmm1, -0xe0(%rbp)
vmovdqa %xmm0, -0xf0(%rbp)
vmovdqa -0xe0(%rbp), %xmm0
vmovdqa -0xf0(%rbp), %xmm1
vpmaxsw %xmm1, %xmm0, %xmm1
vmovdqa -0x1b0(%rbp), %xmm0
vmovdqa %xmm1, -0x60(%rbp)
vmovdqa %xmm0, -0x70(%rbp)
vmovdqa -0x60(%rbp), %xmm0
vmovdqa -0x70(%rbp), %xmm1
vpminsw %xmm1, %xmm0, %xmm1
vmovdqa -0x190(%rbp), %xmm2
vmovdqa -0x1a0(%rbp), %xmm0
vmovdqa %xmm2, -0x80(%rbp)
vmovdqa %xmm0, -0x90(%rbp)
vmovdqa -0x80(%rbp), %xmm0
vmovdqa -0x90(%rbp), %xmm2
vpminsw %xmm2, %xmm0, %xmm0
vmovdqa %xmm1, -0x100(%rbp)
vmovdqa %xmm0, -0x110(%rbp)
vmovdqa -0x100(%rbp), %xmm0
vmovdqa -0x110(%rbp), %xmm1
vpmaxsw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x1f0(%rbp)
jmp 0x1fff8
jmp 0x1fffa
vmovdqa -0x1f0(%rbp), %xmm0
vmovdqa -0x1d0(%rbp), %xmm1
vpaddw %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x2d0(%rbp)
vpbroadcastd -0x2d0(%rbp), %xmm0
vmovdqa %xmm0, -0x2e0(%rbp)
vmovdqa -0x1d0(%rbp), %xmm0
vmovdqa %xmm0, -0x40(%rbp)
vpbroadcastd -0x40(%rbp), %xmm0
vmovdqa %xmm0, -0x50(%rbp)
vmovdqa -0x50(%rbp), %xmm0
vmovdqa %xmm0, -0x20(%rbp)
vmovdqa %xmm0, -0x30(%rbp)
vmovdqa -0x20(%rbp), %xmm0
vmovdqa -0x30(%rbp), %xmm1
vpacksswb %xmm1, %xmm0, %xmm0
vmovdqa %xmm0, -0x10(%rbp)
vpabsb -0x10(%rbp), %xmm0
vmovq %xmm0, %rdx
movq -0x1b8(%rbp), %rax
movq 0x680(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, 0x70(%rax,%rcx,8)
movq -0x1b8(%rbp), %rax
movq 0x680(%rax), %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
movq %rdx, 0x70(%rax,%rcx,8)
vmovdqa -0x2e0(%rbp), %xmm0
movq -0x1b8(%rbp), %rax
movq 0x680(%rax), %rax
addq $0xb0, %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa %xmm0, (%rax)
movq -0x1b8(%rbp), %rax
movq 0x680(%rax), %rax
addq $0xb0, %rax
movl -0x1d4(%rbp), %ecx
shll $0x2, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
vmovdqa %xmm0, (%rax)
movq -0x1b8(%rbp), %rdi
movl -0x1d4(%rbp), %esi
shll $0x4, %esi
movl $0x8, %edx
movl $0x10, %ecx
callq 0x21380
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
nopw %cs:(%rax,%rax)