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

    desc51_init(desc);
    desc51_set_mosaic_entry_point(desc, 1);
    desc51_set_horizontal_cells(desc, 2); // +1 == 3
    desc51_set_vertical_cells(desc, 2);   // +1 == 3 (3x3 == 9 cells)

    desc_set_length(desc, 255);
    cell_n = desc51_get_logical_cell(desc, k++);
    {
        desc51n_set_logical_cell_id(cell_n, 0);
        desc51n_set_logical_cell_presentation_info(cell_n, 1);
        desc51n_set_elementary_cell_field_length(cell_n, 3);
        {
            desc51n_set_elementary_cell_id(cell_n, 0, 0);
            desc51n_set_elementary_cell_id(cell_n, 1, 1);
            desc51n_set_elementary_cell_id(cell_n, 2, 2);
        }

        desc51n_set_cell_linkage_info(cell_n, 1); // bouquet_id
        desc51n_set_bouquet_id(cell_n, onid + 100);
    }

    cell_n = desc51_get_logical_cell(desc, k++);
    {
        desc51n_set_logical_cell_id(cell_n, 1);
        desc51n_set_logical_cell_presentation_info(cell_n, 2);
        desc51n_set_elementary_cell_field_length(cell_n, 3);
        {
            desc51n_set_elementary_cell_id(cell_n, 0, 3);
            desc51n_set_elementary_cell_id(cell_n, 1, 4);
            desc51n_set_elementary_cell_id(cell_n, 2, 5);
        }
        desc51n_set_cell_linkage_info(cell_n, 2); // 2 or 3, onid, tsid, sid
        desc51n_set_onid(cell_n, onid + 500);
        desc51n_set_tsid(cell_n, tsid + 500);
        desc51n_set_sid(cell_n, sid + 500);
    }

    cell_n = desc51_get_logical_cell(desc, k++);
    {
        desc51n_set_logical_cell_id(cell_n, 2);
        desc51n_set_logical_cell_presentation_info(cell_n, 3);
        desc51n_set_elementary_cell_field_length(cell_n, 3);
        {
            desc51n_set_elementary_cell_id(cell_n, 0, 6);
            desc51n_set_elementary_cell_id(cell_n, 1, 7);
            desc51n_set_elementary_cell_id(cell_n, 2, 8);
        }
        desc51n_set_cell_linkage_info(cell_n, 4); // onid, tsid, sid, event_id
        desc51n_set_onid(cell_n, onid + 1000);
        desc51n_set_tsid(cell_n, tsid + 1000);
        desc51n_set_sid(cell_n, sid + 1000);
        desc51n_set_event_id(cell_n, event_id + 1000);
    }

    cell_n = desc51_get_logical_cell(desc, k);
    desc_set_length(desc, cell_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 0x9bc0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9c00
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9c50
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9c90
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 0xf89(%rip), %rdx       # 0x9cc0
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x9d20
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x9d50
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0x9d80
movq -0x18(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x2, %edx
movl %edx, %esi
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x9de0
movq -0x18(%rbp), %rdi
movzwl 0x182de(%rip), %eax     # 0x2108e
addl $0x64, %eax
movzwl %ax, %esi
callq 0x9e30
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0xeef(%rip), %rdx       # 0x9cc0
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x9d20
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x9d50
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0x9d80
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movl $0x5, %edx
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x9de0
movq -0x18(%rbp), %rdi
movzwl 0x18238(%rip), %eax     # 0x2108e
addl $0x1f4, %eax            # imm = 0x1F4
movzwl %ax, %esi
callq 0x9eb0
movq -0x18(%rbp), %rdi
movzwl 0x1821a(%rip), %eax     # 0x21088
addl $0x1f4, %eax            # imm = 0x1F4
movzwl %ax, %esi
callq 0x9f40
movq -0x18(%rbp), %rdi
movzwl 0x18204(%rip), %eax     # 0x2108a
addl $0x1f4, %eax            # imm = 0x1F4
movzwl %ax, %esi
callq 0x9fd0
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0xe17(%rip), %rdx       # 0x9cc0
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0x9d20
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0x9d50
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0x9d80
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x7, %edx
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movl $0x8, %edx
callq 0x9da0
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x9de0
movq -0x18(%rbp), %rdi
movzwl 0x18160(%rip), %eax     # 0x2108e
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0x9eb0
movq -0x18(%rbp), %rdi
movzwl 0x18142(%rip), %eax     # 0x21088
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0x9f40
movq -0x18(%rbp), %rdi
movzwl 0x1812c(%rip), %eax     # 0x2108a
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0x9fd0
movq -0x18(%rbp), %rdi
movzwl 0x18116(%rip), %eax     # 0x2108c
addl $0x3e8, %eax            # imm = 0x3E8
movzwl %ax, %esi
callq 0xa060
movq -0x8(%rbp), %rdi
leaq 0xd32(%rip), %rdx       # 0x9cc0
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)