// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_gen_si.c
// Function: generate_sdt
static void generate_sdt(void) {
    uint8_t *sdt = psi_allocate();
    uint8_t *desc_loop, *desc;
    uint8_t desc_counter;

    // Generate empty SDT
    sdt_init(sdt, true);
    psi_set_version(sdt, 0);
    psi_set_current(sdt);
    sdt_set_tsid(sdt, tsid);
    sdt_set_onid(sdt, onid);
    sdt_set_length(sdt, 0);
    psi_set_crc(sdt);
    output_psi_section(sdt, SDT_PID, &cc);

    // Add service descriptions
    sdt_init(sdt, true);
    psi_set_version(sdt, 1);
    psi_set_current(sdt);
    sdt_set_tsid(sdt, tsid);
    sdt_set_onid(sdt, onid);

    // Process transport stream loop
    sdt_set_length(sdt, PSI_MAX_SIZE); // This needed so sdt_get_ts works
    {
        uint8_t *sdt_n;
        uint8_t sdt_n_counter = 0;

        sdt_n = sdt_get_service(sdt, sdt_n_counter++);
        sdtn_init(sdt_n);
        sdtn_set_sid(sdt_n, sid);
        sdtn_set_running(sdt_n, 2);
        sdtn_set_desclength(sdt_n, 0);
        {
            // Add descriptors to transport_stream_n
            desc_counter = 0;
            desc_loop = sdtn_get_descs(sdt_n);
            descs_set_length(desc_loop, DESCS_MAX_SIZE); // This is needed so descs_get_desc(x, n) works

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc48(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc49(desc, true);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc51(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc57(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc5d(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc5f(desc);

            // Finish descriptor generation
            desc = descs_get_desc(desc_loop, desc_counter); // Get next descriptor pos
            descs_set_length(desc_loop, desc - desc_loop - DESCS_HEADER_SIZE);
        }

        sdt_n = sdt_get_service(sdt, sdt_n_counter++);
        sdtn_init(sdt_n);
        sdtn_set_sid(sdt_n, sid + 100);
        sdtn_set_eitschedule(sdt_n);
        sdtn_set_running(sdt_n, 1);
        sdtn_set_desclength(sdt_n, 0);
        {
            // Add descriptors to transport_stream_n
            desc_counter = 0;
            desc_loop = sdtn_get_descs(sdt_n);
            descs_set_length(desc_loop, DESCS_MAX_SIZE); // This is needed so descs_get_desc(x, n) works

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc48(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc49(desc, false);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc5f(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc6e(desc);

            // Finish descriptor generation
            desc = descs_get_desc(desc_loop, desc_counter); // Get next descriptor pos
            descs_set_length(desc_loop, desc - desc_loop - DESCS_HEADER_SIZE);
        }

        sdt_n = sdt_get_service(sdt, sdt_n_counter++);
        sdtn_init(sdt_n);
        sdtn_set_sid(sdt_n, sid + 200);
        sdtn_set_eitschedule(sdt_n);
        sdtn_set_eitpresent(sdt_n);
        sdtn_set_running(sdt_n, 3);
        sdtn_set_desclength(sdt_n, 0);
        {
            // Add descriptors to transport_stream_n
            desc_counter = 0;
            desc_loop = sdtn_get_descs(sdt_n);
            descs_set_length(desc_loop, DESCS_MAX_SIZE); // This is needed so descs_get_desc(x, n) works

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc48(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc4c(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc5f(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc64(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc66(desc);

            // Finish descriptor generation
            desc = descs_get_desc(desc_loop, desc_counter); // Get next descriptor pos
            descs_set_length(desc_loop, desc - desc_loop - DESCS_HEADER_SIZE);
        }

        sdt_n = sdt_get_service(sdt, sdt_n_counter++);
        sdtn_init(sdt_n);
        sdtn_set_sid(sdt_n, sid + 300);
        sdtn_set_eitschedule(sdt_n);
        sdtn_set_eitpresent(sdt_n);
        sdtn_set_running(sdt_n, 2);
        sdtn_set_ca(sdt_n);
        sdtn_set_desclength(sdt_n, 0);
        {
            // Add descriptors to transport_stream_n
            desc_counter = 0;
            desc_loop = sdtn_get_descs(sdt_n);
            descs_set_length(desc_loop, DESCS_MAX_SIZE); // This is needed so descs_get_desc(x, n) works

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc48(desc);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc4b(desc, false);

            desc = descs_get_desc(desc_loop, desc_counter++);
            build_desc5f(desc);

            // Finish descriptor generation
            desc = descs_get_desc(desc_loop, desc_counter); // Get next descriptor pos
            descs_set_length(desc_loop, desc - desc_loop - DESCS_HEADER_SIZE);
        }

        // Set transport_stream_loop length
        sdt_n = sdt_get_service(sdt, sdt_n_counter); // Get last service
        sdt_set_length(sdt, sdt_n - sdt_get_service(sdt, 0));
    }
    psi_set_crc(sdt);
    output_psi_section(sdt, SDT_PID, &cc);

    free(sdt);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
callq 0x4f30
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x8890
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x4ff0
movq -0x8(%rbp), %rdi
callq 0x5020
movq -0x8(%rbp), %rdi
movzwl 0x1ebba(%rip), %esi     # 0x21088
callq 0x4fb0
movq -0x8(%rbp), %rdi
movzwl 0x1ebb0(%rip), %esi     # 0x2108e
callq 0x88e0
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x8920
movq -0x8(%rbp), %rdi
callq 0x5080
movq -0x8(%rbp), %rdi
movl $0x11, %esi
leaq 0x1ebb2(%rip), %rdx     # 0x210b9
callq 0x5170
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x8890
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x4ff0
movq -0x8(%rbp), %rdi
callq 0x5020
movq -0x8(%rbp), %rdi
movzwl 0x1eb4c(%rip), %esi     # 0x21088
callq 0x4fb0
movq -0x8(%rbp), %rdi
movzwl 0x1eb42(%rip), %esi     # 0x2108e
callq 0x88e0
movq -0x8(%rbp), %rdi
movl $0x3fd, %esi            # imm = 0x3FD
callq 0x8920
movb $0x0, -0x29(%rbp)
movq -0x8(%rbp), %rdi
movb -0x29(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x29(%rbp)
movzbl %al, %esi
callq 0x8950
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8a10
movq -0x28(%rbp), %rdi
movzwl 0x1eaf8(%rip), %esi     # 0x2108a
callq 0x8a30
movq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x8a70
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x8ab0
movb $0x0, -0x19(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8b00
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x5970
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x344b(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8b20
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x3420(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %esi
callq 0x8bc0
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x33f0(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8cd0
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x33c5(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8fc0
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x339a(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9110
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x336f(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9320
movq -0x10(%rbp), %rdi
leaq 0x334f(%rip), %rdx      # 0x5a30
movzbl -0x19(%rbp), %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
subq $0x2, %rax
movzwl %ax, %esi
callq 0x5970
movq -0x8(%rbp), %rdi
movb -0x29(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x29(%rbp)
movzbl %al, %esi
callq 0x8950
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8a10
movq -0x28(%rbp), %rdi
movzwl 0x1e952(%rip), %eax     # 0x2108a
addl $0x64, %eax
movzwl %ax, %esi
callq 0x8a30
movq -0x28(%rbp), %rdi
callq 0x9350
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x8a70
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x8ab0
movb $0x0, -0x19(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8b00
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x5970
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x3296(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8b20
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x326b(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x8bc0
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x323e(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9320
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x3213(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9370
movq -0x10(%rbp), %rdi
leaq 0x31f3(%rip), %rdx      # 0x5a30
movzbl -0x19(%rbp), %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
subq $0x2, %rax
movzwl %ax, %esi
callq 0x5970
movq -0x8(%rbp), %rdi
movb -0x29(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x29(%rbp)
movzbl %al, %esi
callq 0x8950
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8a10
movq -0x28(%rbp), %rdi
movzwl 0x1e7f6(%rip), %eax     # 0x2108a
addl $0xc8, %eax
movzwl %ax, %esi
callq 0x8a30
movq -0x28(%rbp), %rdi
callq 0x9350
movq -0x28(%rbp), %rdi
callq 0x95e0
movq -0x28(%rbp), %rdi
movl $0x3, %esi
callq 0x8a70
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x8ab0
movb $0x0, -0x19(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8b00
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x5970
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x312f(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8b20
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x3104(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9600
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x30d9(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9320
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x30ae(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9640
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x3083(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9700
movq -0x10(%rbp), %rdi
leaq 0x3063(%rip), %rdx      # 0x5a30
movzbl -0x19(%rbp), %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
subq $0x2, %rax
movzwl %ax, %esi
callq 0x5970
movq -0x8(%rbp), %rdi
movb -0x29(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x29(%rbp)
movzbl %al, %esi
callq 0x8950
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8a10
movq -0x28(%rbp), %rdi
movzwl 0x1e666(%rip), %eax     # 0x2108a
addl $0x12c, %eax            # imm = 0x12C
movzwl %ax, %esi
callq 0x8a30
movq -0x28(%rbp), %rdi
callq 0x9350
movq -0x28(%rbp), %rdi
callq 0x95e0
movq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x8a70
movq -0x28(%rbp), %rdi
callq 0x9760
movq -0x28(%rbp), %rdi
xorl %esi, %esi
callq 0x8ab0
movb $0x0, -0x19(%rbp)
movq -0x28(%rbp), %rdi
callq 0x8b00
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x5970
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x2f96(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8b20
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x2f6b(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x9780
movq -0x10(%rbp), %rdi
movb -0x19(%rbp), %al
movb %al, %cl
addb $0x1, %cl
movb %cl, -0x19(%rbp)
leaq 0x2f3e(%rip), %rdx      # 0x5a30
movzbl %al, %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9320
movq -0x10(%rbp), %rdi
leaq 0x2f1e(%rip), %rdx      # 0x5a30
movzbl -0x19(%rbp), %esi
callq 0x59c0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
subq $0x2, %rax
movzwl %ax, %esi
callq 0x5970
movq -0x8(%rbp), %rdi
movzbl -0x29(%rbp), %esi
callq 0x8950
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x8950
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movzwl %ax, %esi
callq 0x8920
movq -0x8(%rbp), %rdi
callq 0x5080
movq -0x8(%rbp), %rdi
movl $0x11, %esi
leaq 0x1e524(%rip), %rdx     # 0x210b9
callq 0x5170
movq -0x8(%rbp), %rdi
callq 0x1030
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)