// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/dvb_print_si.c
// Function: handle_eit_section
static void handle_eit_section(uint16_t i_pid, uint8_t *p_section)
{
    uint16_t i_sid;
    uint8_t i_section;
    sid_t *p_sid;
    int i;

    if (i_pid != EIT_PID || !eit_validate(p_section)) {
        switch (i_print_type) {
        case PRINT_XML:
            printf("<ERROR type=\"invalid_eit_section\" pid=\"%hu\"/>\n",
                   i_pid);
            break;
        default:
            printf("invalid EIT section received on PID %hu\n", i_pid);
        }
        free(p_section);
        return;
    }

    i_sid = psi_get_tableidext(p_section);
    for (i = 0; i < i_nb_sids; i++)
        if (pp_sids[i]->i_sid && pp_sids[i]->i_sid == i_sid)
            break;
    if (i == i_nb_sids) {
        switch (i_print_type) {
        case PRINT_XML:
            printf("<ERROR type=\"ghost_eit\" sid=\"%hu\"/>\n", i_sid);
            break;
        default:
            printf("ghost EIT for service %hu\n", i_sid);
        }
        p_sid = malloc(sizeof(sid_t));
        pp_sids = realloc(pp_sids, ++i_nb_sids * sizeof(sid_t *));
        pp_sids[i] = p_sid;
        p_sid->i_sid = i_sid;
        p_sid->i_pmt_pid = 0;
        p_sid->p_current_pmt = NULL;
        psi_table_init(p_sid->pp_eit_sections);
    } else
        p_sid = pp_sids[i];

    /* We do not use psi_table_* primitives as the spec allows for holes in
     * section numbering, and there is no sure way to know whether you have
     * gathered all sections. */
    i_section = psi_get_section(p_section);
    if (p_sid->pp_eit_sections[i_section] != NULL &&
        psi_compare(p_sid->pp_eit_sections[i_section], p_section)) {
        /* Identical section. Shortcut. */
        free(p_section);
        return;
    }

    free(p_sid->pp_eit_sections[i_section]);
    p_sid->pp_eit_sections[i_section] = p_section;

    if (pb_print_table[TABLE_EIT])
        eit_print(p_section, print_wrapper, NULL, iconv_wrapper, NULL,
                  i_print_type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movq %rsi, -0x10(%rbp)
movzwl -0x2(%rbp), %eax
cmpl $0x12, %eax
jne 0x4019
movq -0x10(%rbp), %rdi
callq 0x1f9d0
testb $0x1, %al
jne 0x405a
movl 0x342d1(%rip), %eax     # 0x382f0
subl $0x1, %eax
jne 0x403a
jmp 0x4026
movzwl -0x2(%rbp), %esi
leaq 0x278a3(%rip), %rdi     # 0x2b8d4
movb $0x0, %al
callq 0x20b0
jmp 0x404c
movzwl -0x2(%rbp), %esi
leaq 0x278be(%rip), %rdi     # 0x2b903
movb $0x0, %al
callq 0x20b0
movq -0x10(%rbp), %rdi
callq 0x2030
jmp 0x421d
movq -0x10(%rbp), %rdi
callq 0x4b90
movw %ax, -0x12(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0x692a9(%rip), %eax     # 0x6d320
jge 0x40b9
movq 0x692a8(%rip), %rax     # 0x6d328
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzwl (%rax), %eax
cmpl $0x0, %eax
je 0x40ac
movq 0x69291(%rip), %rax     # 0x6d328
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzwl (%rax), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jne 0x40ac
jmp 0x40b9
jmp 0x40ae
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x406e
movl -0x24(%rbp), %eax
cmpl 0x6925e(%rip), %eax     # 0x6d320
jne 0x4175
movl 0x34222(%rip), %eax     # 0x382f0
subl $0x1, %eax
jne 0x40e9
jmp 0x40d5
movzwl -0x12(%rbp), %esi
leaq 0x2784c(%rip), %rdi     # 0x2b92c
movb $0x0, %al
callq 0x20b0
jmp 0x40fb
movzwl -0x12(%rbp), %esi
leaq 0x2785d(%rip), %rdi     # 0x2b951
movb $0x0, %al
callq 0x20b0
movl $0x810, %edi            # imm = 0x810
callq 0x2150
movq %rax, -0x20(%rbp)
movq 0x69218(%rip), %rdi     # 0x6d328
movl 0x6920a(%rip), %eax     # 0x6d320
addl $0x1, %eax
movl %eax, 0x69201(%rip)     # 0x6d320
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x2180
movq %rax, 0x691f6(%rip)     # 0x6d328
movq -0x20(%rbp), %rdx
movq 0x691eb(%rip), %rax     # 0x6d328
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movw -0x12(%rbp), %cx
movq -0x20(%rbp), %rax
movw %cx, (%rax)
movq -0x20(%rbp), %rax
movw $0x0, 0x2(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x2bb0
jmp 0x4188
movq 0x691ac(%rip), %rax     # 0x6d328
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4b30
movb %al, -0x13(%rbp)
movq -0x20(%rbp), %rax
movzbl -0x13(%rbp), %ecx
cmpq $0x0, 0x10(%rax,%rcx,8)
je 0x41cb
movq -0x20(%rbp), %rax
movzbl -0x13(%rbp), %ecx
movq 0x10(%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
callq 0x53d0
testb $0x1, %al
jne 0x41c0
jmp 0x41cb
movq -0x10(%rbp), %rdi
callq 0x2030
jmp 0x421d
movq -0x20(%rbp), %rax
movzbl -0x13(%rbp), %ecx
movq 0x10(%rax,%rcx,8), %rdi
callq 0x2030
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rax
movzbl -0x13(%rbp), %ecx
movq %rdx, 0x10(%rax,%rcx,8)
testb $0x1, 0x69111(%rip)     # 0x6d306
je 0x421d
movq -0x10(%rbp), %rdi
movl 0x340ee(%rip), %r9d     # 0x382f0
leaq 0x10d7(%rip), %rsi      # 0x52e0
xorl %eax, %eax
movl %eax, %r8d
leaq 0x18a8b(%rip), %rcx     # 0x1cca0
movq %r8, %rdx
callq 0x1fb30
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)