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

    desc45_init(desc);
    desc_set_length(desc, 255);

    data_n = desc45_get_data(desc, k++);
    desc45n_set_service_id (data_n, 0x01);   // EBU teletext
    desc45n_set_data_length(data_n, 8);      // How much bytes are after this
    {
        uint8_t j, max_j = desc45n_get_data_length(data_n);
        for (j = 0; j < max_j; j++) {
            desc45n_set_field_parity(data_n, j, (j % 2) == 0);
            desc45n_set_line_offset (data_n, j, j);
        }
    }

    data_n = desc45_get_data(desc, k++);
    desc45n_set_service_id (data_n, 0x03);   // Reserved
    desc45n_set_data_length(data_n, 4);      // How much bytes are after this
    desc45n_set_byte(data_n, 0, 0x12);
    desc45n_set_byte(data_n, 1, 0x34);
    desc45n_set_byte(data_n, 2, 0x56);
    desc45n_set_byte(data_n, 3, 0x78);

    data_n = desc45_get_data(desc, k++);
    desc45n_set_service_id (data_n, 0x04);   // VPS
    desc45n_set_data_length(data_n, 1);      // How much bytes are after this
    {
        uint8_t j, max_j = desc45n_get_data_length(data_n);
        for (j = 0; j < max_j; j++) {
            desc45n_set_field_parity(data_n, j, (j % 2) == 2);
            desc45n_set_line_offset (data_n, j, j + 10);
        }
    }

    data_n = desc45_get_data(desc, k++);
    desc45n_set_service_id (data_n, 0x05);   // WSS
    desc45n_set_data_length(data_n, 4);      // How much bytes are after this
    {
        uint8_t j, max_j = desc45n_get_data_length(data_n);
        for (j = 0; j < max_j; j++) {
            desc45n_set_field_parity(data_n, j, (j % 2) == 1);
            desc45n_set_line_offset (data_n, j, j + 20);
        }
    }

    data_n = desc45_get_data(desc, k++);
    desc45n_set_service_id (data_n, 0x06);   // Closed Captioning
    desc45n_set_data_length(data_n, 0);      // How much bytes are after this

    data_n = desc45_get_data(desc, k);
    desc_set_length(desc, data_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 0x12800
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 0x3643(%rip), %rdx      # 0x12820
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x12880
movq -0x18(%rbp), %rdi
movl $0x8, %esi
callq 0x128a0
movq -0x18(%rbp), %rdi
callq 0x128c0
movb %al, -0x1a(%rbp)
movb $0x0, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
movzbl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jge 0xf265
movq -0x18(%rbp), %rdi
movb -0x19(%rbp), %cl
movzbl -0x19(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
cmpl $0x0, %edx
sete %al
movzbl %cl, %esi
movzbl %al, %edx
andl $0x1, %edx
callq 0x128e0
movq -0x18(%rbp), %rdi
movb -0x19(%rbp), %al
movzbl %al, %esi
movzbl -0x19(%rbp), %edx
callq 0x12950
movb -0x19(%rbp), %al
addb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0xf215
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x35a5(%rip), %rdx      # 0x12820
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
callq 0x12880
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x128a0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x12, %edx
callq 0x129a0
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movl $0x34, %edx
callq 0x129a0
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movl $0x56, %edx
callq 0x129a0
movq -0x18(%rbp), %rdi
movl $0x3, %esi
movl $0x78, %edx
callq 0x129a0
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x351e(%rip), %rdx      # 0x12820
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x12880
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x128a0
movq -0x18(%rbp), %rdi
callq 0x128c0
movb %al, -0x1c(%rbp)
movb $0x0, -0x1b(%rbp)
movzbl -0x1b(%rbp), %eax
movzbl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0xf390
movq -0x18(%rbp), %rdi
movb -0x1b(%rbp), %cl
movzbl -0x1b(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
cmpl $0x2, %edx
sete %al
movzbl %cl, %esi
movzbl %al, %edx
andl $0x1, %edx
callq 0x128e0
movq -0x18(%rbp), %rdi
movb -0x1b(%rbp), %cl
movzbl -0x1b(%rbp), %eax
addl $0xa, %eax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x12950
movb -0x1b(%rbp), %al
addb $0x1, %al
movb %al, -0x1b(%rbp)
jmp 0xf33a
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x347a(%rip), %rdx      # 0x12820
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x5, %esi
callq 0x12880
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x128a0
movq -0x18(%rbp), %rdi
callq 0x128c0
movb %al, -0x1e(%rbp)
movb $0x0, -0x1d(%rbp)
movzbl -0x1d(%rbp), %eax
movzbl -0x1e(%rbp), %ecx
cmpl %ecx, %eax
jge 0xf434
movq -0x18(%rbp), %rdi
movb -0x1d(%rbp), %cl
movzbl -0x1d(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
cmpl $0x1, %edx
sete %al
movzbl %cl, %esi
movzbl %al, %edx
andl $0x1, %edx
callq 0x128e0
movq -0x18(%rbp), %rdi
movb -0x1d(%rbp), %cl
movzbl -0x1d(%rbp), %eax
addl $0x14, %eax
movzbl %cl, %esi
movzbl %al, %edx
callq 0x12950
movb -0x1d(%rbp), %al
addb $0x1, %al
movb %al, -0x1d(%rbp)
jmp 0xf3de
movq -0x8(%rbp), %rdi
movb -0x9(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x9(%rbp)
leaq 0x33d6(%rip), %rdx      # 0x12820
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x6, %esi
callq 0x12880
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x128a0
movq -0x8(%rbp), %rdi
leaq 0x33a6(%rip), %rdx      # 0x12820
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)