// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/analyse.c
// Function: x264_mb_analyse_intra_chroma(x264_t*, x264_macroblock_t*, x264_mb_analysis_t*)
static void x264_mb_analyse_intra_chroma( x264_t *h, x264_macroblock_t *mb, x264_mb_analysis_t *res )
{
    x264_mb_context_t *ctx = mb->context;

    int i;

    int i_max;
    int predict_mode[9];

    uint8_t *p_dstc[2], *p_srcc[2];
    int      i_dstc[2], i_srcc[2];

    /* 8x8 prediction selection for chroma */
    p_dstc[0] = ctx->p_fdec[1]; i_dstc[0] = ctx->i_fdec[1];
    p_dstc[1] = ctx->p_fdec[2]; i_dstc[1] = ctx->i_fdec[2];
    p_srcc[0] = ctx->p_img[1];  i_srcc[0] = ctx->i_img[1];
    p_srcc[1] = ctx->p_img[2];  i_srcc[1] = ctx->i_img[2];

    predict_8x8_mode_available( mb, predict_mode, &i_max );
    res->i_sad_i8x8 = -1;
    for( i = 0; i < i_max; i++ )
    {
        int i_sad;
        int i_mode;

        i_mode = predict_mode[i];

        /* we do the prediction */
        h->predict_8x8[i_mode]( p_dstc[0], i_dstc[0] );
        h->predict_8x8[i_mode]( p_dstc[1], i_dstc[1] );

        /* we calculate the cost */
        i_sad = h->pixf.satd[PIXEL_8x8]( p_dstc[0], i_dstc[0], p_srcc[0], i_srcc[0] ) +
                h->pixf.satd[PIXEL_8x8]( p_dstc[1], i_dstc[1], p_srcc[1], i_srcc[1] ) +
                res->i_lambda * bs_size_ue( x264_mb_pred_mode8x8_fix[i_mode] );

        /* if i_score is lower it is better */
        if( res->i_sad_i8x8 == -1 || res->i_sad_i8x8 > i_sad )
        {
            res->i_predict8x8 = i_mode;
            res->i_sad_i8x8     = i_sad;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rax
movl 0x5c(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movl 0x60(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x80(%rbp)
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x17880
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x54(%rax) # imm = 0xFFFFFFFF
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x16dfa
movslq -0x24(%rbp), %rax
movl -0x50(%rbp,%rax,4), %eax
movl %eax, -0x88(%rbp)
movq -0x8(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq 0x10f210(%rax,%rcx,8), %rax
movq -0x60(%rbp), %rdi
movl -0x78(%rbp), %esi
callq *%rax
movq -0x8(%rbp), %rax
movslq -0x88(%rbp), %rcx
movq 0x10f210(%rax,%rcx,8), %rax
movq -0x58(%rbp), %rdi
movl -0x74(%rbp), %esi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x10f2f8(%rax), %rax
movq -0x60(%rbp), %rdi
movl -0x78(%rbp), %esi
movq -0x70(%rbp), %rdx
movl -0x80(%rbp), %ecx
callq *%rax
movl %eax, -0x94(%rbp)
movq -0x8(%rbp), %rax
movq 0x10f2f8(%rax), %rax
movq -0x58(%rbp), %rdi
movl -0x74(%rbp), %esi
movq -0x68(%rbp), %rdx
movl -0x7c(%rbp), %ecx
callq *%rax
movl %eax, %ecx
movl -0x94(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x8c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x90(%rbp)
movslq -0x88(%rbp), %rcx
leaq 0x15c6a(%rip), %rax     # 0x2ca00
movl (%rax,%rcx,4), %edi
callq 0x16f40
movl -0x90(%rbp), %ecx
movl %eax, %edx
movl -0x8c(%rbp), %eax
imull %edx, %ecx
addl %ecx, %eax
movl %eax, -0x84(%rbp)
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x54(%rax)
je 0x16dd0
movq -0x18(%rbp), %rax
movl 0x54(%rax), %eax
cmpl -0x84(%rbp), %eax
jle 0x16dea
movl -0x88(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x58(%rax)
movl -0x84(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x54(%rax)
jmp 0x16dec
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x16cde
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)