// File: /workspace/github_c_makefile_star2_O0/akumrao[P]videoAnalyzer/encoder/set.c
// Function: x264_sps_write(bs_s*, x264_sps_t*)
void x264_sps_write(bs_t *s, x264_sps_t *sps) {LOG_CALL;
    bs_write(s, 8, sps->i_profile_idc, "i_profile_idc");
    bs_write(s, 1, sps->b_constraint_set0,"b_constraint_set0");
    bs_write(s, 1, sps->b_constraint_set1,"b_constraint_set1");
    bs_write(s, 1, sps->b_constraint_set2,"b_constraint_set2");

    bs_write(s, 5, 0,"reserved"); /* reserved */

    bs_write(s, 8, sps->i_level_idc,"i_level_idc");

    bs_write_ue(s, sps->i_id,"i_id");
    bs_write_ue(s, sps->i_log2_max_frame_num - 4,"i_log2_max_frame_num");
    bs_write_ue(s, sps->i_poc_type,"i_poc_type");
    if (sps->i_poc_type == 0)
    {
        bs_write_ue(s, sps->i_log2_max_poc_lsb - 4,"i_log2_max_poc_lsb");
    }
    else if (sps->i_poc_type == 1)
    {
        int i;

        bs_write(s, 1, sps->b_delta_pic_order_always_zero,"b_delta_pic_order_always_zero");
        bs_write_se(s, sps->i_offset_for_non_ref_pic,"i_offset_for_non_ref_pic");
        bs_write_se(s, sps->i_offset_for_top_to_bottom_field,"i_offset_for_top_to_bottom_field");
        bs_write_ue(s, sps->i_num_ref_frames_in_poc_cycle,"i_num_ref_frames_in_poc_cycle");

        for (i = 0; i < sps->i_num_ref_frames_in_poc_cycle; i++)
        {
            bs_write_se(s, sps->i_offset_for_ref_frame[i],"i_offset_for_ref_frame");
        }
    }
    bs_write_ue(s, sps->i_num_ref_frames,"i_num_ref_frames");
    bs_write(s, 1, sps->b_gaps_in_frame_num_value_allowed,"b_gaps_in_frame_num_value_allowed");
    bs_write_ue(s, sps->i_mb_width - 1,"i_mb_width");
    bs_write_ue(s, sps->i_mb_height - 1,"i_mb_height");
    bs_write(s, 1, sps->b_frame_mbs_only,"b_frame_mbs_only");
    if (!sps->b_frame_mbs_only)
    {
        bs_write(s, 1, sps->b_mb_adaptive_frame_field,"b_mb_adaptive_frame_field");
    }
    bs_write(s, 1, sps->b_direct8x8_inference,"b_direct8x8_inference");

    bs_write(s, 1, sps->b_crop, "b_crop");
    if (sps->b_crop)
    {
        bs_write_ue(s, sps->crop.i_left, "crop.i_left");
        bs_write_ue(s, sps->crop.i_right, "crop.i_right");
        bs_write_ue(s, sps->crop.i_top, "crop.i_top");
        bs_write_ue(s, sps->crop.i_bottom,"crop.i_bottom");
    }

    bs_write(s, 1, sps->b_vui,"b_vui");
    if (sps->b_vui)
    {
        int i;

        static const struct
        {
            int w, h;
            int sar;
        } sar[] ={
            { 1, 1, 1},
            { 12, 11, 2},
            { 10, 11, 3},
            { 16, 11, 4},
            { 40, 33, 5},
            { 24, 11, 6},
            { 20, 11, 7},
            { 32, 11, 8},
            { 80, 33, 9},
            { 18, 11, 10},
            { 15, 11, 11},
            { 64, 33, 12},
            { 160, 99, 13},
            { 0, 0, -1}
        };
        bs_write1(s, 1,"aspect_ratio_info_present_flag"); /* aspect_ratio_info_present_flag */
        for (i = 0; sar[i].sar != -1; i++)
        {
            if (sar[i].w == sps->vui.i_sar_width && sar[i].h == sps->vui.i_sar_height)
                break;
        }
        if (sar[i].sar != -1)
        {
            bs_write(s, 8, sar[i].sar, "sar");
        }
        else
        {
            bs_write(s, 8, 255,"aspect_ration_idc (extented)"); /* aspect_ration_idc (extented) */
            bs_write(s, 16, sps->vui.i_sar_width,"vui.i_sar_width");
            bs_write(s, 16, sps->vui.i_sar_height,"vui.i_sar_height");
        }

        bs_write1(s, 0,"overscan_info_present_flag"); /* overscan_info_present_flag */

        bs_write1(s, 0,"video_signal_type_present_flag"); /* video_signal_type_present_flag */
#if 0  
        bs_write(s, 3, 5); /* unspecified video format */
        bs_write1(s, 1); /* video full range flag */
        bs_write1(s, 0); /* colour description present flag */
#endif  
        bs_write1(s, 0,"chroma_loc_info_present_flag"); /* chroma_loc_info_present_flag */
        bs_write1(s, 0,"timing_info_present_flag"); /* timing_info_present_flag */
        bs_write1(s, 0,"nal_hrd_parameters_present_flag"); /* nal_hrd_parameters_present_flag */
        bs_write1(s, 0,"vcl_hrd_parameters_present_flag"); /* vcl_hrd_parameters_present_flag */
        bs_write1(s, 0,"pic_struct_present_flag"); /* pic_struct_present_flag */
        bs_write1(s, 0,"bitstream_restriction_flag"); /* bitstream_restriction_flag */
    }

    bs_rbsp_trailing(s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x5ab9(%rip), %rdi      # 0x28eb0
leaq 0xd27a(%rip), %rsi      # 0x30678
leaq 0xd2ee(%rip), %rdx      # 0x306f3
movb $0x0, %al
callq 0x4d20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
movl $0x8, %esi
leaq 0x8afa(%rip), %rcx      # 0x2bf1d
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
movl $0x1, %esi
leaq 0x8aec(%rip), %rcx      # 0x2bf2b
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %edx
movl $0x1, %esi
leaq 0x8ae2(%rip), %rcx      # 0x2bf3d
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edx
movl $0x1, %esi
leaq 0x8ad8(%rip), %rcx      # 0x2bf4f
callq 0x23930
movq -0x8(%rbp), %rdi
movl $0x5, %esi
xorl %edx, %edx
leaq 0xd274(%rip), %rcx      # 0x30702
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
movl $0x8, %esi
leaq 0x8ab7(%rip), %rcx      # 0x2bf61
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq 0xd24b(%rip), %rdx      # 0x3070b
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
subl $0x4, %esi
leaq 0x7ffa(%rip), %rdx      # 0x2b4d4
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %esi
leaq 0x8a7c(%rip), %rdx      # 0x2bf6d
callq 0x23a20
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x2351f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
subl $0x4, %esi
leaq 0x7ffc(%rip), %rdx      # 0x2b511
callq 0x23a20
jmp 0x235cc
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jne 0x235ca
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x24(%rax), %edx
movl $0x1, %esi
leaq 0x8a34(%rip), %rcx      # 0x2bf78
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %esi
leaq 0x8a3b(%rip), %rdx      # 0x2bf96
callq 0x23ae0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %esi
leaq 0x8a3d(%rip), %rdx      # 0x2bfaf
callq 0x23ae0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %esi
leaq 0x8a47(%rip), %rdx      # 0x2bfd0
callq 0x23a20
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jge 0x235c8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0x34(%rax,%rcx,4), %esi
leaq 0x8a36(%rip), %rdx      # 0x2bfee
callq 0x23ae0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x23595
jmp 0x235ca
jmp 0x235cc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x434(%rax), %esi
leaq 0x8a24(%rip), %rdx      # 0x2c005
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x438(%rax), %edx
movl $0x1, %esi
leaq 0x8a16(%rip), %rcx      # 0x2c016
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x43c(%rax), %esi
subl $0x1, %esi
leaq 0x8a1b(%rip), %rdx      # 0x2c038
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x440(%rax), %esi
subl $0x1, %esi
leaq 0x8a09(%rip), %rdx      # 0x2c043
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x444(%rax), %edx
movl $0x1, %esi
leaq 0x89f6(%rip), %rcx      # 0x2c04f
callq 0x23930
movq -0x10(%rbp), %rax
cmpl $0x0, 0x444(%rax)
jne 0x2368a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x448(%rax), %edx
movl $0x1, %esi
leaq 0x89db(%rip), %rcx      # 0x2c060
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x44c(%rax), %edx
movl $0x1, %esi
leaq 0x89d6(%rip), %rcx      # 0x2c07a
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x450(%rax), %edx
movl $0x1, %esi
leaq 0x89cd(%rip), %rcx      # 0x2c090
callq 0x23930
movq -0x10(%rbp), %rax
cmpl $0x0, 0x450(%rax)
je 0x2373d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x454(%rax), %esi
leaq 0x89ad(%rip), %rdx      # 0x2c097
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x458(%rax), %esi
leaq 0xd00c(%rip), %rdx      # 0x30710
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x45c(%rax), %esi
leaq 0xcfff(%rip), %rdx      # 0x3071d
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x460(%rax), %esi
leaq 0x897f(%rip), %rdx      # 0x2c0b7
callq 0x23a20
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x464(%rax), %edx
movl $0x1, %esi
leaq 0x896e(%rip), %rcx      # 0x2c0c5
callq 0x23930
movq -0x10(%rbp), %rax
cmpl $0x0, 0x464(%rax)
je 0x2391d
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0xcfab(%rip), %rdx      # 0x30728
callq 0x23b40
movl $0x0, -0x18(%rbp)
movslq -0x18(%rbp), %rcx
leaq 0xd11c(%rip), %rax      # 0x308b0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x8(%rax)
je 0x237f1
movslq -0x18(%rbp), %rcx
leaq 0xd104(%rip), %rax      # 0x308b0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x468(%rcx), %eax
jne 0x237e4
movslq -0x18(%rbp), %rcx
leaq 0xd0e4(%rip), %rax      # 0x308b0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x46c(%rcx), %eax
jne 0x237e4
jmp 0x237f1
jmp 0x237e6
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x23789
movslq -0x18(%rbp), %rcx
leaq 0xd0b4(%rip), %rax      # 0x308b0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x8(%rax)
je 0x23835
movq -0x8(%rbp), %rdi
movslq -0x18(%rbp), %rcx
leaq 0xd098(%rip), %rax      # 0x308b0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movl $0x8, %esi
leaq 0x19f4(%rip), %rcx      # 0x25222
callq 0x23930
jmp 0x2388d
movq -0x8(%rbp), %rdi
movl $0x8, %esi
movl $0xff, %edx
leaq 0xcefd(%rip), %rcx      # 0x30747
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x468(%rax), %edx
movl $0x10, %esi
leaq 0xcefb(%rip), %rcx      # 0x30764
callq 0x23930
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x46c(%rax), %edx
movl $0x10, %esi
leaq 0xceec(%rip), %rcx      # 0x30774
callq 0x23930
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xceeb(%rip), %rdx      # 0x30785
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcef4(%rip), %rdx      # 0x307a0
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcf01(%rip), %rdx      # 0x307bf
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcf0c(%rip), %rdx      # 0x307dc
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcf13(%rip), %rdx      # 0x307f5
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcf21(%rip), %rdx      # 0x30815
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcf2f(%rip), %rdx      # 0x30835
callq 0x23b40
movq -0x8(%rbp), %rdi
xorl %esi, %esi
leaq 0xcf35(%rip), %rdx      # 0x3084d
callq 0x23b40
movq -0x8(%rbp), %rdi
callq 0x23c10
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)