// File: /workspace/github_c_makefile_star2_O2/akumrao[P]videoAnalyzer/encoder/set.c
// Function: x264_pps_write(bs_s*, x264_pps_t*)
void x264_pps_write(bs_t *s, x264_pps_t *pps) {LOG_CALL;
    bs_write_ue(s, pps->i_id,"i_id");
    bs_write_ue(s, pps->i_sps_id,"i_sps_id");

    bs_write(s, 1, pps->b_cabac,"b_cabac");
    bs_write(s, 1, pps->b_pic_order,"b_pic_order");
    bs_write_ue(s, pps->i_num_slice_groups - 1,"i_num_slice_groups");

    if (pps->i_num_slice_groups > 1)
    {
        int i;

        bs_write_ue(s, pps->i_slice_group_map_type,"i_slice_group_map_type");
        if (pps->i_slice_group_map_type == 0)
        {
            for (i = 0; i < pps->i_num_slice_groups; i++)
            {
                bs_write_ue(s, pps->i_run_length[i] - 1,"i_run_length");
            }
        }
        else if (pps->i_slice_group_map_type == 2)
        {
            for (i = 0; i < pps->i_num_slice_groups; i++)
            {
                bs_write_ue(s, pps->i_top_left[i],"i_top_left[i]");
                bs_write_ue(s, pps->i_bottom_right[i],"i_bottom_right[i]");
            }
        }
        else if (pps->i_slice_group_map_type >= 3 &&
                pps->i_slice_group_map_type <= 5)
        {
            bs_write(s, 1, pps->b_slice_group_change_direction,"b_slice_group_change_direction");
            bs_write_ue(s, pps->b_slice_group_change_direction - 1,"b_slice_group_change_direction");
        }
        else if (pps->i_slice_group_map_type == 6)
        {
            bs_write_ue(s, pps->i_pic_size_in_map_units - 1,"i_pic_size_in_map_units");
            for (i = 0; i < pps->i_pic_size_in_map_units; i++)
            {
                /* FIXME */
                /* bs_write( s, ceil( log2( pps->i_pic_size_in_map_units +1 ) ), 
                 *              pps->i_slice_group_id[i] ); 
                 */
            }
        }
    }

    bs_write_ue(s, pps->i_num_ref_idx_l0_active - 1,"i_num_ref_idx_l0_active");
    bs_write_ue(s, pps->i_num_ref_idx_l1_active - 1,"i_num_ref_idx_l1_active");
    bs_write(s, 1, pps->b_weighted_pred,"b_weighted_pred");
    bs_write(s, 2, pps->b_weighted_bipred,"b_weighted_bipred");

    bs_write_se(s, pps->i_pic_init_qp - 26,"i_pic_init_qp");
    bs_write_se(s, pps->i_pic_init_qs - 26,"i_pic_init_qs");
    bs_write_se(s, pps->i_chroma_qp_index_offset,"i_chroma_qp_index_offset");

    bs_write(s, 1, pps->b_deblocking_filter_control,"b_deblocking_filter_control");
    bs_write(s, 1, pps->b_constrained_intra_pred,"b_constrained_intra_pred");
    bs_write(s, 1, pps->b_redundant_pic_cnt,"b_redundant_pic_cnt");

    bs_rbsp_trailing(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5029(%rip), %rdi      # 0x1b1b4
leaq 0xc40e(%rip), %rsi      # 0x225a0
leaq 0xc605(%rip), %rdx      # 0x2279e
xorl %eax, %eax
callq 0x39ba
movl (%r14), %esi
leaq 0xc489(%rip), %rdx      # 0x22633
movq %rbx, %rdi
callq 0x15f27
movl 0x4(%r14), %esi
leaq 0x8607(%rip), %rdx      # 0x1e7c4
movq %rbx, %rdi
callq 0x15f27
movl 0x8(%r14), %edx
leaq 0x85fd(%rip), %rcx      # 0x1e7cd
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15ea2
movl 0xc(%r14), %edx
leaq 0x85eb(%rip), %rcx      # 0x1e7d5
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15ea2
movl 0x10(%r14), %esi
decl %esi
leaq 0x85df(%rip), %rdx      # 0x1e7e1
movq %rbx, %rdi
callq 0x15f27
cmpl $0x2, 0x10(%r14)
jl 0x162f9
movl 0x14(%r14), %esi
leaq 0x85e6(%rip), %rdx      # 0x1e806
movq %rbx, %rdi
callq 0x15f27
movl 0x14(%r14), %eax
testl %eax, %eax
je 0x1627e
cmpl $0x2, %eax
jne 0x162a8
xorl %r13d, %r13d
leaq 0xc56e(%rip), %r15      # 0x227ad
leaq 0xc575(%rip), %r12      # 0x227bb
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x162f9
movl 0x418(%r14,%r13,4), %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15f27
movl 0x818(%r14,%r13,4), %esi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x15f27
incq %r13
jmp 0x16246
xorl %r12d, %r12d
leaq 0x8595(%rip), %r15      # 0x1e81d
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jge 0x162f9
movl 0x18(%r14,%r12,4), %esi
decl %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15f27
incq %r12
jmp 0x16288
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
ja 0x162d5
leaq 0xc18(%r14), %r12
movl 0xc18(%r14), %edx
leaq 0x857f(%rip), %r15      # 0x1e844
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r15, %rcx
callq 0x15ea2
jmp 0x162e8
cmpl $0x6, %eax
jne 0x162f9
leaq 0xc20(%r14), %r12
leaq 0x8595(%rip), %r15      # 0x1e87d
movl (%r12), %esi
decl %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x15f27
movl 0x1024(%r14), %esi
decl %esi
leaq 0x76bd(%rip), %rdx      # 0x1d9c6
movq %rbx, %rdi
callq 0x15f27
movl 0x1028(%r14), %esi
decl %esi
leaq 0x76bd(%rip), %rdx      # 0x1d9de
movq %rbx, %rdi
callq 0x15f27
movl 0x102c(%r14), %edx
leaq 0x855e(%rip), %rcx      # 0x1e895
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15ea2
movl 0x1030(%r14), %edx
leaq 0x8551(%rip), %rcx      # 0x1e8a5
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x15ea2
movl 0x1034(%r14), %esi
addl $-0x1a, %esi
leaq 0x8547(%rip), %rdx      # 0x1e8b7
movq %rbx, %rdi
callq 0x15f99
movl 0x1038(%r14), %esi
addl $-0x1a, %esi
leaq 0x853c(%rip), %rdx      # 0x1e8c5
movq %rbx, %rdi
callq 0x15f99
movl 0x103c(%r14), %esi
leaq 0x8534(%rip), %rdx      # 0x1e8d3
movq %rbx, %rdi
callq 0x15f99
movl 0x1040(%r14), %edx
leaq 0x8537(%rip), %rcx      # 0x1e8ec
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15ea2
movl 0x1044(%r14), %edx
leaq 0x853a(%rip), %rcx      # 0x1e908
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15ea2
movl 0x1048(%r14), %edx
leaq 0x853a(%rip), %rcx      # 0x1e921
movq %rbx, %rdi
movl %r15d, %esi
callq 0x15ea2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x16096