// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %r9, %r14
movq %rcx, -0x40(%rbp)
movq %rsi, %r9
movq %rdi, %r15
movq 0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0x10(%rdi), %rsi
movq %rdx, -0x78(%rbp)
movq 0x58(%rdx), %r12
testq %r12, %r12
je 0x6deb6
movq (%r15), %rax
cmpq %rax, (%r12)
je 0x6deb6
movq 0x28(%r12), %r12
testq %r12, %r12
jne 0x6dea6
movq %r8, -0x98(%rbp)
movl 0x18(%rbp), %eax
movl %eax, -0x80(%rbp)
movq -0x78(%rbp), %rax
movswl 0x3e(%rax), %ebx
leal 0x2(%rbx), %ecx
movl 0x4c(%r9), %eax
movl %eax, -0x5c(%rbp)
movl 0x50(%r15), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x50(%r15)
movq %rsi, %rdi
movq %rsi, -0x38(%rbp)
movl $0x3a, %esi
movq %rdx, -0x68(%rbp)
movl %ecx, -0x2c(%rbp)
xorl %r8d, %r8d
movq %r9, -0x48(%rbp)
callq 0x3fa9e
movq %rax, -0x70(%rbp)
movl 0x54(%r15), %r13d
movq %rbx, -0x90(%rbp)
leal 0x4(%r13,%rbx), %ebx
movl %ebx, 0x54(%r15)
movl $0x0, (%rsp)
movq %r15, %rdi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x4, %r9d
callq 0x5e598
movq %rax, -0x50(%rbp)
testq %rax, %rax
je 0x6df8d
movl %ebx, -0x7c(%rbp)
leal 0x1(%r13), %ecx
movq -0x38(%rbp), %rdi
movl $0x69, %esi
movl -0x5c(%rbp), %ebx
movl %ebx, %edx
movq %rcx, -0x48(%rbp)
xorl %r8d, %r8d
callq 0x3fa9e
movq %r13, -0x88(%rbp)
leal 0x2(%r13), %ecx
movq -0x98(%rbp), %rsi
testq %rsi, %rsi
movl %ebx, %r13d
movq %r15, -0x58(%rbp)
je 0x6df9c
movq %r15, %rdi
movl %ecx, %edx
callq 0x50a8d
jmp 0x6dfb0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %rdi
movl $0x69, %esi
movl -0x5c(%rbp), %edx
xorl %r8d, %r8d
callq 0x3fa9e
movq -0x78(%rbp), %rax
cmpw $0x0, 0x3e(%rax)
movl -0x2c(%rbp), %ecx
jle 0x6e021
movl %r13d, %edx
movq -0x88(%rbp), %r15
addl $0x3, %r15d
xorl %ebx, %ebx
movslq (%r14,%rbx,4), %rax
testq %rax, %rax
js 0x6dff6
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
leal (%r15,%rbx), %edx
movq -0x58(%rbp), %rdi
callq 0x50a8d
jmp 0x6e00a
leal (%r15,%rbx), %r8d
movq -0x38(%rbp), %rdi
movl $0x9a, %esi
movl %ebx, %ecx
callq 0x3fa9e
incq %rbx
movq -0x78(%rbp), %rax
movswq 0x3e(%rax), %rax
cmpq %rax, %rbx
movl -0x2c(%rbp), %ecx
movl %r13d, %edx
jl 0x6dfce
movq -0x50(%rbp), %rax
movb 0x36(%rax), %bl
testb %bl, %bl
je 0x6e057
movq -0x38(%rbp), %r15
movq %r15, %rdi
movq -0x70(%rbp), %r14
movl %r14d, %esi
callq 0x14be2
movq -0x58(%rbp), %rax
cmpq $0x0, 0x1c0(%rax)
jne 0x6e0c0
movq -0x58(%rbp), %rax
movb $0x0, 0x20(%rax)
jmp 0x6e0c0
movq -0x90(%rbp), %rax
movb %bl, -0x40(%rbp)
movq -0x88(%rbp), %rdx
leal (%rdx,%rax), %ebx
addl $0x3, %ebx
movq -0x38(%rbp), %r15
movq %r15, %rdi
movl $0x32, %esi
movq -0x48(%rbp), %rdx
movl %ebx, %r8d
callq 0x3fa9e
movq %r15, %rdi
movl $0x54, %esi
movq -0x68(%rbp), %r14
movl %r14d, %edx
movl -0x7c(%rbp), %r13d
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %r15, %rdi
movl $0x5f, %esi
movl %r14d, %edx
movl %ebx, %ecx
movb -0x40(%rbp), %bl
movl %r13d, %r8d
callq 0x3fa9e
movq -0x70(%rbp), %r14
testb %bl, %bl
jne 0x6e12e
movb %bl, -0x40(%rbp)
movq -0x50(%rbp), %rdi
callq 0x60262
xorl %ebx, %ebx
movq %r15, %rdi
movl $0x6e, %esi
movq -0x68(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, %r14d
cmpw $-0x1, -0x90(%rbp)
jl 0x6e12b
movq %r14, -0x70(%rbp)
movq -0x68(%rbp), %r14
movl -0x2c(%rbp), %r13d
movq -0x48(%rbp), %r15
leal (%r15,%rbx), %r8d
movq -0x38(%rbp), %rdi
movl $0x30, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq 0x3fa9e
incl %ebx
cmpl %ebx, %r13d
jne 0x6e105
movq -0x70(%rbp), %r14
movq -0x38(%rbp), %r15
movb -0x40(%rbp), %bl
movq -0x58(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x6b291
movq %r15, %rdi
movl $0xd, %esi
xorl %edx, %edx
movl -0x2c(%rbp), %ecx
movq -0x48(%rbp), %r8
callq 0x3fa9e
movq %r15, %rdi
movl %eax, %esi
movq %r12, %rdx
movl $0xfffffff6, %ecx       # imm = 0xFFFFFFF6
callq 0x14ab9
movl -0x80(%rbp), %ecx
cmpl $0xa, %ecx
movl $0x2, %eax
cmovnel %ecx, %eax
movq (%r15), %rcx
cmpb $0x0, 0x51(%rcx)
je 0x6e183
leaq 0x27367(%rip), %rcx     # 0x954e8
jmp 0x6e197
movslq 0x3c(%r15), %rcx
movq 0x8(%r15), %rdx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rcx
addq $-0x18, %rcx
movb %al, 0x3(%rcx)
movq -0x58(%rbp), %rcx
movq 0x1c0(%rcx), %rax
testq %rax, %rax
cmoveq %rcx, %rax
movb $0x1, 0x21(%rax)
testb %bl, %bl
je 0x6e1cb
movq -0x50(%rbp), %rdi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x60262
leal 0x1(%r14), %ecx
movq %r15, %rdi
movl $0x8, %esi
movq -0x68(%rbp), %rbx
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3fa9e
movl 0x3c(%r15), %eax
leal -0x1(%rax), %ecx
movq 0x30(%r15), %rdx
movl %ecx, 0x68(%rdx)
movq (%r15), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6e205
leaq 0x272e5(%rip), %rcx     # 0x954e8
jmp 0x6e21b
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%r15), %rcx
movl %eax, 0x8(%rcx)
movq %r15, %rdi
movl $0x3e, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fa9e