// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jbe 0x4462ec
movq -0x18(%rbp), %rax
movslq (%rax), %rax
shlq %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl -0x1c(%rbp), %eax
cmpl $0xc8, %eax
jl 0x446290
movq -0x10(%rbp), %rdi
leaq 0x1679c3(%rip), %rsi    # 0x5adc3a
movl $0xc8, %edx
movb $0x0, %al
callq 0x3cb660
movq $0x0, -0x8(%rbp)
jmp 0x4463ac
cmpq $0xc8, -0x38(%rbp)
jle 0x4462a2
movq $0xc8, -0x38(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rax
subq $0x1, %rax
imulq $0x70, %rax, %rdx
addq $0x78, %rdx
callq 0x3d61d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x4462d7
movq $0x0, -0x8(%rbp)
jmp 0x4463ac
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x44633f
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0x24(%rbp), %eax
addl -0x1c(%rbp), %eax
cltq
imulq $0x70, %rax, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movslq -0x24(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
movl $0x70, %edx
callq 0x19610
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4462f8
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movslq -0x20(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rdi
movslq -0x1c(%rbp), %rax
imulq $0x70, %rax, %rdx
xorl %esi, %esi
callq 0x19360
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4463a4
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x24(%rbp), %rcx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x40(%rax) # imm = 0xFFFFFFFF
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x446372
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)