// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_gen_si.c
// Function: build_desc4a_extended_event
static void build_desc4a_extended_event(uint8_t *desc) {
    uint8_t k = 0;
    uint8_t *ext_n;

    desc4a_init(desc);
    desc4a_set_tsid(desc, tsid + 800);
    desc4a_set_onid(desc, onid + 800);
    desc4a_set_sid (desc, sid + 800);
    // extended event linkage
    desc4a_set_linkage(desc, DESC4A_LINKAGE_EXT_EVENT);

    desc_set_length(desc, 255);

    ext_n = desc4a_get_ext_event(desc, k++);
    desc4an_set_ext_event_target_event_id(ext_n, event_id + 1000);
    desc4an_set_ext_event_target_listed  (ext_n, false);
    desc4an_set_ext_event_simulcast      (ext_n, true);
    desc4an_set_ext_event_link_type      (ext_n, 1); // HD
    desc4an_set_ext_event_target_id_type (ext_n, 3); // user defined id
    desc4an_set_ext_event_onid_id_flag   (ext_n, true);
    desc4an_set_ext_event_service_id_flag(ext_n, true);
    desc4an_set_ext_event_user_defined_id(ext_n, 7878);
    desc4an_set_ext_event_target_tsid    (ext_n, tsid + 1000);  // !!!
    desc4an_set_ext_event_target_onid    (ext_n, onid + 1000);  // !!!
    desc4an_set_ext_event_service_id     (ext_n, sid + 1000);   // !!!

    ext_n = desc4a_get_ext_event(desc, k++);
    desc4an_set_ext_event_target_event_id(ext_n, event_id + 2000);
    desc4an_set_ext_event_target_listed  (ext_n, true);
    desc4an_set_ext_event_simulcast      (ext_n, true);
    desc4an_set_ext_event_link_type      (ext_n, 0); // SD
    desc4an_set_ext_event_target_id_type (ext_n, 0); // onid_id_flag, target_service_id_flag
    desc4an_set_ext_event_onid_id_flag   (ext_n, true);
    desc4an_set_ext_event_service_id_flag(ext_n, true);
    desc4an_set_ext_event_user_defined_id(ext_n, 8787);         // !!!
    desc4an_set_ext_event_target_tsid    (ext_n, tsid + 2000);  // !!!
    desc4an_set_ext_event_target_onid    (ext_n, onid + 2000);
    desc4an_set_ext_event_service_id     (ext_n, sid + 2000);

    ext_n = desc4a_get_ext_event(desc, k++);
    desc4an_set_ext_event_target_event_id(ext_n, event_id + 3000);
    desc4an_set_ext_event_target_listed  (ext_n, true);
    desc4an_set_ext_event_simulcast      (ext_n, true);
    desc4an_set_ext_event_link_type      (ext_n, 2); // 3D
    desc4an_set_ext_event_target_id_type (ext_n, 1); // target_tsid, onid_id_flag, target_service_id_flag
    desc4an_set_ext_event_onid_id_flag   (ext_n, true);
    desc4an_set_ext_event_service_id_flag(ext_n, true);
    desc4an_set_ext_event_user_defined_id(ext_n, 8787);         // !!!
    desc4an_set_ext_event_target_tsid    (ext_n, tsid + 3000);
    desc4an_set_ext_event_target_onid    (ext_n, onid + 3000);
    desc4an_set_ext_event_service_id     (ext_n, sid + 3000);

    ext_n = desc4a_get_ext_event(desc, k++);
    desc4an_set_ext_event_target_event_id(ext_n, event_id + 4000);
    desc4an_set_ext_event_target_listed  (ext_n, false);
    desc4an_set_ext_event_simulcast      (ext_n, false);
    desc4an_set_ext_event_link_type      (ext_n, 0); // SD
    desc4an_set_ext_event_target_id_type (ext_n, 0); // onid_id_flag, target_service_id_flag
    desc4an_set_ext_event_onid_id_flag   (ext_n, false);
    desc4an_set_ext_event_service_id_flag(ext_n, false);
    desc4an_set_ext_event_user_defined_id(ext_n, 8787);         // !!!
    desc4an_set_ext_event_target_tsid    (ext_n, tsid + 4000);  // !!!
    desc4an_set_ext_event_target_onid    (ext_n, onid + 4000);  // !!!
    desc4an_set_ext_event_service_id     (ext_n, sid + 4000);   // !!!

    ext_n = desc4a_get_ext_event(desc, k);
    desc_set_length(desc, ext_n - desc - DESC_HEADER_SIZE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8240
movq -0x8(%rbp), %rdi
movzwl 0x15344(%rip), %eax     # 0x21088
addl $0x320, %eax            # imm = 0x320
movzwl %ax, %esi
callq 0x8270
movq -0x8(%rbp), %rdi
movzwl 0x15332(%rip), %eax     # 0x2108e
addl $0x320, %eax            # imm = 0x320
movzwl %ax, %esi
callq 0x82b0
movq -0x8(%rbp), %rdi
movzwl 0x15316(%rip), %eax     # 0x2108a
addl $0x320, %eax            # imm = 0x320
movzwl %ax, %esi
callq 0x82f0
movq -0x8(%rbp), %rdi
movl $0xe, %esi
callq 0x8330
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 0xfcd(%rip), %rdx       # 0xcd80
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movzwl 0x152c2(%rip), %eax     # 0x2108c
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0xcde0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xce20
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xce70
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcec0
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0xcf00
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf40
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf90
movq -0x18(%rbp), %rdi
movl $0x1ec6, %esi           # imm = 0x1EC6
callq 0xcfe0
movq -0x18(%rbp), %rdi
movzwl 0x15247(%rip), %eax     # 0x21088
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0xd030
movq -0x18(%rbp), %rdi
movzwl 0x15235(%rip), %eax     # 0x2108e
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0xd080
movq -0x18(%rbp), %rdi
movzwl 0x15219(%rip), %eax     # 0x2108a
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0xd120
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0xeec(%rip), %rdx       # 0xcd80
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movzwl 0x151e1(%rip), %eax     # 0x2108c
addl $0x7d0, %eax            # imm = 0x7D0
movzwl %ax, %esi
callq 0xcde0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xce20
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xce70
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xcec0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xcf00
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf40
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf90
movq -0x18(%rbp), %rdi
movl $0x2253, %esi           # imm = 0x2253
callq 0xcfe0
movq -0x18(%rbp), %rdi
movzwl 0x15169(%rip), %eax     # 0x21088
addl $0x7d0, %eax            # imm = 0x7D0
movzwl %ax, %esi
callq 0xd030
movq -0x18(%rbp), %rdi
movzwl 0x15157(%rip), %eax     # 0x2108e
addl $0x7d0, %eax            # imm = 0x7D0
movzwl %ax, %esi
callq 0xd080
movq -0x18(%rbp), %rdi
movzwl 0x1513b(%rip), %eax     # 0x2108a
addl $0x7d0, %eax            # imm = 0x7D0
movzwl %ax, %esi
callq 0xd120
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0xe0e(%rip), %rdx       # 0xcd80
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movzwl 0x15103(%rip), %eax     # 0x2108c
addl $0xbb8, %eax            # imm = 0xBB8
movzwl %ax, %esi
callq 0xcde0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xce20
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xce70
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0xcec0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf00
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf40
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0xcf90
movq -0x18(%rbp), %rdi
movl $0x2253, %esi           # imm = 0x2253
callq 0xcfe0
movq -0x18(%rbp), %rdi
movzwl 0x15085(%rip), %eax     # 0x21088
addl $0xbb8, %eax            # imm = 0xBB8
movzwl %ax, %esi
callq 0xd030
movq -0x18(%rbp), %rdi
movzwl 0x15073(%rip), %eax     # 0x2108e
addl $0xbb8, %eax            # imm = 0xBB8
movzwl %ax, %esi
callq 0xd080
movq -0x18(%rbp), %rdi
movzwl 0x15057(%rip), %eax     # 0x2108a
addl $0xbb8, %eax            # imm = 0xBB8
movzwl %ax, %esi
callq 0xd120
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0xd2a(%rip), %rdx       # 0xcd80
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movzwl 0x1501f(%rip), %eax     # 0x2108c
addl $0xfa0, %eax            # imm = 0xFA0
movzwl %ax, %esi
callq 0xcde0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xce20
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xce70
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xcec0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xcf00
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xcf40
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xcf90
movq -0x18(%rbp), %rdi
movl $0x2253, %esi           # imm = 0x2253
callq 0xcfe0
movq -0x18(%rbp), %rdi
movzwl 0x14fb3(%rip), %eax     # 0x21088
addl $0xfa0, %eax            # imm = 0xFA0
movzwl %ax, %esi
callq 0xd030
movq -0x18(%rbp), %rdi
movzwl 0x14fa1(%rip), %eax     # 0x2108e
addl $0xfa0, %eax            # imm = 0xFA0
movzwl %ax, %esi
callq 0xd080
movq -0x18(%rbp), %rdi
movzwl 0x14f85(%rip), %eax     # 0x2108a
addl $0xfa0, %eax            # imm = 0xFA0
movzwl %ax, %esi
callq 0xd120
movq -0x8(%rbp), %rdi
leaq 0xc63(%rip), %rdx       # 0xcd80
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
nopl (%rax,%rax)