// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3SrcListEnlarge
SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(
  Parse *pParse,     /* Parsing context into which errors are reported */
  SrcList *pSrc,     /* The SrcList to be enlarged */
  int nExtra,        /* Number of new slots to add to pSrc->a[] */
  int iStart         /* Index in pSrc->a[] of first new slot */
){
  int i;

  /* Sanity checking on calling parameters */
  assert( iStart>=0 );
  assert( nExtra>=1 );
  assert( pSrc!=0 );
  assert( iStart<=pSrc->nSrc );

  /* Allocate additional space if needed */
  if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
    SrcList *pNew;
    sqlite3_int64 nAlloc = 2*(sqlite3_int64)pSrc->nSrc+nExtra;
    sqlite3 *db = pParse->db;

    if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
      sqlite3ErrorMsg(pParse, "too many FROM clause terms, max: %d",
                      SQLITE_MAX_SRCLIST);
      return 0;
    }
    if( nAlloc>SQLITE_MAX_SRCLIST ) nAlloc = SQLITE_MAX_SRCLIST;
    pNew = sqlite3DbRealloc(db, pSrc,
               sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
    if( pNew==0 ){
      assert( db->mallocFailed );
      return 0;
    }
    pSrc = pNew;
    pSrc->nAlloc = nAlloc;
  }

  /* Move existing slots that come after the newly inserted slots
  ** out of the way */
  for(i=pSrc->nSrc-1; i>=iStart; i--){
    pSrc->a[i+nExtra] = pSrc->a[i];
  }
  pSrc->nSrc += nExtra;

  /* Zero the newly allocated slots */
  memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra);
  for(i=iStart; i<iStart+nExtra; i++){
    pSrc->a[i].iCursor = -1;
  }

  /* Return a pointer to the enlarged SrcList */
  return pSrc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movslq (%rsi), %rax
leal (%rax,%r14), %ecx
movslq %edx, %r15
cmpl 0x4(%rsi), %ecx
jbe 0x2dc3a7
cmpl $0xc8, %ecx
jl 0x2dc366
leaq 0x105ba0(%rip), %rsi    # 0x3e1ef5
xorl %r12d, %r12d
movl $0xc8, %edx
xorl %eax, %eax
callq 0x284eb8
jmp 0x2dc39e
movq (%rdi), %rdi
leaq (%r15,%rax,2), %rax
movl $0xc8, %r12d
cmpq %r12, %rax
cmovlq %rax, %r12
imulq $0x70, %r12, %rdx
orq $0x8, %rdx
movq %rbx, %rsi
callq 0x28c4c8
testq %rax, %rax
je 0x2dc39b
movl %r12d, 0x4(%rax)
movb $0x1, %r12b
movq %rax, %rbx
jmp 0x2dc39e
xorl %r12d, %r12d
testb %r12b, %r12b
je 0x2dc42f
movslq (%rbx), %r8
movslq %ebp, %r12
cmpl %ebp, %r8d
jle 0x2dc3ee
movslq %ebp, %r9
imulq $0x70, %r8, %rax
addq %rbx, %rax
addq $-0x68, %rax
leaq (%r8,%r15), %rcx
imulq $0x70, %rcx, %rcx
leaq (%rcx,%rbx), %rdx
addq $-0x68, %rdx
decq %r8
movl $0xe, %ecx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
addq $-0x70, %rax
addq $-0x70, %rdx
cmpq %r9, %r8
jg 0x2dc3d0
addl %r15d, (%rbx)
imulq $0x70, %r12, %r13
leaq (%rbx,%r13), %rdi
addq $0x8, %rdi
imulq $0x70, %r15, %rdx
xorl %esi, %esi
callq 0x173a0
testl %r15d, %r15d
jle 0x2dc431
addl %r14d, %ebp
movslq %ebp, %rax
leaq (%rbx,%r13), %rcx
addq $0x48, %rcx
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
incq %r12
addq $0x70, %rcx
cmpq %rax, %r12
jl 0x2dc41b
jmp 0x2dc431
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq