// File: /workspace/github_cpp_makefile_star2_O2/salleaffaire[P]MXFParser/./mxf_base.hpp
// Function: mxf_file::decode_body_partition_pack(klv_item&)
int decode_body_partition_pack(klv_item &klv) {
      int rval = 0;
      
      bit_extractor be(klv.mValue, klv.mLength, BE_BIG_ENDIAN);
      
      m_body.m_bpp.m_major_version      = be.get_bits(16);
      m_body.m_bpp.m_minor_version      = be.get_bits(16);
      m_body.m_bpp.m_kag_size           = be.get_bits(32);
      m_body.m_bpp.m_this_partition     = be.get_64bits();
      m_body.m_bpp.m_previous_partition = be.get_64bits();
      m_body.m_bpp.m_footer_partition   = be.get_64bits();
      m_body.m_bpp.m_header_byte_count  = be.get_64bits();
      m_body.m_bpp.m_index_byte_count   = be.get_64bits();
      m_body.m_bpp.m_index_sid          = be.get_bits(32);
      m_body.m_bpp.m_body_offset        = be.get_64bits();
      m_body.m_bpp.m_body_sid           = be.get_bits(32);
      
      // UL of operational Pattern
      for (int i=0;i<16;++i) {
         m_body.m_bpp.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_body.m_bpp.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_body.m_bpp.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, 0xa0(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movw %ax, 0xa2(%rbx)
pushq $0x20
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movl %eax, 0xa4(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0xa8(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0xb0(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0xb8(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0xc0(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0xc8(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movl %eax, 0xd0(%rbx)
movq %r14, %rdi
callq 0x4988
movq %rax, 0xd8(%rbx)
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movl %eax, 0xe0(%rbx)
xorl %r15d, %r15d
pushq $0x8
popq %rbp
cmpq $0x10, %r15
je 0x414c
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movb %al, 0xe4(%rbx,%r15)
incq %r15
jmp 0x412f
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, 0xf8(%rbx)
xorl %r12d, %r12d
pushq $0x8
popq %rbp
xorl %r13d, %r13d
cmpq 0x28(%rsp), %r13
je 0x41b5
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x41ac
movq %r14, %rdi
movl %ebp, %esi
callq 0x3184
movq 0xf8(%rbx), %rcx
addq %r12, %rcx
movb %al, (%r15,%rcx)
incq %r15
jmp 0x4189
incq %r13
addq $0x10, %r12
jmp 0x417f
movq 0x4e1c(%rip), %rdi      # 0x8fd8
leaq 0x2243(%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 0x4dd9(%rip), %rdi      # 0x8fd8
leaq 0x221a(%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 0x4d96(%rip), %rdi      # 0x8fd8
leaq 0x21f1(%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 0x4d54(%rip), %rdi      # 0x8fd8
leaq 0x21c9(%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 0x4d11(%rip), %rdi      # 0x8fd8
leaq 0x21a0(%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 0x4cce(%rip), %rdi      # 0x8fd8
leaq 0x2177(%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 0x4c8b(%rip), %rdi      # 0x8fd8
leaq 0x214e(%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 0x4c48(%rip), %rdi      # 0x8fd8
leaq 0x2125(%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 0x4c05(%rip), %rdi      # 0x8fd8
leaq 0x20fc(%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 0x4bc3(%rip), %rdi      # 0x8fd8
leaq 0x20d4(%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 0x4b80(%rip), %rdi      # 0x8fd8
leaq 0x20ab(%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 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
jmp 0x44b8
movq %rax, %rbx
jmp 0x44de
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
jmp 0x44d1
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x22b8
movq %rbx, %rdi
callq 0x2290