// File: /workspace/github_c_makefile_star2_O1/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 0x488af
movq %rsi, %r14
movq %rdi, %rbx
movzbl (%rsi), %eax
imull $0x68, %eax, %ecx
addl $0x8, %ecx
testl %eax, %eax
movl $0x70, %esi
cmovnel %ecx, %esi
callq 0x115e9
testq %rax, %rax
je 0x488af
movq %rax, %r12
movb (%r14), %al
movb %al, 0x1(%r12)
movb %al, (%r12)
cmpb $0x0, (%r14)
je 0x488b2
movl $0x68, %r13d
xorl %eax, %eax
movl -0x2c(%rbp), %r15d
movq %rax, -0x38(%rbp)
movq -0x60(%r14,%r13), %rax
movq %rax, -0x60(%r12,%r13)
movq -0x58(%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x1010d
movq %rax, -0x58(%r12,%r13)
movq -0x50(%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x1010d
movq %rax, -0x50(%r12,%r13)
movq -0x48(%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x1010d
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 %rbx, %rdi
callq 0x1010d
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 0x4884a
incw 0x44(%rax)
movq -0x38(%r14,%r13), %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x4841f
movq %rax, -0x38(%r12,%r13)
movq -0x20(%r14,%r13), %rsi
movq %rbx, %rdi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x48163
movq %rax, -0x20(%r12,%r13)
movq -0x18(%r14,%r13), %rsi
movq %rbx, %rdi
callq 0x488c4
movq %rax, -0x18(%r12,%r13)
movq -0x10(%r14,%r13), %rax
movq %rax, -0x10(%r12,%r13)
movq -0x38(%rbp), %rcx
incq %rcx
movzbl (%r14), %eax
addq $0x68, %r13
cmpq %rax, %rcx
movq %rcx, %rax
jb 0x48774
jmp 0x488b2
xorl %r12d, %r12d
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq