// File: /workspace/github_cpp_makefile_star2_O2/salleaffaire[P]MXFParser/./mxf_base.hpp
// Function: mxf_file::decode_footer_partition_pack(klv_item&)
int decode_footer_partition_pack(klv_item &klv) {
      int rval = 0;
      
      bit_extractor be(klv.mValue, klv.mLength, BE_BIG_ENDIAN);
      
      m_footer.m_fpp.m_major_version      = be.get_bits(16);
      m_footer.m_fpp.m_minor_version      = be.get_bits(16);
      m_footer.m_fpp.m_kag_size           = be.get_bits(32);
      m_footer.m_fpp.m_this_partition     = be.get_64bits();
      m_footer.m_fpp.m_previous_partition = be.get_64bits();
      m_footer.m_fpp.m_footer_partition   = be.get_64bits();
      m_footer.m_fpp.m_header_byte_count  = be.get_64bits();
      m_footer.m_fpp.m_index_byte_count   = be.get_64bits();
      m_footer.m_fpp.m_index_sid          = be.get_bits(32);
      m_footer.m_fpp.m_body_offset        = be.get_64bits();
      m_footer.m_fpp.m_body_sid           = be.get_bits(32);
      
      // UL of operational Pattern
      for (int i=0;i<16;++i) {
         m_footer.m_fpp.m_operational_pattern.mKey[i] = be.get_bits(8);
      }

      // UL Batch - Skip the 8 bytes 
      be.get_64bits();
      
      uint32_t nunmber_of_ul = be.get_bytes_left();
      m_footer.m_fpp.m_essence_containers = new Key<16>[nunmber_of_ul];

      for (int j=0;j<nunmber_of_ul;j++) {
         for (int i=0;i<16;++i) {
            m_footer.m_fpp.m_essence_containers[j].mKey[i] = be.get_bits(8);
         }  
      }

      
#if 1
      
      std::cout << "  Major Version        = " << hex_to_string(m_header.m_hpp.m_major_version)
                << std::endl;
      std::cout << "  Minor Version        = " << hex_to_string(m_header.m_hpp.m_minor_version)
                << std::endl;
      std::cout << "  KAG Size             = " << hex_to_string(m_header.m_hpp.m_kag_size)
                << std::endl;
      std::cout << "  This Partition #     = " << hex_to_string(m_header.m_hpp.m_this_partition)
                << std::endl;
      std::cout << "  Previous Partition # = " << hex_to_string(m_header.m_hpp.m_previous_partition)
                << std::endl;
      std::cout << "  Footer Partition #   = " << hex_to_string(m_header.m_hpp.m_footer_partition)
                << std::endl;
      std::cout << "  Header Byte Count    = " << hex_to_string(m_header.m_hpp.m_header_byte_count)
                << std::endl;
      std::cout << "  Index Byte Count     = " << hex_to_string(m_header.m_hpp.m_index_byte_count)
                << std::endl;
      std::cout << "  Index SID            = " << hex_to_string(m_header.m_hpp.m_index_sid)
                << std::endl;
      std::cout << "  Body Offset          = " << hex_to_string(m_header.m_hpp.m_body_offset)
                << std::endl;
      std::cout << "  Body SID             = " << hex_to_string(m_header.m_hpp.m_body_sid)
                << std::endl;
      
#endif

      return rval;
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x18(%rsi), %rax
movl 0x10(%rsi), %ecx
leaq 0x30(%rsp), %r14
movq %rax, (%r14)
movl %ecx, 0x8(%r14)
movb $0x0, 0xc(%r14)
andl $0x0, 0x10(%r14)
movb $0x1, 0x14(%r14)
pushq $0x10
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movw %ax, 0x110(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movw %ax, 0x112(%rbx)
pushq $0x20
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movl %eax, 0x114(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0x118(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0x120(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0x128(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0x130(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0x138(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movl %eax, 0x140(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0x148(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movl %eax, 0x150(%rbx)
xorl %r15d, %r15d
pushq $0x8
popq %rbp
cmpq $0x10, %r15
je 0x45ee
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movb %al, 0x154(%rbx,%r15)
incq %r15
jmp 0x45d1
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x4988
movl 0x8(%r14), %edi
subl 0x10(%r14), %edi
movq %rdi, 0x28(%rsp)
shlq $0x4, %rdi
callq 0x2030
movq %rax, 0x168(%rbx)
xorl %r12d, %r12d
pushq $0x8
popq %rbp
xorl %r13d, %r13d
cmpq 0x28(%rsp), %r13
je 0x4657
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x464e
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movq 0x168(%rbx), %rcx
addq %r12, %rcx
movb %al, (%r15,%rcx)
incq %r15
jmp 0x462b
incq %r13
addq $0x10, %r12
jmp 0x4621
movq 0x497a(%rip), %rdi      # 0x8fd8
leaq 0x1da1(%rip), %rsi      # 0x6406
callq 0x2180
movq %rax, %r14
movzwl 0x18(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x49a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x4937(%rip), %rdi      # 0x8fd8
leaq 0x1d78(%rip), %rsi      # 0x6420
callq 0x2180
movq %rax, %r14
movzwl 0x1a(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x49a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x48f4(%rip), %rdi      # 0x8fd8
leaq 0x1d4f(%rip), %rsi      # 0x643a
callq 0x2180
movq %rax, %r14
movl 0x1c(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x4a3f
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x48b2(%rip), %rdi      # 0x8fd8
leaq 0x1d27(%rip), %rsi      # 0x6454
callq 0x2180
movq %rax, %r14
movq 0x20(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4add
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x486f(%rip), %rdi      # 0x8fd8
leaq 0x1cfe(%rip), %rsi      # 0x646e
callq 0x2180
movq %rax, %r14
movq 0x28(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4add
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x482c(%rip), %rdi      # 0x8fd8
leaq 0x1cd5(%rip), %rsi      # 0x6488
callq 0x2180
movq %rax, %r14
movq 0x30(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4add
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x47e9(%rip), %rdi      # 0x8fd8
leaq 0x1cac(%rip), %rsi      # 0x64a2
callq 0x2180
movq %rax, %r14
movq 0x38(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4add
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x47a6(%rip), %rdi      # 0x8fd8
leaq 0x1c83(%rip), %rsi      # 0x64bc
callq 0x2180
movq %rax, %r14
movq 0x40(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4add
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x4763(%rip), %rdi      # 0x8fd8
leaq 0x1c5a(%rip), %rsi      # 0x64d6
callq 0x2180
movq %rax, %r14
movl 0x48(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x4a3f
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x4721(%rip), %rdi      # 0x8fd8
leaq 0x1c32(%rip), %rsi      # 0x64f0
callq 0x2180
movq %rax, %r14
movq 0x50(%rbx), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4add
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq 0x46de(%rip), %rdi      # 0x8fd8
leaq 0x1c09(%rip), %rsi      # 0x650a
callq 0x2180
movq %rax, %r14
movl 0x58(%rbx), %esi
leaq 0x8(%rsp), %rdi
callq 0x4a3f
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20d0
leaq 0x8(%rsp), %rdi
callq 0x22b8
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
jmp 0x495a
movq %rax, %rbx
jmp 0x4980
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
jmp 0x4973
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq %rbx, %rdi
callq 0x2290