// File: /workspace/github_c_makefile_star2_O0/videolan[P]bitstream/examples/./bitstream/dvb/si/sit.h
// Function: sit_validate
static inline bool sit_validate(const uint8_t *p_sit)
{
    uint16_t i_section_size = psi_get_length(p_sit) + PSI_HEADER_SIZE
                               - PSI_CRC_SIZE;
    const uint8_t *p_sit_n;

    if (!psi_get_syntax(p_sit) || psi_get_section(p_sit)
         || psi_get_lastsection(p_sit)
         || psi_get_tableid(p_sit) != SIT_TABLE_ID)
        return false;

    if (!psi_check_crc(p_sit))
        return false;

    if (i_section_size < SIT_HEADER_SIZE
         || i_section_size < SIT_HEADER_SIZE + sit_get_desclength(p_sit))
        return false;

    if (!descs_validate(sit_get_descs((uint8_t *)p_sit)))
        return false;

    p_sit_n = p_sit + SIT_HEADER_SIZE + sit_get_desclength(p_sit);

    while (p_sit_n + SIT_SERVICE_SIZE - p_sit <= i_section_size
            && p_sit_n + SIT_SERVICE_SIZE + sitn_get_desclength(p_sit_n) - p_sit
                <= i_section_size) {
        if (!descs_validate(sitn_get_descs((uint8_t *)p_sit_n)))
            return false;

        p_sit_n += SIT_SERVICE_SIZE + sitn_get_desclength(p_sit_n);
    }

    return (p_sit_n - p_sit == i_section_size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3500
movzwl %ax, %eax
addl $0x3, %eax
subl $0x4, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4360
testb $0x1, %al
jne 0x1f411
jmp 0x1f444
movq -0x10(%rbp), %rdi
callq 0x4b30
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1f444
movq -0x10(%rbp), %rdi
callq 0x4b50
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x1f444
movq -0x10(%rbp), %rdi
callq 0x3530
movzbl %al, %eax
cmpl $0x7f, %eax
je 0x1f44d
movb $0x0, -0x1(%rbp)
jmp 0x1f594
movq -0x10(%rbp), %rdi
callq 0x5480
testb $0x1, %al
jne 0x1f463
movb $0x0, -0x1(%rbp)
jmp 0x1f594
movzwl -0x12(%rbp), %eax
cmpl $0xa, %eax
jl 0x1f48c
movzwl -0x12(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1f800
movw %ax, %cx
movl -0x24(%rbp), %eax
movzwl %cx, %ecx
addl $0xa, %ecx
cmpl %ecx, %eax
jge 0x1f495
movb $0x0, -0x1(%rbp)
jmp 0x1f594
movq -0x10(%rbp), %rdi
callq 0x1f830
movq %rax, %rdi
callq 0x1ce60
testb $0x1, %al
jne 0x1f4b3
movb $0x0, -0x1(%rbp)
jmp 0x1f594
movq -0x10(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1f800
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 $0x4, %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 0x1f534
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1f850
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 0x1f53d
jmp 0x1f57a
movq -0x20(%rbp), %rdi
callq 0x1f880
movq %rax, %rdi
callq 0x1ce60
testb $0x1, %al
jne 0x1f558
movb $0x0, -0x1(%rbp)
jmp 0x1f594
movq -0x20(%rbp), %rdi
callq 0x1f850
movzwl %ax, %ecx
addl $0x4, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x1f4dc
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
nop