// File: /workspace/github_c_makefile_star2_O3/akumrao[P]videoAnalyzer/encoder/me.c
// Function: me_mv_test(x264_t*, int*, int*, int*, int, unsigned char*, int, unsigned char*, int, int, int, int, int, int)
static inline int me_mv_test( x264_t *h,  
                                  int *pi_sad, int *pi_mvx, int *pi_mvy,  
                                  int i_sad_mode, uint8_t *img, int i_img, uint8_t *test, int i_test_stride,  
                                  int mvx, int mvy,  
                                  int i_lambda_motion, int mvxp, int mvyp )  
    {  
        int i_sad;  
      
        i_sad = h->pixf.sad[i_sad_mode]( img, i_img, &test[mvy*i_test_stride+mvx], i_test_stride );  
        if( i_sad + i_lambda_motion * ( bs_size_se((mvx<<2) - mvxp)+bs_size_se((mvy<<2) - mvyp) ) <  
           *pi_sad + i_lambda_motion * ( bs_size_se(((*pi_mvx)<<2) - mvxp)+bs_size_se(((*pi_mvy)<<2) - mvyp) ) )  
        {  
            *pi_sad = i_sad;  
            *pi_mvx = mvx;  
            *pi_mvy = mvy;  
            return 1;  
        }  
      
        return 0;  
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, %rax
movl 0x40(%rbp), %r15d
movl 0x30(%rbp), %edx
movl 0x28(%rbp), %ebx
movl 0x10(%rbp), %esi
movl 0x20(%rbp), %ecx
movslq %r8d, %r8
imull %ecx, %edx
addl %ebx, %edx
movslq %edx, %rdx
addq 0x18(%rbp), %rdx
movq %r9, %rdi
callq *0x10f2a8(%rax,%r8,8)
movl %eax, -0x2c(%rbp)
leal (,%rbx,4), %r14d
subl %r15d, %r14d
leaq 0x7df4(%rip), %r13      # 0x271b4
leaq 0xbb15(%rip), %rbx      # 0x2aedc
leaq 0xef62(%rip), %rdx      # 0x2e330
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4a56
leal (%r14,%r14), %eax
negl %eax
testl %r14d, %r14d
leal -0x1(%r14,%r14), %r14d
cmovlel %eax, %r14d
leaq 0xbafd(%rip), %rdx      # 0x2aef1
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4a56
cmpl $0xfe, %r14d
ja 0x1f41a
movl %r14d, %eax
leaq 0xeadc(%rip), %rcx      # 0x2def0
movl (%rcx,%rax,4), %r12d
jmp 0x1f45a
leal 0x1(%r14), %eax
movl %eax, %ecx
shrl $0x10, %ecx
decl %ecx
xorl %edx, %edx
cmpl $0xffff, %r14d          # imm = 0xFFFF
setae %dl
cmovbl %eax, %ecx
shll $0x5, %edx
leal 0x10(%rdx), %r12d
movl %ecx, %eax
shrl $0x8, %eax
decl %eax
cmpl $0x100, %ecx            # imm = 0x100
cmovbl %ecx, %eax
cmovbl %edx, %r12d
leaq 0xea9a(%rip), %rcx      # 0x2def0
addl (%rcx,%rax,4), %r12d
movl 0x30(%rbp), %eax
leal (,%rax,4), %r14d
subl 0x48(%rbp), %r14d
leaq 0x7d44(%rip), %rbx      # 0x271b4
leaq 0xba65(%rip), %r13      # 0x2aedc
leaq 0xeeb2(%rip), %rdx      # 0x2e330
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
leal (%r14,%r14), %eax
negl %eax
testl %r14d, %r14d
leal -0x1(%r14,%r14), %r14d
cmovlel %eax, %r14d
leaq 0xba4d(%rip), %rdx      # 0x2aef1
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
cmpl $0xfe, %r14d
ja 0x1f4ca
movl %r14d, %eax
leaq 0xea2c(%rip), %rcx      # 0x2def0
movl (%rcx,%rax,4), %r14d
jmp 0x1f50a
leal 0x1(%r14), %eax
movl %eax, %ecx
shrl $0x10, %ecx
decl %ecx
xorl %edx, %edx
cmpl $0xffff, %r14d          # imm = 0xFFFF
setae %dl
cmovbl %eax, %ecx
shll $0x5, %edx
leal 0x10(%rdx), %r14d
movl %ecx, %eax
shrl $0x8, %eax
decl %eax
cmpl $0x100, %ecx            # imm = 0x100
cmovbl %ecx, %eax
cmovbl %edx, %r14d
leaq 0xe9ea(%rip), %rcx      # 0x2def0
addl (%rcx,%rax,4), %r14d
addl %r12d, %r14d
imull 0x38(%rbp), %r14d
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movl (%rax), %r12d
shll $0x2, %r12d
subl %r15d, %r12d
leaq 0x7c84(%rip), %rbx      # 0x271b4
leaq 0xb9a5(%rip), %r13      # 0x2aedc
leaq 0xedf2(%rip), %rdx      # 0x2e330
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
leal (%r12,%r12), %eax
negl %eax
testl %r12d, %r12d
leal -0x1(%r12,%r12), %r15d
cmovlel %eax, %r15d
leaq 0xb98d(%rip), %rdx      # 0x2aef1
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
cmpl $0xfe, %r15d
ja 0x1f58a
movl %r15d, %eax
leaq 0xe96c(%rip), %rcx      # 0x2def0
movl (%rcx,%rax,4), %r15d
jmp 0x1f5ca
leal 0x1(%r15), %eax
movl %eax, %ecx
shrl $0x10, %ecx
decl %ecx
xorl %edx, %edx
cmpl $0xffff, %r15d          # imm = 0xFFFF
setae %dl
cmovbl %eax, %ecx
shll $0x5, %edx
leal 0x10(%rdx), %r15d
movl %ecx, %eax
shrl $0x8, %eax
decl %eax
cmpl $0x100, %ecx            # imm = 0x100
cmovbl %ecx, %eax
cmovbl %edx, %r15d
leaq 0xe92a(%rip), %rcx      # 0x2def0
addl (%rcx,%rax,4), %r15d
addl -0x2c(%rbp), %r14d
movq -0x48(%rbp), %rax
movl (%rax), %r12d
shll $0x2, %r12d
subl 0x48(%rbp), %r12d
leaq 0x7bd0(%rip), %rbx      # 0x271b4
leaq 0xb8f1(%rip), %r13      # 0x2aedc
leaq 0xed3e(%rip), %rdx      # 0x2e330
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
leal (%r12,%r12), %eax
negl %eax
testl %r12d, %r12d
leal -0x1(%r12,%r12), %r12d
cmovlel %eax, %r12d
leaq 0xb8d9(%rip), %rdx      # 0x2aef1
movq %rbx, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4a56
cmpl $0xfe, %r12d
ja 0x1f63d
movl %r12d, %eax
leaq 0xe8b8(%rip), %rcx      # 0x2def0
movl (%rcx,%rax,4), %ecx
jmp 0x1f67c
leal 0x1(%r12), %eax
movl %eax, %edx
shrl $0x10, %edx
decl %edx
xorl %esi, %esi
cmpl $0xffff, %r12d          # imm = 0xFFFF
setae %sil
cmovbl %eax, %edx
shll $0x5, %esi
leal 0x10(%rsi), %ecx
movl %edx, %eax
shrl $0x8, %eax
decl %eax
cmpl $0x100, %edx            # imm = 0x100
cmovbl %edx, %eax
cmovbl %esi, %ecx
leaq 0xe877(%rip), %rdx      # 0x2def0
addl (%rdx,%rax,4), %ecx
addl %r15d, %ecx
imull 0x38(%rbp), %ecx
addl -0x30(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %r14d
jge 0x1f6ad
movq -0x38(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movl 0x28(%rbp), %ecx
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
movl 0x30(%rbp), %ecx
movl %ecx, (%rax)
movl $0x1, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq