// File: /workspace/github_cpp_makefile_star2_O1/benjibc[P]json-universal-container/./boost_file/boost/container/vector.hpp
// Function: void boost::container::vector<JSON, std::allocator<JSON>>::priv_assign_aux<JSON*>(JSON*, JSON*, std::forward_iterator_tag)
void priv_assign_aux(FwdIt first, FwdIt last, std::forward_iterator_tag)
   {
      size_type n = std::distance(first, last);
      if(!n){
         this->prot_destroy_all();
         return;
      }
      //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;

      if (n <= remaining){
         same_buffer_start = true;
      }
      else{
         //There is not enough memory, allocate a new buffer
         size_type new_cap = this->next_capacity(n);
         ret = this->allocation_command
               (allocate_new | expand_fwd | expand_bwd,
                  this->size() + n, new_cap, real_cap, this->members_.m_start);
         same_buffer_start = ret.second && this->members_.m_start == ret.first;
         if(same_buffer_start){
            this->members_.m_capacity  = real_cap;
         }
      }
     
      if(same_buffer_start){
         T *start = container_detail::to_raw_pointer(this->members_.m_start);
         if (this->size() >= n){
            //There is memory, but there are more old elements than new ones
            //Overwrite old elements with new ones
            std::copy(first, last, start);
            //Destroy remaining old elements
            this->destroy_n(start + n, this->members_.m_size - n);
            this->members_.m_size = n;
         }
         else{
            //There is memory, but there are less old elements than new ones
            //First overwrite some old elements with new ones
            FwdIt mid = first;
            std::advance(mid, this->size());
            // iG T *end = std::copy(first, mid, start);
            T *end = std::copy(first, mid, start);
            //Initialize the remaining new elements in the uninitialized memory
            ::boost::container::uninitialized_copy_or_move_alloc(this->alloc(), mid, last, end);
            this->members_.m_size = n;
         }
      }
      else if(!ret.second){
         typename value_traits::ArrayDeallocator scoped_alloc(ret.first, this->alloc(), real_cap);
         ::boost::container::uninitialized_copy_or_move_alloc(this->alloc(), first, last, container_detail::to_raw_pointer(ret.first));
         scoped_alloc.release();
         //Destroy and deallocate old buffer
         if(this->members_.m_start != 0){
            this->destroy_n(container_detail::to_raw_pointer(this->members_.m_start), this->members_.m_size);
            this->alloc().deallocate(this->members_.m_start, this->members_.m_capacity);
         }
         this->members_.m_start     = ret.first;
         this->members_.m_size      = n;
         this->members_.m_capacity  = real_cap;
      }
      else{
         //Backwards expansion
         //If anything goes wrong, this object will destroy old objects
         T *old_start         = container_detail::to_raw_pointer(this->members_.m_start);
         size_type old_size   = this->members_.m_size;
         typename value_traits::OldArrayDestructor old_values_destroyer(old_start, this->alloc(), old_size);
         //If something goes wrong size will be 0
         //but holding the whole buffer
         this->members_.m_size  = 0;
         this->members_.m_start = ret.first;
         this->members_.m_capacity = real_cap;
        
         //Backup old buffer data
         size_type old_offset    = old_start - container_detail::to_raw_pointer(ret.first);
         size_type first_count   = container_detail::min_value(n, old_offset);

         FwdIt mid = first;
         std::advance(mid, first_count);
         ::boost::container::uninitialized_copy_or_move_alloc
            (this->alloc(), first, mid, container_detail::to_raw_pointer(ret.first));

         if(old_offset > n){
            //All old elements will be destroyed by "old_values_destroyer"
            this->members_.m_size = n;
         }
         else{
            //We have constructed objects from the new begin until
            //the old end so release the rollback destruction
            old_values_destroyer.release();
            this->members_.m_start  = ret.first;
            this->members_.m_size   = first_count + old_size;
            //Now overwrite the old values
            size_type second_count = container_detail::min_value(old_size, n - first_count);
            FwdIt mid2 = mid;
            std::advance(mid2, second_count);
            // iG std::copy(mid, mid2, old_start);
            std::copy(mid, mid2, old_start);
           
            //Check if we still have to append elements in the
            //uninitialized end
            if(second_count == old_size){
               // iG std::copy(mid2, last, old_start + old_size);
               std::copy(mid2, last, old_start + old_size);
            }
            else{
               //We have to destroy some old values
               this->destroy_n
                  (old_start + second_count, old_size - second_count);
               this->members_.m_size = n;
            }
            this->members_.m_size = n;                       
         }
      }
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdx, %rax
subq %rsi, %rax
movq %rdx, %r13
subq %rsi, %r13
je 0x82c8
movq %rdx, %r15
movq %rsi, %r14
sarq $0x4, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq 0x10(%rbx), %rcx
movq %rcx, %rax
subq 0x8(%rbx), %rax
cmpq %rax, %rsi
movq %rsi, (%rsp)
jbe 0x82f5
movabsq $0xe38e38e38e38e2, %rax # imm = 0xE38E38E38E38E2
cmpq %rax, %rcx
ja 0x8356
leaq (%rcx,%rcx,2), %rax
addq $0x3, %rax
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rdx
movq %rdx, %r12
shrq $0x2, %r12
jmp 0x836c
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x82e8
movq (%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7196
addq $0x30, %r14
decq %r15
jne 0x82d4
movq $0x0, 0x8(%rbx)
jmp 0x8453
movq (%rbx), %r12
movq 0x8(%rbx), %rbp
cmpq %rsi, %rbp
jae 0x8378
leaq (,%rbp,2), %r13
addq %rbp, %r13
shlq $0x4, %r13
addq %r14, %r13
testq %rbp, %rbp
jle 0x834f
incq %rbp
movq %r12, %rdi
movq %r14, %rsi
callq 0x23f8
addq $0x30, %r14
addq $0x30, %r12
decq %rbp
cmpq $0x1, %rbp
jg 0x831b
jmp 0x834f
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x7f42
addq $0x30, %r13
addq $0x30, %r12
cmpq %r15, %r13
jne 0x8339
jmp 0x83cc
movabsq $0x1c71c71c71c71c5, %rax # imm = 0x1C71C71C71C71C5
cmpq %rax, %rcx
ja 0x83d6
leaq 0x1(%rcx), %r12
shrq %r12
cmpq %rsi, %r12
cmovbeq %rsi, %r12
addq %rcx, %r12
jmp 0x83e0
testq %r13, %r13
jle 0x83a4
movq (%rsp), %rax
leaq 0x1(%rax), %rbp
movq %r12, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x23f8
addq $0x30, %r14
addq $0x30, %r15
decq %rbp
cmpq $0x1, %rbp
jg 0x8388
movq 0x8(%rbx), %rax
cmpq (%rsp), %rax
je 0x83cc
addq %r13, %r12
movq (%rsp), %r14
subq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7196
addq $0x30, %r12
incq %r14
jne 0x83b8
movq (%rsp), %rax
movq %rax, 0x8(%rbx)
jmp 0x8453
movabsq $0x2aaaaaaaaaaaaaa, %r12 # imm = 0x2AAAAAAAAAAAAAA
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x70ae
movq %rax, %r13
cmpq %r15, %r14
je 0x8413
movq %r13, %rbp
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x7f42
addq $0x30, %r14
addq $0x30, %rbp
cmpq %r15, %r14
jne 0x83f8
movq (%rbx), %r14
testq %r14, %r14
movq (%rsp), %rax
je 0x8448
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x843c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7196
addq $0x30, %r14
decq %r15
jne 0x8428
movq (%rbx), %rdi
callq 0x2170
movq (%rsp), %rax
movq %r13, (%rbx)
movq %rax, 0x8(%rbx)
movq %r12, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
testq %r13, %r13
je 0x8472
movq %r13, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2240