// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
movl (%rsi), %ecx
leal (%rcx,%r14), %eax
cmpl 0x4(%rsi), %eax
jbe 0x2d2b96
cmpl $0xc8, %eax
jl 0x2d2b5a
leaq 0x105c59(%rip), %rsi    # 0x3d87a0
xorl %ebx, %ebx
movl $0xc8, %edx
xorl %eax, %eax
callq 0x27b48d
jmp 0x2d2d1a
movslq %ecx, %rax
movq (%rdi), %rdi
movslq %r14d, %rcx
leaq (%rcx,%rax,2), %rax
movl $0xc8, %r15d
cmpq %r15, %rax
cmovlq %rax, %r15
imulq $0x70, %r15, %rdx
orq $0x8, %rdx
movq %rbx, %rsi
callq 0x2829e5
testq %rax, %rax
je 0x2d2d26
movq %rax, %rbx
movl %r15d, 0x4(%rax)
movl (%rax), %ecx
cmpl %ebp, %ecx
jle 0x2d2bd2
movslq %ecx, %rdx
movslq %r14d, %rax
movslq %ebp, %r15
imulq $0x70, %rdx, %r8
addq $-0x68, %r8
imulq $0x70, %rax, %r9
addq %rbx, %r9
decq %rdx
leaq (%r9,%r8), %rdi
leaq (%rbx,%r8), %rsi
movl $0xe, %ecx
rep  movsq (%rsi), %es:(%rdi)
addq $-0x70, %r8
cmpq %r15, %rdx
jg 0x2d2bb2
movl (%rbx), %ecx
jmp 0x2d2bd8
movslq %ebp, %r15
movslq %r14d, %rax
addl %r14d, %ecx
movl %ecx, (%rbx)
imulq $0x70, %r15, %r12
leaq (%rbx,%r12), %rdi
addq $0x8, %rdi
imulq $0x70, %rax, %rdx
xorl %esi, %esi
callq 0x173a0
testl %r14d, %r14d
jle 0x2d2d1a
leaq 0x1(%r15), %rax
addl %r14d, %ebp
movslq %ebp, %rcx
cmpq %rcx, %rax
cmovgq %rax, %rcx
subq %r15, %rcx
leaq 0x3(%rcx), %rax
andq $-0x4, %rax
decq %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%r12,%rbx), %rcx
addq $0x198, %rcx            # imm = 0x198
xorl %edx, %edx
movdqa 0xcbde5(%rip), %xmm1    # 0x39ea20
movdqa 0x85ddd(%rip), %xmm2    # 0x358a20
movdqa 0x85de5(%rip), %xmm3    # 0x358a30
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rdx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x2d2ca0
movl $0xffffffff, -0x150(%rcx) # imm = 0xFFFFFFFF
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x2d2cb9
movl $0xffffffff, -0xe0(%rcx) # imm = 0xFFFFFFFF
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %esi
testb $0x1, %sil
je 0x2d2cf5
movl $0xffffffff, -0x70(%rcx) # imm = 0xFFFFFFFF
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x2d2d06
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
addq $0x4, %rdx
addq $0x1c0, %rcx            # imm = 0x1C0
cmpq %rdx, %rax
jne 0x2d2c53
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x2d2d1a