// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/encoder.c
// Function: x264_slice_header_write(bs_s*, x264_slice_header_t*, int)
static void x264_slice_header_write(bs_t *s, x264_slice_header_t *sh, int i_nal_ref_idc) {LOG_CALL;
    bs_write_ue(s, sh->i_first_mb,"i_first_mb");
    bs_write_ue(s, sh->i_type + 5,"i_type"); /* same type things */
    bs_write_ue(s, sh->i_pps_id,"i_pps_id");
    bs_write(s, sh->sps->i_log2_max_frame_num, sh->i_frame_num,"i_log2_max_frame_num");

    if (sh->i_idr_pic_id >= 0) /* NAL IDR */
    {
        bs_write_ue(s, sh->i_idr_pic_id,"i_idr_pic_id");
    }

    if (sh->sps->i_poc_type == 0)
    {
        bs_write(s, sh->sps->i_log2_max_poc_lsb, sh->i_poc_lsb,"i_log2_max_poc_lsb");
        if (sh->pps->b_pic_order && !sh->b_field_pic)
        {
            bs_write_se(s, sh->i_delta_poc_bottom,"i_delta_poc_bottom");
        }
    } else if (sh->sps->i_poc_type == 1 && !sh->sps->b_delta_pic_order_always_zero)
    {
        bs_write_se(s, sh->i_delta_poc[0],"i_delta_poc[0]");
        if (sh->pps->b_pic_order && !sh->b_field_pic)
        {
            bs_write_se(s, sh->i_delta_poc[1],"i_delta_poc[1]");
        }
    }

    if (sh->pps->b_redundant_pic_cnt)
    {
        bs_write_ue(s, sh->i_redundant_pic_cnt,"i_redundant_pic_cnt");
    }

    if (sh->i_type == SLICE_TYPE_B)
    {
        bs_write1(s, sh->b_direct_spatial_mv_pred, "b_direct_spatial_mv_pred");
    }
    if (sh->i_type == SLICE_TYPE_P || sh->i_type == SLICE_TYPE_SP || sh->i_type == SLICE_TYPE_B)
    {
        bs_write1(s, sh->b_num_ref_idx_override,"b_num_ref_idx_override");
        if (sh->b_num_ref_idx_override)
        {
            bs_write_ue(s, sh->i_num_ref_idx_l0_active - 1, "i_num_ref_idx_l0_active");
            if (sh->i_type == SLICE_TYPE_B)
            {
                bs_write_ue(s, sh->i_num_ref_idx_l1_active - 1,"i_num_ref_idx_l1_active");
            }
        }
    }

    /* ref pic list reordering */
    if (sh->i_type != SLICE_TYPE_I)
    {
        int b_ref_pic_list_reordering_l0 = 0;
        bs_write1(s, b_ref_pic_list_reordering_l0,"b_ref_pic_list_reordering_l0");
        if (b_ref_pic_list_reordering_l0)
        {
            /* FIXME */
        }
    }
    if (sh->i_type == SLICE_TYPE_B)
    {
        int b_ref_pic_list_reordering_l1 = 0;
        bs_write1(s, b_ref_pic_list_reordering_l1,"b_ref_pic_list_reordering_l1");
        if (b_ref_pic_list_reordering_l1)
        {
            /* FIXME */
        }
    }

    if ((sh->pps->b_weighted_pred && (sh->i_type == SLICE_TYPE_P || sh->i_type == SLICE_TYPE_SP)) ||
            (sh->pps->b_weighted_bipred == 1 && sh->i_type == SLICE_TYPE_B))
    {
        /* FIXME */
    }

    if (i_nal_ref_idc != 0)
    {
        if (sh->i_idr_pic_id >= 0)
        {
            bs_write1(s, 0, " no output of prior pics flag "); /* no output of prior pics flag */
            bs_write1(s, 0,"long term reference flag "); /* long term reference flag */
        } else
        {
            bs_write1(s, 0,"adaptive_ref_pic_marking_mode_flag"); /* adaptive_ref_pic_marking_mode_flag */
            /* FIXME */
        }
    }

    if (sh->pps->b_cabac && sh->i_type != SLICE_TYPE_I)
    {
        bs_write_ue(s, sh->i_cabac_init_idc,"i_cabac_init_idc");
    }
    bs_write_se(s, sh->i_qp_delta,"i_qp_delta"); /* slice qp delta */
#if 0
    if (sh->i_type == SLICE_TYPE_SP || sh->i_type == SLICE_TYPE_SI)
    {
        if (sh->i_type == SLICE_TYPE_SP)
        {
            bs_write1(s, sh->b_sp_for_swidth);
        }
        bs_write_se(s, sh->i_qs_delta);
    }
#endif

    if (sh->pps->b_deblocking_filter_control)
    {
        bs_write_ue(s, sh->i_disable_deblocking_filter_idc,"i_disable_deblocking_filter_idc");
        if (sh->i_disable_deblocking_filter_idc != 1)
        {
            bs_write_se(s, sh->i_alpha_c0_offset >> 1,"i_alpha_c0_offset");
            bs_write_se(s, sh->i_beta_offset >> 1,"i_beta_offset");
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq 0xf216(%rip), %rdi      # 0x28eb0
leaq 0x12df3(%rip), %rsi     # 0x2ca94
leaq 0x13050(%rip), %rdx     # 0x2ccf8
movb $0x0, %al
callq 0x4d20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %esi
leaq 0x117d8(%rip), %rdx     # 0x2b499
callq 0x1a0b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x5, %esi
leaq 0x117c9(%rip), %rdx     # 0x2b4a4
callq 0x1a0b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
leaq 0x117b9(%rip), %rdx     # 0x2b4ab
callq 0x1a0b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x18(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
leaq 0x117c1(%rip), %rcx     # 0x2b4d4
callq 0x1a1d0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jl 0x19d39
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
leaq 0x117d0(%rip), %rdx     # 0x2b504
callq 0x1a0b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x19d98
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x20(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %edx
leaq 0x117af(%rip), %rcx     # 0x2b511
callq 0x1a1d0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0xc(%rax)
je 0x19d96
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x19d96
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
leaq 0x11793(%rip), %rdx     # 0x2b524
callq 0x1a7b0
jmp 0x19dfc
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x19dfa
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x24(%rax)
jne 0x19dfa
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x34(%rax), %esi
leaq 0x11773(%rip), %rdx     # 0x2b537
callq 0x1a7b0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0xc(%rax)
je 0x19df8
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x19df8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x38(%rax), %esi
leaq 0x12f1d(%rip), %rdx     # 0x2cd10
callq 0x1a7b0
jmp 0x19dfa
jmp 0x19dfc
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x1048(%rax)
je 0x19e24
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %esi
leaq 0x11727(%rip), %rdx     # 0x2b546
callq 0x1a0b0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x19e45
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
leaq 0x1171a(%rip), %rdx     # 0x2b55a
callq 0x1a810
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x19e63
movq -0x10(%rbp), %rax
cmpl $0x3, 0x10(%rax)
je 0x19e63
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x19ec6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x44(%rax), %esi
leaq 0x116fe(%rip), %rdx     # 0x2b573
callq 0x1a810
movq -0x10(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0x19ec4
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x48(%rax), %esi
subl $0x1, %esi
leaq 0x116f1(%rip), %rdx     # 0x2b58a
callq 0x1a0b0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x19ec2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %esi
subl $0x1, %esi
leaq 0x116e5(%rip), %rdx     # 0x2b5a2
callq 0x1a0b0
jmp 0x19ec4
jmp 0x19ec6
movq -0x10(%rbp), %rax
cmpl $0x2, 0x10(%rax)
je 0x19ef4
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %esi
leaq 0x12e3a(%rip), %rdx     # 0x2cd1f
callq 0x1a810
cmpl $0x0, -0x18(%rbp)
je 0x19ef2
jmp 0x19ef2
jmp 0x19ef4
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x19f22
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x12e29(%rip), %rdx     # 0x2cd3c
callq 0x1a810
cmpl $0x0, -0x1c(%rbp)
je 0x19f20
jmp 0x19f20
jmp 0x19f22
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x102c(%rax)
je 0x19f47
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x19f62
movq -0x10(%rbp), %rax
cmpl $0x3, 0x10(%rax)
je 0x19f62
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x1, 0x1030(%rax)
jne 0x19f64
movq -0x10(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x19f64
jmp 0x19f64
cmpl $0x0, -0x14(%rbp)
je 0x19fae
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jl 0x19f9a
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0x12dd8(%rip), %rdx     # 0x2cd59
callq 0x1a810
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0x12de5(%rip), %rdx     # 0x2cd78
callq 0x1a810
jmp 0x19fac
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0x12deb(%rip), %rdx     # 0x2cd92
callq 0x1a810
jmp 0x19fae
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x8(%rax)
je 0x19fdd
movq -0x10(%rbp), %rax
cmpl $0x2, 0x10(%rax)
je 0x19fdd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x50(%rax), %esi
leaq 0x11732(%rip), %rdx     # 0x2b70a
callq 0x1a0b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x54(%rax), %esi
leaq 0x1172c(%rip), %rdx     # 0x2b71b
callq 0x1a7b0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x0, 0x1040(%rax)
je 0x1a05a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x60(%rax), %esi
leaq 0x1172a(%rip), %rdx     # 0x2b741
callq 0x1a0b0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x60(%rax)
je 0x1a058
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x64(%rax), %esi
sarl %esi
leaq 0x11727(%rip), %rdx     # 0x2b761
callq 0x1a7b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x68(%rax), %esi
sarl %esi
leaq 0x11720(%rip), %rdx     # 0x2b773
callq 0x1a7b0
jmp 0x1a05a
addq $0x20, %rsp
popq %rbp
retq