// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_gen_si.c
// Function: build_desc6e
static void build_desc6e(uint8_t *desc) {
    desc6e_init(desc);

    desc6e_set_emergency_alarm_flag         (desc, true);
    desc6e_set_road_traffic_flash_flag      (desc, false);
    desc6e_set_public_transport_flash_flag  (desc, true);
    desc6e_set_warning_message_flag         (desc, true);
    desc6e_set_news_flash_flag              (desc, true);
    desc6e_set_weather_flash_flag           (desc, true);
    desc6e_set_event_announcement_flag      (desc, false);
    desc6e_set_personal_call_flag           (desc, false);

    {
        uint8_t n = 0;
        uint8_t *ann_n;
        desc_set_length(desc, 255);

        ann_n = desc6e_get_announcement(desc, n++);
        desc6en_set_announcement_type(ann_n, 0); // Emergency alarm
        desc6en_set_reference_type(ann_n, 0);

        ann_n = desc6e_get_announcement(desc, n++);
        desc6en_set_announcement_type(ann_n, 3); // Warning alarm
        desc6en_set_reference_type(ann_n, 1);

        // The following are valid only if
        //  reference_type == 0x01
        //  || reference_type == 0x02
        //  || reference_type == 0x03
        //
        desc6en_set_onid(ann_n, 0x1122);
        desc6en_set_tsid(ann_n, 0x3344);
        desc6en_set_service_id(ann_n, 0x5566);
        desc6en_set_component_tag(ann_n, 0x77);

        ann_n = desc6e_get_announcement(desc, n++);
        desc6en_set_announcement_type(ann_n, 5); // Weather flash
        desc6en_set_reference_type(ann_n, 0);

        ann_n = desc6e_get_announcement(desc, n++);
        desc6en_set_announcement_type(ann_n, 2); // Public Transport flash
        desc6en_set_reference_type(ann_n, 3);

        // The following are valid only if
        //  reference_type == 0x01
        //  || reference_type == 0x02
        //  || reference_type == 0x03
        //
        desc6en_set_onid(ann_n, 0x6677);
        desc6en_set_tsid(ann_n, 0x8899);
        desc6en_set_service_id(ann_n, 0x4455);
        desc6en_set_component_tag(ann_n, 0x88);

        ann_n = desc6e_get_announcement(desc, n++);
        desc6en_set_announcement_type(ann_n, 4); // News flash
        desc6en_set_reference_type(ann_n, 0);

        ann_n = desc6e_get_announcement(desc, n);
        desc_set_length(desc, ann_n - desc - DESC_HEADER_SIZE);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa8d0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xa910
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xa960
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xa9b0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xaa00
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xaa50
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xaaa0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xaaf0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xab40
movb $0x0, -0x9(%rbp)
movq -0x8(%rbp), %rdi
movl $0xff, %esi
callq 0x5ca0
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x177c(%rip), %rdx      # 0xab90
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xabf0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xac30
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x1744(%rip), %rdx      # 0xab90
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0xabf0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xac30
movq -0x18(%rbp), %rdi
movl $0x1122, %esi           # imm = 0x1122
callq 0xac60
movq -0x18(%rbp), %rdi
movl $0x3344, %esi           # imm = 0x3344
callq 0xacd0
movq -0x18(%rbp), %rdi
movl $0x5566, %esi           # imm = 0x5566
callq 0xad40
movq -0x18(%rbp), %rdi
movl $0x77, %esi
callq 0xadb0
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x16ce(%rip), %rdx      # 0xab90
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x5, %esi
callq 0xabf0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xac30
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x1693(%rip), %rdx      # 0xab90
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0xabf0
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0xac30
movq -0x18(%rbp), %rdi
movl $0x6677, %esi           # imm = 0x6677
callq 0xac60
movq -0x18(%rbp), %rdi
movl $0x8899, %esi           # imm = 0x8899
callq 0xacd0
movq -0x18(%rbp), %rdi
movl $0x4455, %esi           # imm = 0x4455
callq 0xad40
movq -0x18(%rbp), %rdi
movl $0x88, %esi
callq 0xadb0
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x161d(%rip), %rdx      # 0xab90
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0xabf0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xac30
movq -0x8(%rbp), %rdi
leaq 0x15ed(%rip), %rdx      # 0xab90
movzbl -0x9(%rbp), %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
subq $0x2, %rax
movzbl %al, %esi
callq 0x5ca0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)