// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SrcListDup
SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3 *db, SrcList *p, int flags){
  SrcList *pNew;
  int i;
  int nByte;
  if( p==0 ) return 0;
  nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
  pNew = sqlite3DbMallocRaw(db, nByte );
  if( pNew==0 ) return 0;
  pNew->nSrc = pNew->nAlloc = p->nSrc;
  for(i=0; i<p->nSrc; i++){
    struct SrcList_item *pNewItem = &pNew->a[i];
    struct SrcList_item *pOldItem = &p->a[i];
    Table *pTab;
    pNewItem->pSchema = pOldItem->pSchema;
    pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase);
    pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
    pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias);
    pNewItem->jointype = pOldItem->jointype;
    pNewItem->iCursor = pOldItem->iCursor;
    pNewItem->addrFillSub = pOldItem->addrFillSub;
    pNewItem->regReturn = pOldItem->regReturn;
    pNewItem->isCorrelated = pOldItem->isCorrelated;
    pNewItem->viaCoroutine = pOldItem->viaCoroutine;
    pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex);
    pNewItem->notIndexed = pOldItem->notIndexed;
    pNewItem->pIndex = pOldItem->pIndex;
    pTab = pNewItem->pTab = pOldItem->pTab;
    if( pTab ){
      pTab->nRef++;
    }
    pNewItem->pSelect = sqlite3SelectDup(db, pOldItem->pSelect, flags);
    pNewItem->pOn = sqlite3ExprDup(db, pOldItem->pOn, flags);
    pNewItem->pUsing = sqlite3IdListDup(db, pOldItem->pUsing);
    pNewItem->colUsed = pOldItem->colUsed;
  }
  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x2c(%rbp)
testq %rsi, %rsi
je 0x4480e
movq %rsi, %r14
movq %rdi, %r15
movzbl (%rsi), %eax
imull $0x68, %eax, %ecx
addl $0x8, %ecx
testl %eax, %eax
pushq $0x70
popq %rsi
cmovnel %ecx, %esi
callq 0x103b4
testq %rax, %rax
je 0x4480e
movq %rax, %r12
movb (%r14), %al
movb %al, 0x1(%r12)
movb %al, (%r12)
pushq $0x68
popq %r13
xorl %ecx, %ecx
movl -0x2c(%rbp), %ebx
movzbl %al, %eax
cmpq %rax, %rcx
jae 0x44811
movq %rcx, -0x38(%rbp)
movq -0x60(%r14,%r13), %rax
movq %rax, -0x60(%r12,%r13)
movq -0x58(%r14,%r13), %rsi
movq %r15, %rdi
callq 0xf173
movq %rax, -0x58(%r12,%r13)
movq -0x50(%r14,%r13), %rsi
movq %r15, %rdi
callq 0xf173
movq %rax, -0x50(%r12,%r13)
movq -0x48(%r14,%r13), %rsi
movq %r15, %rdi
callq 0xf173
movq %rax, -0x48(%r12,%r13)
movb -0x28(%r14,%r13), %al
movb %al, -0x28(%r12,%r13)
movl -0x24(%r14,%r13), %eax
movl %eax, -0x24(%r12,%r13)
movl -0x30(%r14,%r13), %eax
movl %eax, -0x30(%r12,%r13)
movl -0x2c(%r14,%r13), %eax
movl %eax, -0x2c(%r12,%r13)
movb -0x27(%r14,%r13), %al
andb $0x2, %al
movb -0x27(%r12,%r13), %cl
andb $-0x3, %cl
orb %al, %cl
movb %cl, -0x27(%r12,%r13)
movb -0x27(%r14,%r13), %al
andb $0x4, %al
andb $-0x5, %cl
orb %al, %cl
movb %cl, -0x27(%r12,%r13)
movq -0x8(%r14,%r13), %rsi
movq %r15, %rdi
callq 0xf173
movq %rax, -0x8(%r12,%r13)
movb -0x27(%r14,%r13), %al
andb $0x1, %al
movb -0x27(%r12,%r13), %cl
andb $-0x2, %cl
orb %al, %cl
movb %cl, -0x27(%r12,%r13)
movq (%r14,%r13), %rax
movq %rax, (%r12,%r13)
movq -0x40(%r14,%r13), %rax
movq %rax, -0x40(%r12,%r13)
testq %rax, %rax
je 0x447b7
incw 0x44(%rax)
movq -0x38(%r14,%r13), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x443e4
movq %rax, -0x38(%r12,%r13)
movq -0x20(%r14,%r13), %rsi
movq %r15, %rdi
movl %ebx, %edx
callq 0x440d6
movq %rax, -0x20(%r12,%r13)
movq -0x18(%r14,%r13), %rsi
movq %r15, %rdi
callq 0x44823
movq %rax, -0x18(%r12,%r13)
movq -0x10(%r14,%r13), %rax
movq %rax, -0x10(%r12,%r13)
movq -0x38(%rbp), %rcx
incq %rcx
movb (%r14), %al
addq $0x68, %r13
jmp 0x446d5
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq