// File: salleaffaire[P]MXFParser/klv.cpp
// Function: klv_item::validate()
bool klv_item::validate() {
   bool rval = true;
   if (mKey[0] != KLV_UL_HEADER_IOD) {
      std::cout << " Invalid OID, should be equal to " 
                << std::hex << std::setfill('0') << std::setw(2) 
                << KLV_UL_HEADER_IOD << std::endl;
      rval = false;
   } 
   if (mKey[1] != KLV_UL_HEADER_ULSIZE) {
      std::cout << " Invalid UL Size, should be equal to " 
                << std::hex << std::setfill('0') << std::setw(2) 
                << KLV_UL_HEADER_ULSIZE << std::endl;
      rval = false;
   }
   if (mKey[2] != KLV_UL_DESIGNATOR_ULCODE) {
      std::cout << " Invalid UL Code, should be equal to " 
                << std::hex << std::setfill('0') << std::setw(2) 
                << KLV_UL_DESIGNATOR_ULCODE << std::endl;
      rval = false;
   }
   if (mKey[3] != KLV_UL_DESIGNATOR_SMPTE_DESIGNATOR) {
      std::cout << " Invalid SMPTE Designator, should be equal to " 
                << std::hex << std::setfill('0') << std::setw(2) 
                << KLV_UL_DESIGNATOR_SMPTE_DESIGNATOR << std::endl;
      rval = false;
   }
   
   if (rval) {
      std::cout << " KLV Key is valid" << std::endl; 
   }
   
   return rval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movb $0x1, -0x9(%rbp)
xorl %esi, %esi
callq 0x5030
movzbl (%rax), %eax
cmpl $0x6, %eax
je 0x4e24
movq 0xc22a(%rip), %rdi      # 0x10fd8
leaq 0x7396(%rip), %rsi      # 0xc14b
callq 0x31f0
movq %rax, %rdi
leaq -0x13f4(%rip), %rsi     # 0x39d0
callq 0x30d0
movq %rax, -0x40(%rbp)
movl $0x30, %edi
callq 0x3a20
movq -0x40(%rbp), %rdi
movb %al, -0xa(%rbp)
movzbl -0xa(%rbp), %esi
callq 0x3320
movq %rax, -0x38(%rbp)
movl $0x2, %edi
callq 0x3a00
movq -0x38(%rbp), %rdi
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
callq 0x3280
movq %rax, %rdi
movl $0x6, %esi
callq 0x3360
movq %rax, %rdi
movq 0xc19d(%rip), %rsi      # 0x10fb8
callq 0x3230
movb $0x0, -0x9(%rbp)
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0x5030
movzbl (%rax), %eax
cmpl $0xe, %eax
je 0x4eb7
movq 0xc197(%rip), %rdi      # 0x10fd8
leaq 0x7325(%rip), %rsi      # 0xc16d
callq 0x31f0
movq %rax, %rdi
leaq -0x1487(%rip), %rsi     # 0x39d0
callq 0x30d0
movq %rax, -0x50(%rbp)
movl $0x30, %edi
callq 0x3a20
movq -0x50(%rbp), %rdi
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %esi
callq 0x3320
movq %rax, -0x48(%rbp)
movl $0x2, %edi
callq 0x3a00
movq -0x48(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0x3280
movq %rax, %rdi
movl $0xe, %esi
callq 0x3360
movq %rax, %rdi
movq 0xc10a(%rip), %rsi      # 0x10fb8
callq 0x3230
movb $0x0, -0x9(%rbp)
movq -0x30(%rbp), %rdi
movl $0x2, %esi
callq 0x5030
movzbl (%rax), %eax
cmpl $0x2b, %eax
je 0x4f4a
movq 0xc104(%rip), %rdi      # 0x10fd8
leaq 0x72b8(%rip), %rsi      # 0xc193
callq 0x31f0
movq %rax, %rdi
leaq -0x151a(%rip), %rsi     # 0x39d0
callq 0x30d0
movq %rax, -0x60(%rbp)
movl $0x30, %edi
callq 0x3a20
movq -0x60(%rbp), %rdi
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %esi
callq 0x3320
movq %rax, -0x58(%rbp)
movl $0x2, %edi
callq 0x3a00
movq -0x58(%rbp), %rdi
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
callq 0x3280
movq %rax, %rdi
movl $0x2b, %esi
callq 0x3360
movq %rax, %rdi
movq 0xc077(%rip), %rsi      # 0x10fb8
callq 0x3230
movb $0x0, -0x9(%rbp)
movq -0x30(%rbp), %rdi
movl $0x3, %esi
callq 0x5030
movzbl (%rax), %eax
cmpl $0x34, %eax
je 0x4fdd
movq 0xc071(%rip), %rdi      # 0x10fd8
leaq 0x724b(%rip), %rsi      # 0xc1b9
callq 0x31f0
movq %rax, %rdi
leaq -0x15ad(%rip), %rsi     # 0x39d0
callq 0x30d0
movq %rax, -0x70(%rbp)
movl $0x30, %edi
callq 0x3a20
movq -0x70(%rbp), %rdi
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %esi
callq 0x3320
movq %rax, -0x68(%rbp)
movl $0x2, %edi
callq 0x3a00
movq -0x68(%rbp), %rdi
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %esi
callq 0x3280
movq %rax, %rdi
movl $0x34, %esi
callq 0x3360
movq %rax, %rdi
movq 0xbfe4(%rip), %rsi      # 0x10fb8
callq 0x3230
movb $0x0, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
je 0x5005
movq 0xbfee(%rip), %rdi      # 0x10fd8
leaq 0x71f7(%rip), %rsi      # 0xc1e8
callq 0x31f0
movq %rax, %rdi
movq 0xbfb8(%rip), %rsi      # 0x10fb8
callq 0x3230
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq