// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3SelectDup
SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){
  Select *pNew, *pPrior;
  if( p==0 ) return 0;
  pNew = sqlite3DbMallocRaw(db, sizeof(*p) );
  if( pNew==0 ) return 0;
  pNew->pEList = sqlite3ExprListDup(db, p->pEList, flags);
  pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
  pNew->pWhere = sqlite3ExprDup(db, p->pWhere, flags);
  pNew->pGroupBy = sqlite3ExprListDup(db, p->pGroupBy, flags);
  pNew->pHaving = sqlite3ExprDup(db, p->pHaving, flags);
  pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, flags);
  pNew->op = p->op;
  pNew->pPrior = pPrior = sqlite3SelectDup(db, p->pPrior, flags);
  if( pPrior ) pPrior->pNext = pNew;
  pNew->pNext = 0;
  pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags);
  pNew->pOffset = sqlite3ExprDup(db, p->pOffset, flags);
  pNew->iLimit = 0;
  pNew->iOffset = 0;
  pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
  pNew->addrOpenEphm[0] = -1;
  pNew->addrOpenEphm[1] = -1;
  pNew->nSelectRow = p->nSelectRow;
  pNew->pWith = withDup(db, p->pWith);
  sqlite3SelectSetName(pNew, p->zSelName);
  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4d916
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
pushq $0x78
popq %rsi
callq 0x132c5
testq %rax, %rax
je 0x4d916
movq %rax, %rbx
movq (%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d939
movq %rax, (%rbx)
movq 0x28(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4da9d
movq %rax, 0x28(%rbx)
movq 0x30(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d4c2
movq %rax, 0x30(%rbx)
movq 0x38(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d939
movq %rax, 0x38(%rbx)
movq 0x40(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d4c2
movq %rax, 0x40(%rbx)
movq 0x48(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d939
movq %rax, 0x48(%rbx)
movb 0x8(%r15), %al
movb %al, 0x8(%rbx)
movq 0x50(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d783
movq %rax, 0x50(%rbx)
testq %rax, %rax
je 0x4d84a
movq %rbx, 0x58(%rax)
andq $0x0, 0x58(%rbx)
movq 0x60(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d4c2
movq %rax, 0x60(%rbx)
movq 0x68(%r15), %rsi
movq %r14, %rdi
movl %r12d, %edx
callq 0x4d4c2
movq %rax, 0x68(%rbx)
andq $0x0, 0xc(%rbx)
movzwl 0xa(%r15), %eax
andl $-0x11, %eax
movw %ax, 0xa(%rbx)
orq $-0x1, 0x14(%rbx)
movq 0x20(%r15), %rax
movq %rax, 0x20(%rbx)
movq 0x70(%r15), %r12
testq %r12, %r12
je 0x4d91a
movl (%r12), %eax
shll $0x5, %eax
orl $0x10, %eax
movslq %eax, %rsi
movq %r14, %rdi
callq 0x12153
testq %rax, %rax
je 0x4d91a
movq %rax, %r15
movq %rbx, -0x30(%rbp)
movl (%r12), %eax
movl %eax, (%r15)
pushq $0x20
popq %r13
xorl %ebx, %ebx
cltq
cmpq %rax, %rbx
jge 0x4d91f
movq (%r12,%r13), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x4d783
movq %rax, (%r15,%r13)
movq -0x8(%r12,%r13), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x4d939
movq %rax, -0x8(%r15,%r13)
movq -0x10(%r12,%r13), %rsi
movq %r14, %rdi
callq 0x11f6d
movq %rax, -0x10(%r15,%r13)
incq %rbx
movl (%r12), %eax
addq $0x20, %r13
jmp 0x4d8ca
xorl %ebx, %ebx
jmp 0x4d927
xorl %r15d, %r15d
jmp 0x4d923
movq -0x30(%rbp), %rbx
movq %r15, 0x70(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq