// File: /workspace/github_c_makefile_star2_O1/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 $0xa8, %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
movq %r14, %rdi
movl $0x78, %esi
callq 0x115e9
testq %rax, %rax
je 0x3d2ed
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0x3d312
xorps %xmm0, %xmm0
leaq -0xd0(%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)
movq $0x0, 0x70(%rbx)
testq %r13, %r13
jne 0x3d350
leaq -0x50(%rbp), %rdx
movq $0x0, (%rdx)
movl $0x0, 0x8(%rdx)
movq %r14, %rdi
movl $0x71, %esi
xorl %ecx, %ecx
callq 0x4a949
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x3d42f
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 0x3d3b0
movq %rcx, %r13
movq %r14, %rdi
movl $0x70, %esi
callq 0x115e9
movq %rax, %r15
testq %rax, %rax
je 0x3d3a5
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%r15)
movups %xmm0, 0x50(%r15)
movups %xmm0, 0x40(%r15)
movups %xmm0, 0x30(%r15)
movups %xmm0, 0x20(%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, (%r15)
movq %r13, %rcx
movq 0x20(%rbp), %rdx
movzwl 0x18(%rbp), %esi
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)
movq $-0x1, 0x14(%rbx)
movl $0xffffffff, 0x1c(%rbx) # imm = 0xFFFFFFFF
cmpb $0x0, 0x50(%r14)
je 0x3d41a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3417c
leaq -0xd0(%rbp), %rax
cmpq %rax, %rbx
je 0x3d418
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9c3a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq