// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/core/macroblock.c
// Function: x264_mb_predict_mv_pskip(x264_macroblock_t*, int*)
void x264_mb_predict_mv_pskip(x264_macroblock_t *mb, int mv[2]) {LOG_CALL;
    int x, y, xn, yn;

    int i_refa = -1;
    int i_refb = -1;

    int mvxa = 0, mvxb = 0;
    int mvya = 0, mvyb = 0;

    x264_macroblock_t *mbn;


    x264_mb_partition_getxy(mb, 0, 0, &x, &y);

    /* Left  pixel (-1,0)*/
    xn = x - 1;
    mbn = mb;
    if (xn < 0)
    {
        xn += 4;
        mbn = mb->context->mba;
    }
    if (mbn)
    {
        i_refa = -2;
        if (!IS_INTRA(mbn->i_type) && mbn->partition[xn][y].i_ref[0] != -1)
        {
            i_refa = mbn->partition[xn][y].i_ref[0];
            mvxa = mbn->partition[xn][y].mv[0][0];
            mvya = mbn->partition[xn][y].mv[0][1];
        }
    }

    /* Up ( pixel(0,-1)*/
    yn = y - 1;
    mbn = mb;
    if (yn < 0)
    {
        yn += 4;
        mbn = mb->context->mbb;
    }
    if (mbn)
    {
        i_refb = -2;
        if (!IS_INTRA(mbn->i_type) && mbn->partition[x][yn].i_ref[0] != -1)
        {
            i_refb = mbn->partition[x][yn].i_ref[0];
            mvxb = mbn->partition[x][yn].mv[0][0];
            mvyb = mbn->partition[x][yn].mv[0][1];
        }
    }

    if (i_refa == -1 || i_refb == -1 ||
            (i_refa == 0 && mvxa == 0 && mvya == 0) ||
            (i_refb == 0 && mvxb == 0 && mvyb == 0))
    {
        mv[0] = 0;
        mv[1] = 0;
    } else
    {
        x264_mb_predict_mv(mb, 0, 0, 0, mv);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x152d3(%rip), %rdi     # 0x1b1b4
leaq 0x15cb0(%rip), %rsi     # 0x1bb98
leaq 0x15d8d(%rip), %rdx     # 0x1bc7c
xorl %eax, %eax
callq 0x39ba
leaq -0x20(%rbp), %r15
leaq -0x1c(%rbp), %r8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
callq 0x58f5
movslq (%r15), %rcx
testq %rcx, %rcx
jle 0x5f1d
leal -0x1(%rcx), %edx
movq %r14, %rsi
jmp 0x5f27
leal 0x3(%rcx), %edx
movq 0x10(%r14), %rax
movq (%rax), %rsi
testq %rsi, %rsi
je 0x5f76
cmpl $0x2, 0x18(%rsi)
movl -0x1c(%rbp), %edi
movb $0x1, %al
pushq $-0x2
popq %r8
jb 0x5f71
movslq %edi, %r9
movslq %edx, %rdx
imulq $0xa0, %rdx, %rdx
addq %rdx, %rsi
imulq $0x28, %r9, %r9
movl 0x30(%r9,%rsi), %edx
cmpl $-0x1, %edx
je 0x5f71
addq %r9, %rsi
addq $0x30, %rsi
cmpl $0x0, 0x8(%rsi)
sete %al
cmpl $0x0, 0xc(%rsi)
sete %sil
jmp 0x5f81
movl %r8d, %edx
jmp 0x5f7e
movb $0x1, %al
pushq $-0x1
popq %rdx
movl -0x1c(%rbp), %edi
movb $0x1, %sil
testl %edi, %edi
jle 0x5f8c
decl %edi
movq %r14, %r8
jmp 0x5f97
addl $0x3, %edi
movq 0x10(%r14), %r8
movq 0x8(%r8), %r8
testq %r8, %r8
je 0x5fe7
cmpl $0x2, 0x18(%r8)
jb 0x5fd0
imulq $0xa0, %rcx, %rcx
addq %rcx, %r8
movslq %edi, %rcx
imulq $0x28, %rcx, %rdi
movl 0x30(%rdi,%r8), %ecx
cmpl $-0x1, %ecx
je 0x5fd0
addq %r8, %rdi
addq $0x30, %rdi
orl 0x8(%rdi), %ecx
orl 0xc(%rdi), %ecx
sete %cl
jmp 0x5fd2
xorl %ecx, %ecx
cmpl $-0x1, %edx
je 0x5fe7
testl %edx, %edx
sete %dl
andb %sil, %al
andb %dl, %al
orb %cl, %al
testb $0x1, %al
je 0x5ff6
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5acc