// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SrcListEnlarge
SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(
  sqlite3 *db,       /* Database connection to notify of OOM errors */
  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( pSrc->nSrc+nExtra>pSrc->nAlloc ){
    SrcList *pNew;
    int nAlloc = pSrc->nSrc+nExtra;
    int nGot;
    pNew = sqlite3DbRealloc(db, pSrc,
               sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
    if( pNew==0 ){
      assert( db->mallocFailed );
      return pSrc;
    }
    pSrc = pNew;
    nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
    pSrc->nAlloc = (u8)nGot;
  }

  /* 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 += (i8)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
movzbl (%rax), %eax
addl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jle 0x70538
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x34(%rbp), %eax
subl $0x1, %eax
cltq
imulq $0x68, %rax, %rax
addq $0x70, %rax
movl %eax, %edx
callq 0x1bee0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x70500
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x705ff
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1bac0
cltq
subq $0x70, %rax
movl $0x68, %ecx
xorl %edx, %edx
divq %rcx
addq $0x1, %rax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x7058c
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movl -0x24(%rbp), %eax
addl -0x1c(%rbp), %eax
cltq
imulq $0x68, %rax, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
movslq -0x24(%rbp), %rax
imulq $0x68, %rax, %rax
addq %rax, %rsi
movl $0x68, %edx
callq 0x82f0
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x70545
movl -0x1c(%rbp), %eax
movsbl %al, %edx
movq -0x18(%rbp), %rax
movzbl (%rax), %ecx
addl %edx, %ecx
movb %cl, (%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movslq -0x20(%rbp), %rax
imulq $0x68, %rax, %rax
addq %rax, %rdi
movslq -0x1c(%rbp), %rax
imulq $0x68, %rax, %rdx
xorl %esi, %esi
callq 0x8200
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x705f7
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x24(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x3c(%rax) # imm = 0xFFFFFFFF
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x705c5
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)