// File: /workspace/github_c_makefile_star2_O1/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 0x56d0(%rip), %rdi      # 0x251b4
leaq 0xcb65(%rip), %rsi      # 0x2c650
leaq 0xcd5c(%rip), %rdx      # 0x2c84e
xorl %eax, %eax
callq 0x4c22
movl (%r14), %esi
leaq 0xcbe0(%rip), %rdx      # 0x2c6e3
movq %rbx, %rdi
callq 0x1f862
movl 0x4(%r14), %esi
leaq 0x8d6e(%rip), %rdx      # 0x28884
movq %rbx, %rdi
callq 0x1f862
movl 0x8(%r14), %r15d
leaq 0x996f(%rip), %rdi      # 0x29498
leaq 0x8d5d(%rip), %rcx      # 0x2888d
movl $0x1, %r12d
movl $0x1, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1fb82
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r12d
movb (%rax), %cl
movl %r12d, %edx
notb %dl
andb %cl, %dl
orb %r12b, %cl
testb $0x1, %r15b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1fb82
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movl 0xc(%r14), %r15d
leaq 0x990b(%rip), %rdi      # 0x29498
leaq 0x8d01(%rip), %rcx      # 0x28895
movl $0x1, %r12d
movl $0x1, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1fbe6
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r12d
movb (%rax), %cl
movl %r12d, %edx
notb %dl
andb %cl, %dl
orb %r12b, %cl
testb $0x1, %r15b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1fbe6
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movl 0x10(%r14), %esi
decl %esi
leaq 0x8cae(%rip), %rdx      # 0x288a1
movq %rbx, %rdi
callq 0x1f862
cmpl $0x2, 0x10(%r14)
jl 0x1fd5a
movl 0x14(%r14), %esi
leaq 0x8cb5(%rip), %rdx      # 0x288c6
movq %rbx, %rdi
callq 0x1f862
movl 0x14(%r14), %eax
testl %eax, %eax
je 0x1fc7d
cmpl $0x2, %eax
jne 0x1fcb5
cmpl $0x0, 0x10(%r14)
jle 0x1fd5a
xorl %r13d, %r13d
leaq 0xcc1e(%rip), %r15      # 0x2c85d
leaq 0xcc25(%rip), %r12      # 0x2c86b
movl 0x418(%r14,%r13,4), %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1f862
movl 0x818(%r14,%r13,4), %esi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x1f862
incq %r13
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jl 0x1fc46
jmp 0x1fd5a
cmpl $0x0, 0x10(%r14)
jle 0x1fd5a
xorl %r12d, %r12d
leaq 0x8c4b(%rip), %r15      # 0x288dd
movl 0x18(%r14,%r12,4), %esi
decl %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1f862
incq %r12
movslq 0x10(%r14), %rax
cmpq %rax, %r12
jl 0x1fc92
jmp 0x1fd5a
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
ja 0x1fd38
leaq 0xc18(%r14), %rax
movq %rax, -0x30(%rbp)
movl 0xc18(%r14), %r12d
leaq 0x97c2(%rip), %rdi      # 0x29498
leaq 0x8c27(%rip), %r15      # 0x28904
movl $0x1, %r13d
movl $0x1, %esi
movl %r12d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1fd32
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r13d
movb (%rax), %cl
movl %r13d, %edx
notb %dl
andb %cl, %dl
orb %r13b, %cl
testb $0x1, %r12b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1fd32
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movq -0x30(%rbp), %rax
jmp 0x1fd4b
cmpl $0x6, %eax
jne 0x1fd5a
leaq 0xc20(%r14), %rax
leaq 0x8bf2(%rip), %r15      # 0x2893d
movl (%rax), %esi
decl %esi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1f862
movl 0x1024(%r14), %esi
decl %esi
leaq 0x7d0c(%rip), %rdx      # 0x27a76
movq %rbx, %rdi
callq 0x1f862
movl 0x1028(%r14), %esi
decl %esi
leaq 0x7d0c(%rip), %rdx      # 0x27a8e
movq %rbx, %rdi
callq 0x1f862
movl 0x102c(%r14), %r15d
leaq 0x9700(%rip), %rdi      # 0x29498
leaq 0x8bb6(%rip), %rcx      # 0x28955
movl $0x1, %r12d
movl $0x1, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1fdf1
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r12d
movb (%rax), %cl
movl %r12d, %edx
notb %dl
andb %cl, %dl
orb %r12b, %cl
testb $0x1, %r15b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1fdf1
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movl 0x1030(%r14), %r15d
leaq 0x9699(%rip), %rdi      # 0x29498
leaq 0x8b5f(%rip), %rcx      # 0x28965
movl $0x2, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4c22
movl $0x3, %eax
movq 0x8(%rbx), %rdx
cmpq 0x10(%rbx), %rdx
jae 0x1fe6e
movb 0x18(%rbx), %cl
decb %cl
movl $0x1, %esi
shll %cl, %esi
leal -0x2(%rax), %ecx
movzbl %cl, %ecx
movb (%rdx), %dil
movl %esi, %r8d
notb %r8b
andb %dil, %r8b
orb %sil, %dil
btl %ecx, %r15d
movzbl %dil, %ecx
movzbl %r8b, %esi
cmovbl %ecx, %esi
movb %sil, (%rdx)
decl 0x18(%rbx)
jne 0x1fe67
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
decl %eax
cmpl $0x1, %eax
ja 0x1fe1a
movl 0x1034(%r14), %esi
addl $-0x1a, %esi
leaq 0x8af8(%rip), %rdx      # 0x28977
movq %rbx, %rdi
callq 0x1f94b
movl 0x1038(%r14), %esi
addl $-0x1a, %esi
leaq 0x8aed(%rip), %rdx      # 0x28985
movq %rbx, %rdi
callq 0x1f94b
movl 0x103c(%r14), %esi
leaq 0x8ae5(%rip), %rdx      # 0x28993
movq %rbx, %rdi
callq 0x1f94b
movl 0x1040(%r14), %r15d
leaq 0x95d4(%rip), %rdi      # 0x29498
leaq 0x8ae1(%rip), %rcx      # 0x289ac
movl $0x1, %r12d
movl $0x1, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1ff1d
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r12d
movb (%rax), %cl
movl %r12d, %edx
notb %dl
andb %cl, %dl
orb %r12b, %cl
testb $0x1, %r15b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1ff1d
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movl 0x1044(%r14), %r15d
leaq 0x956d(%rip), %rdi      # 0x29498
leaq 0x8a96(%rip), %rcx      # 0x289c8
movl $0x1, %r12d
movl $0x1, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1ff84
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r12d
movb (%rax), %cl
movl %r12d, %edx
notb %dl
andb %cl, %dl
orb %r12b, %cl
testb $0x1, %r15b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1ff84
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movl 0x1048(%r14), %r14d
leaq 0x9506(%rip), %rdi      # 0x29498
leaq 0x8a48(%rip), %rcx      # 0x289e1
movl $0x1, %r15d
movl $0x1, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x1ffeb
movb 0x18(%rbx), %cl
decb %cl
shll %cl, %r15d
movb (%rax), %cl
movl %r15d, %edx
notb %dl
andb %cl, %dl
orb %r15b, %cl
testb $0x1, %r14b
movzbl %cl, %ecx
movzbl %dl, %edx
cmovnel %ecx, %edx
movb %dl, (%rax)
decl 0x18(%rbx)
jne 0x1ffeb
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
leaq 0x51c2(%rip), %rdi      # 0x251b4
leaq 0x90e3(%rip), %rsi      # 0x290dc
leaq 0x94ae(%rip), %rdx      # 0x294ae
xorl %eax, %eax
callq 0x4c22
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jae 0x2002f
movb 0x18(%rbx), %cl
decb %cl
movl $0x1, %edx
shll %cl, %edx
orb %dl, (%rax)
decl 0x18(%rbx)
jne 0x2002f
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
movl 0x18(%rbx), %eax
cmpl $0x8, %eax
sete %cl
testl %eax, %eax
setle %dl
orb %cl, %dl
jne 0x20076
incl %eax
movq 0x8(%rbx), %rdx
cmpq 0x10(%rbx), %rdx
jae 0x20076
movb 0x18(%rbx), %cl
decb %cl
movl $0x1, %esi
shll %cl, %esi
notb %sil
andb %sil, (%rdx)
decl 0x18(%rbx)
jne 0x2006f
incq 0x8(%rbx)
movl $0x8, 0x18(%rbx)
decl %eax
cmpl $0x1, %eax
jg 0x20043
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq