// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/mpeg/psi/pmt.h
// Function: pmt_validate
static inline bool pmt_validate(const uint8_t *p_pmt)
{
    uint16_t i_section_size = psi_get_length(p_pmt) + PSI_HEADER_SIZE
                               - PSI_CRC_SIZE;
    const uint8_t *p_pmt_n;

    if (!psi_get_syntax(p_pmt) || psi_get_section(p_pmt)
         || psi_get_lastsection(p_pmt)
         || psi_get_tableid(p_pmt) != PMT_TABLE_ID)
        return false;

    if (!psi_check_crc(p_pmt))
        return false;

    if (i_section_size < PMT_HEADER_SIZE
         || i_section_size < PMT_HEADER_SIZE + pmt_get_desclength(p_pmt))
        return false;

    if (!descs_validate(p_pmt + 10))
        return false;

    p_pmt_n = p_pmt + PMT_HEADER_SIZE + pmt_get_desclength(p_pmt);

    while (p_pmt_n + PMT_ES_SIZE - p_pmt <= i_section_size
            && p_pmt_n + PMT_ES_SIZE + pmtn_get_desclength(p_pmt_n) - p_pmt
                <= i_section_size) {
        if (!descs_validate(p_pmt_n + 3))
            return false;

        p_pmt_n += PMT_ES_SIZE + pmtn_get_desclength(p_pmt_n);
    }

    return (p_pmt_n - p_pmt == i_section_size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b70
movzwl %ax, %eax
addl $0x3, %eax
subl $0x4, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1d50
testb $0x1, %al
jne 0x2aa1
jmp 0x2ad4
movq -0x10(%rbp), %rdi
callq 0x2420
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x2ad4
movq -0x10(%rbp), %rdi
callq 0x2440
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x2ad4
movq -0x10(%rbp), %rdi
callq 0x1ba0
movzbl %al, %eax
cmpl $0x2, %eax
je 0x2add
movb $0x0, -0x1(%rbp)
jmp 0x2c1c
movq -0x10(%rbp), %rdi
callq 0x2960
testb $0x1, %al
jne 0x2af3
movb $0x0, -0x1(%rbp)
jmp 0x2c1c
movzwl -0x12(%rbp), %eax
cmpl $0xc, %eax
jl 0x2b1c
movzwl -0x12(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c60
movw %ax, %cx
movl -0x24(%rbp), %eax
movzwl %cx, %ecx
addl $0xc, %ecx
cmpl %ecx, %eax
jge 0x2b25
movb $0x0, -0x1(%rbp)
jmp 0x2c1c
movq -0x10(%rbp), %rdi
addq $0xa, %rdi
callq 0x2c90
testb $0x1, %al
jne 0x2b3f
movb $0x0, -0x1(%rbp)
jmp 0x2c1c
movq -0x10(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c60
movw %ax, %cx
movq -0x30(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
addq $0x5, %rcx
movq -0x10(%rbp), %rax
subq %rax, %rcx
movzwl -0x12(%rbp), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x31(%rbp)
jg 0x2bc0
movq -0x20(%rbp), %rax
addq $0x5, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2cd0
movw %ax, %cx
movq -0x40(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movzwl -0x12(%rbp), %ecx
cmpq %rcx, %rax
setle %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x2bc9
jmp 0x2c02
movq -0x20(%rbp), %rdi
addq $0x3, %rdi
callq 0x2c90
testb $0x1, %al
jne 0x2be0
movb $0x0, -0x1(%rbp)
jmp 0x2c1c
movq -0x20(%rbp), %rdi
callq 0x2cd0
movzwl %ax, %ecx
addl $0x5, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x2b68
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movzwl -0x12(%rbp), %ecx
cmpq %rcx, %rax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)