// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: updateVirtualTable
static void updateVirtualTable(
  Parse *pParse,       /* The parsing context */
  SrcList *pSrc,       /* The virtual table to be modified */
  Table *pTab,         /* The virtual table */
  ExprList *pChanges,  /* The columns to change in the UPDATE statement */
  Expr *pRowid,        /* Expression used to recompute the rowid */
  int *aXRef,          /* Mapping from columns of pTab to entries in pChanges */
  Expr *pWhere,        /* WHERE clause of the UPDATE statement */
  int onError          /* ON CONFLICT strategy */
){
  Vdbe *v = pParse->pVdbe;  /* Virtual machine under construction */
  int ephemTab;             /* Table holding the result of the SELECT */
  int i;                    /* Loop counter */
  sqlite3 *db = pParse->db; /* Database connection */
  const char *pVTab = (const char*)sqlite3GetVTable(db, pTab);
  WhereInfo *pWInfo;
  int nArg = 2 + pTab->nCol;      /* Number of arguments to VUpdate */
  int regArg;                     /* First register in VUpdate arg array */
  int regRec;                     /* Register in which to assemble record */
  int regRowid;                   /* Register for ephem table rowid */
  int iCsr = pSrc->a[0].iCursor;  /* Cursor used for virtual table scan */
  int aDummy[2];                  /* Unused arg for sqlite3WhereOkOnePass() */
  int bOnePass;                   /* True to use onepass strategy */
  int addr;                       /* Address of OP_OpenEphemeral */

  /* Allocate nArg registers to martial the arguments to VUpdate. Then
  ** create and open the ephemeral table in which the records created from
  ** these arguments will be temporarily stored. */
  assert( v );
  ephemTab = pParse->nTab++;
  addr= sqlite3VdbeAddOp2(v, OP_OpenEphemeral, ephemTab, nArg);
  regArg = pParse->nMem + 1;
  pParse->nMem += nArg;
  regRec = ++pParse->nMem;
  regRowid = ++pParse->nMem;

  /* Start scanning the virtual table */
  pWInfo = sqlite3WhereBegin(pParse, pSrc, pWhere, 0,0,WHERE_ONEPASS_DESIRED,0);
  if( pWInfo==0 ) return;

  /* Populate the argument registers. */
  sqlite3VdbeAddOp2(v, OP_Rowid, iCsr, regArg);
  if( pRowid ){
    sqlite3ExprCode(pParse, pRowid, regArg+1);
  }else{
    sqlite3VdbeAddOp2(v, OP_Rowid, iCsr, regArg+1);
  }
  for(i=0; i<pTab->nCol; i++){
    if( aXRef[i]>=0 ){
      sqlite3ExprCode(pParse, pChanges->a[aXRef[i]].pExpr, regArg+2+i);
    }else{
      sqlite3VdbeAddOp3(v, OP_VColumn, iCsr, i, regArg+2+i);
    }
  }

  bOnePass = sqlite3WhereOkOnePass(pWInfo, aDummy);

  if( bOnePass ){
    /* If using the onepass strategy, no-op out the OP_OpenEphemeral coded
    ** above. Also, if this is a top-level parse (not a trigger), clear the
    ** multi-write flag so that the VM does not open a statement journal */
    sqlite3VdbeChangeToNoop(v, addr);
    if( sqlite3IsToplevel(pParse) ){
      pParse->isMultiWrite = 0;
    }
  }else{
    /* Create a record from the argument register contents and insert it into
    ** the ephemeral table. */
    sqlite3VdbeAddOp3(v, OP_MakeRecord, regArg, nArg, regRec);
    sqlite3VdbeAddOp2(v, OP_NewRowid, ephemTab, regRowid);
    sqlite3VdbeAddOp3(v, OP_Insert, ephemTab, regRec, regRowid);
  }


  if( bOnePass==0 ){
    /* End the virtual table scan */
    sqlite3WhereEnd(pWInfo);

    /* Begin scannning through the ephemeral table. */
    addr = sqlite3VdbeAddOp1(v, OP_Rewind, ephemTab); VdbeCoverage(v);

    /* Extract arguments from the current row of the ephemeral table and 
    ** invoke the VUpdate method.  */
    for(i=0; i<nArg; i++){
      sqlite3VdbeAddOp3(v, OP_Column, ephemTab, i, regArg+i);
    }
  }
  sqlite3VtabMakeWritable(pParse, pTab);
  sqlite3VdbeAddOp4(v, OP_VUpdate, 0, nArg, regArg, pVTab, P4_VTAB);
  sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError);
  sqlite3MayAbort(pParse);

  /* End of the ephemeral table scan. Or, if using the onepass strategy,
  ** jump to here if the scan visited zero rows. */
  if( bOnePass==0 ){
    sqlite3VdbeAddOp2(v, OP_Next, ephemTab, addr+1); VdbeCoverage(v);
    sqlite3VdbeJumpHere(v, addr);
    sqlite3VdbeAddOp2(v, OP_Close, ephemTab, 0);
  }else{
    sqlite3WhereEnd(pWInfo);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x55e90
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movswl 0x3e(%rax), %eax
addl $0x2, %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movl 0x4c(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rcx
movl 0x50(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x50(%rcx)
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x5c(%rbp), %ecx
movl $0x3a, %esi
callq 0x6c310
movl %eax, -0x7c(%rbp)
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x54(%rax), %ecx
movl %ecx, 0x54(%rax)
movq -0x8(%rbp), %rcx
movl 0x54(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x54(%rcx)
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rcx
movl 0x54(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x54(%rcx)
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq 0x10(%rbp), %rdx
xorl %eax, %eax
movl %eax, %r8d
movl $0x4, %r9d
xorl %eax, %eax
movq %r8, %rcx
movl $0x0, (%rsp)
callq 0x7dfc0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x93515
jmp 0x93773
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl -0x60(%rbp), %ecx
movl $0x69, %esi
callq 0x6c310
cmpq $0x0, -0x28(%rbp)
je 0x93545
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x60(%rbp), %edx
addl $0x1, %edx
callq 0x6c120
jmp 0x9355c
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl -0x60(%rbp), %ecx
addl $0x1, %ecx
movl $0x69, %esi
callq 0x6c310
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x3e(%rcx), %ecx
cmpl %ecx, %eax
jge 0x935df
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jl 0x935b2
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x60(%rbp), %edx
addl $0x2, %edx
addl -0x40(%rbp), %edx
callq 0x6c120
jmp 0x935d2
movq -0x38(%rbp), %rdi
movl -0x6c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x60(%rbp), %r8d
addl $0x2, %r8d
addl -0x40(%rbp), %r8d
movl $0x9a, %esi
callq 0x56c10
jmp 0x935d4
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x93563
movq -0x58(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x8fde0
movl %eax, -0x78(%rbp)
cmpl $0x0, -0x78(%rbp)
je 0x93619
movq -0x38(%rbp), %rdi
movl -0x7c(%rbp), %esi
callq 0x17f60
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1c0(%rax)
jne 0x93617
movq -0x8(%rbp), %rax
movb $0x0, 0x20(%rax)
jmp 0x9365d
movq -0x38(%rbp), %rdi
movl -0x60(%rbp), %edx
movl -0x5c(%rbp), %ecx
movl -0x64(%rbp), %r8d
movl $0x32, %esi
callq 0x56c10
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x68(%rbp), %ecx
movl $0x54, %esi
callq 0x6c310
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x64(%rbp), %ecx
movl -0x68(%rbp), %r8d
movl $0x5f, %esi
callq 0x56c10
cmpl $0x0, -0x78(%rbp)
jne 0x936b8
movq -0x58(%rbp), %rdi
callq 0x7f7a0
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl $0x6e, %esi
callq 0x6e570
movl %eax, -0x7c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0x936b6
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x60(%rbp), %r8d
addl -0x40(%rbp), %r8d
movl $0x30, %esi
callq 0x56c10
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x93687
jmp 0x936b8
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x90010
movq -0x38(%rbp), %rdi
movl -0x5c(%rbp), %ecx
movl -0x60(%rbp), %r8d
movq -0x50(%rbp), %r9
movl $0xd, %esi
xorl %edx, %edx
movl $0xfffffff6, (%rsp)     # imm = 0xFFFFFFF6
callq 0x6be70
movq -0x38(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpl $0xa, 0x18(%rbp)
jne 0x93705
movl $0x2, %eax
movl %eax, -0x8c(%rbp)
jmp 0x9370e
movl 0x18(%rbp), %eax
movl %eax, -0x8c(%rbp)
movq -0x88(%rbp), %rdi
movl -0x8c(%rbp), %eax
movzbl %al, %esi
callq 0x17b70
movq -0x8(%rbp), %rdi
callq 0x6fdd0
cmpl $0x0, -0x78(%rbp)
jne 0x9376a
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl -0x7c(%rbp), %ecx
addl $0x1, %ecx
movl $0x8, %esi
callq 0x6c310
movq -0x38(%rbp), %rdi
movl -0x7c(%rbp), %esi
callq 0x6be30
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl $0x3e, %esi
xorl %ecx, %ecx
callq 0x6c310
jmp 0x93773
movq -0x58(%rbp), %rdi
callq 0x7f7a0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)