// File: /workspace/github_cpp_makefile_star2_O1/benjibc[P]json-universal-container/./boost_file/boost/container/vector.hpp
// Function: boost::container::vector<JSON, std::allocator<JSON>>::priv_range_insert(JSON*, unsigned long, boost::container::container_detail::advanced_insert_aux_int<JSON*>&)
void priv_range_insert(pointer pos, const size_type n, advanced_insert_aux_int_t &interf)
   {
      //Check if we have enough memory or try to expand current memory
      size_type remaining = this->members_.m_capacity - this->members_.m_size;
      bool same_buffer_start;
      std::pair<pointer, bool> ret;
      size_type real_cap = this->members_.m_capacity;

      //Check if we already have room
      if (n <= remaining){
         same_buffer_start = true;
      }
      else{
         //There is not enough memory, allocate a new
         //buffer or expand the old one.
         size_type new_cap = this->next_capacity(n);
         ret = this->allocation_command
               (allocate_new | expand_fwd | expand_bwd,
                  this->members_.m_size + n, new_cap, real_cap, this->members_.m_start);

         //Check for forward expansion
         same_buffer_start = ret.second && this->members_.m_start == ret.first;
         if(same_buffer_start){
            this->members_.m_capacity  = real_cap;
         }
      }
     
      //If we had room or we have expanded forward
      if (same_buffer_start){
         #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
         ++this->num_expand_fwd;
         #endif
         this->priv_range_insert_expand_forward
            (container_detail::to_raw_pointer(pos), n, interf);
      }
      //Backwards (and possibly forward) expansion
      else if(ret.second){
         #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
         ++this->num_expand_bwd;
         #endif
         this->priv_range_insert_expand_backwards
            ( container_detail::to_raw_pointer(ret.first)
            , real_cap
            , container_detail::to_raw_pointer(pos)
            , n
            , interf);
      }
      //New buffer
      else{
         #ifdef BOOST_CONTAINER_VECTOR_ALLOC_STATS
         ++this->num_alloc;
         #endif
         this->priv_range_insert_new_allocation
            ( container_detail::to_raw_pointer(ret.first)
            , real_cap
            , container_detail::to_raw_pointer(pos)
            , n
            , interf);
      }
   }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rdi), %rcx
movq %rcx, %rax
subq 0x8(%rdi), %rax
cmpq %rdx, %rax
jae 0x6b40
movabsq $0xe38e38e38e38e2, %rax # imm = 0xE38E38E38E38E2
cmpq %rax, %rcx
ja 0x6b5a
leaq (%rcx,%rcx,2), %rax
addq $0x3, %rax
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rdx
movq %rdx, %r13
shrq $0x2, %r13
jmp 0x6b70
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6d66
movabsq $0x1c71c71c71c71c5, %rax # imm = 0x1C71C71C71C71C5
cmpq %rax, %rcx
ja 0x6b7c
leaq 0x1(%rcx), %r13
shrq %r13
cmpq %r14, %r13
cmovbeq %r14, %r13
addq %rcx, %r13
jmp 0x6b86
movabsq $0x2aaaaaaaaaaaaaa, %r13 # imm = 0x2AAAAAAAAAAAAAA
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x70ae
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6eec
nop