// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SelectNew
SQLITE_PRIVATE Select *sqlite3SelectNew(
  Parse *pParse,        /* Parsing context */
  ExprList *pEList,     /* which columns to include in the result */
  SrcList *pSrc,        /* the FROM clause -- which tables to scan */
  Expr *pWhere,         /* the WHERE clause */
  ExprList *pGroupBy,   /* the GROUP BY clause */
  Expr *pHaving,        /* the HAVING clause */
  ExprList *pOrderBy,   /* the ORDER BY clause */
  u16 selFlags,         /* Flag parameters, such as SF_Distinct */
  Expr *pLimit,         /* LIMIT value.  NULL means not used */
  Expr *pOffset         /* OFFSET value.  NULL means no offset */
){
  Select *pNew;
  Select standin;
  sqlite3 *db = pParse->db;
  pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
  assert( db->mallocFailed || !pOffset || pLimit ); /* OFFSET implies LIMIT */
  if( pNew==0 ){
    assert( db->mallocFailed );
    pNew = &standin;
    memset(pNew, 0, sizeof(*pNew));
  }
  if( pEList==0 ){
    pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0));
  }
  pNew->pEList = pEList;
  if( pSrc==0 ) pSrc = sqlite3DbMallocZero(db, sizeof(*pSrc));
  pNew->pSrc = pSrc;
  pNew->pWhere = pWhere;
  pNew->pGroupBy = pGroupBy;
  pNew->pHaving = pHaving;
  pNew->pOrderBy = pOrderBy;
  pNew->selFlags = selFlags;
  pNew->op = TK_SELECT;
  pNew->pLimit = pLimit;
  pNew->pOffset = pOffset;
  assert( pOffset==0 || pLimit!=0 );
  pNew->addrOpenEphm[0] = -1;
  pNew->addrOpenEphm[1] = -1;
  pNew->addrOpenEphm[2] = -1;
  if( db->mallocFailed ) {
    clearSelect(db, pNew);
    if( pNew!=&standin ) sqlite3DbFree(db, pNew);
    pNew = 0;
  }else{
    assert( pNew->pSrc!=0 || pParse->nErr>0 );
  }
  assert( pNew!=&standin );
  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, -0x40(%rbp)
movq %r8, -0x38(%rbp)
movq %rcx, -0x30(%rbp)
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
movq (%rdi), %r14
pushq $0x78
popq %rsi
movq %r14, %rdi
callq 0xf4ae
movq %rax, %rbx
testq %rax, %rax
jne 0x3b3c0
xorps %xmm0, %xmm0
leaq -0xc0(%rbp), %rbx
movaps %xmm0, 0x60(%rbx)
movaps %xmm0, 0x50(%rbx)
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
andq $0x0, 0x70(%rbx)
testq %r13, %r13
jne 0x3b3e2
pushq $0x71
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x3b590
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3b491
movq %rax, %r13
movq 0x28(%rbp), %rcx
movq 0x20(%rbp), %rdx
movzwl 0x18(%rbp), %esi
movq 0x10(%rbp), %r12
movq %r13, (%rbx)
testq %r15, %r15
jne 0x3b418
pushq $0x70
popq %rsi
movq %r14, %rdi
movq %rcx, %r15
movq %rdx, %r13
callq 0xf4ae
movzwl 0x18(%rbp), %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r15
movq %r15, 0x28(%rbx)
movq -0x30(%rbp), %rax
movq %rax, 0x30(%rbx)
movq -0x38(%rbp), %rax
movq %rax, 0x38(%rbx)
movq -0x40(%rbp), %rax
movq %rax, 0x40(%rbx)
movq %r12, 0x48(%rbx)
movw %si, 0xa(%rbx)
movb $0x74, 0x8(%rbx)
movq %rdx, 0x68(%rbx)
movq %rcx, 0x70(%rbx)
orq $-0x1, 0x14(%rbx)
orl $-0x1, 0x1c(%rbx)
cmpb $0x0, 0x50(%r14)
je 0x3b47c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2f595
leaq -0xc0(%rbp), %rax
cmpq %rax, %rbx
je 0x3b47a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x968b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq