// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: updateFromSelect
static void updateFromSelect(
  Parse *pParse,                  /* Parse context */
  int iEph,                       /* Cursor for open eph. table */
  Index *pPk,                     /* PK if table 0 is WITHOUT ROWID */
  ExprList *pChanges,             /* List of expressions to return */
  SrcList *pTabList,              /* List of tables to select from */
  Expr *pWhere,                   /* WHERE clause for query */
  ExprList *pOrderBy,             /* ORDER BY clause */
  Expr *pLimit                    /* LIMIT clause */
){
  int i;
  SelectDest dest;
  Select *pSelect = 0;
  ExprList *pList = 0;
  ExprList *pGrp = 0;
  Expr *pLimit2 = 0;
  ExprList *pOrderBy2 = 0;
  sqlite3 *db = pParse->db;
  Table *pTab = pTabList->a[0].pTab;
  SrcList *pSrc;
  Expr *pWhere2;
  int eDest;

#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
  if( pOrderBy && pLimit==0 ) {
    sqlite3ErrorMsg(pParse, "ORDER BY without LIMIT on UPDATE");
    return;
  }
  pOrderBy2 = sqlite3ExprListDup(db, pOrderBy, 0);
  pLimit2 = sqlite3ExprDup(db, pLimit, 0);
#else
  UNUSED_PARAMETER(pOrderBy);
  UNUSED_PARAMETER(pLimit);
#endif

  pSrc = sqlite3SrcListDup(db, pTabList, 0);
  pWhere2 = sqlite3ExprDup(db, pWhere, 0);

  assert( pTabList->nSrc>1 );
  if( pSrc ){
    pSrc->a[0].iCursor = -1;
    pSrc->a[0].pTab->nTabRef--;
    pSrc->a[0].pTab = 0;
  }
  if( pPk ){
    for(i=0; i<pPk->nKeyCol; i++){
      Expr *pNew = exprRowColumn(pParse, pPk->aiColumn[i]);
#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
      if( pLimit ){
        pGrp = sqlite3ExprListAppend(pParse, pGrp, sqlite3ExprDup(db, pNew, 0));
      }
#endif
      pList = sqlite3ExprListAppend(pParse, pList, pNew);
    }
    eDest = SRT_Upfrom;
  }else if( pTab->pSelect ){
    for(i=0; i<pTab->nCol; i++){
      pList = sqlite3ExprListAppend(pParse, pList, exprRowColumn(pParse, i));
    }
    eDest = SRT_Table;
  }else{
    eDest = IsVirtual(pTab) ? SRT_Table : SRT_Upfrom;
    pList = sqlite3ExprListAppend(pParse, 0, sqlite3PExpr(pParse,TK_ROW,0,0));
#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
    if( pLimit ){
      pGrp = sqlite3ExprListAppend(pParse, 0, sqlite3PExpr(pParse,TK_ROW,0,0));
    }
#endif
  }
  if( ALWAYS(pChanges) ){
    for(i=0; i<pChanges->nExpr; i++){
      pList = sqlite3ExprListAppend(pParse, pList,
          sqlite3ExprDup(db, pChanges->a[i].pExpr, 0)
      );
    }
  }
  pSelect = sqlite3SelectNew(pParse, pList,
      pSrc, pWhere2, pGrp, 0, pOrderBy2, SF_UpdateFrom|SF_IncludeHidden, pLimit2
  );
  sqlite3SelectDestInit(&dest, eDest, iEph);
  dest.iSDParm2 = (pPk ? pPk->nKeyCol : -1);
  sqlite3Select(pParse, pSelect, &dest);
  sqlite3SelectDelete(db, pSelect);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq $0x0, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %edx, %edx
callq 0x432c70
movq %rax, -0xa0(%rbp)
movq -0x90(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x42dee0
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa0(%rbp)
je 0x45e88f
movq -0xa0(%rbp), %rax
movl $0xffffffff, 0x48(%rax) # imm = 0xFFFFFFFF
movq -0xa0(%rbp), %rax
movq 0x28(%rax), %rax
movl 0x3c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x3c(%rax)
movq -0xa0(%rbp), %rax
movq $0x0, 0x28(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x45e8fe
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
movzwl 0x5e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x45e8ef
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movswl (%rax,%rcx,2), %esi
callq 0x4605c0
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0xb8(%rbp), %rdx
callq 0x41d3c0
movq %rax, -0x70(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x45e89d
movl $0xf, -0xac(%rbp)
jmp 0x45e9d1
movq -0x98(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x45e978
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x98(%rbp), %rcx
movswl 0x46(%rcx), %ecx
cmpl %ecx, %eax
jge 0x45e96c
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x4605c0
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq %rax, %rdx
callq 0x41d3c0
movq %rax, -0x70(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x45e913
movl $0xe, -0xac(%rbp)
jmp 0x45e9cf
movq -0x98(%rbp), %rax
movl 0x54(%rax), %edx
movl $0xf, %eax
movl $0xe, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0xac(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4b, %esi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x418540
movq -0xd0(%rbp), %rdi
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0x41d3c0
movq %rax, -0x70(%rbp)
jmp 0x45e9d1
cmpq $0x0, -0x20(%rbp)
je 0x45ea4b
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x45ea49
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x90(%rbp), %rdi
movq -0x20(%rbp), %rax
addq $0x8, %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
xorl %edx, %edx
callq 0x42dee0
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq %rax, %rdx
callq 0x41d3c0
movq %rax, -0x70(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x45e9df
jmp 0x45ea4b
movq -0x8(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
movq -0x78(%rbp), %r8
movq -0x88(%rbp), %r10
movq -0x80(%rbp), %rax
xorl %r9d, %r9d
movq %r10, (%rsp)
movl $0x820000, 0x8(%rsp)    # imm = 0x820000
movq %rax, 0x10(%rsp)
callq 0x41d1d0
movq %rax, -0x68(%rbp)
movl -0xac(%rbp), %esi
movl -0xc(%rbp), %edx
leaq -0x60(%rbp), %rdi
callq 0x430c20
cmpq $0x0, -0x18(%rbp)
je 0x45eab6
movq -0x18(%rbp), %rax
movzwl 0x5e(%rax), %eax
movl %eax, -0xe4(%rbp)
jmp 0x45eac3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xe4(%rbp)
jmp 0x45eac3
movl -0xe4(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x41aee0
movq -0x90(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x40c7e0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)