// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3CompleteInsertion
SQLITE_PRIVATE void sqlite3CompleteInsertion(
  Parse *pParse,      /* The parser context */
  Table *pTab,        /* the table into which we are inserting */
  int iDataCur,       /* Cursor of the canonical data source */
  int iIdxCur,        /* First index cursor */
  int regNewData,     /* Range of content */
  int *aRegIdx,       /* Register used by each index.  0 for unused indices */
  int isUpdate,       /* True for UPDATE, False for INSERT */
  int appendBias,     /* True if this is likely to be an append */
  int useSeekResult   /* True to set the USESEEKRESULT flag on OP_[Idx]Insert */
){
  Vdbe *v;            /* Prepared statements under construction */
  Index *pIdx;        /* An index being inserted or updated */
  u8 pik_flags;       /* flag values passed to the btree insert */
  int regData;        /* Content registers (after the rowid) */
  int regRec;         /* Register holding assembled record for the table */
  int i;              /* Loop counter */
  u8 bAffinityDone = 0; /* True if OP_Affinity has been run already */

  v = sqlite3GetVdbe(pParse);
  assert( v!=0 );
  assert( pTab->pSelect==0 );  /* This table is not a VIEW */
  for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
    if( aRegIdx[i]==0 ) continue;
    bAffinityDone = 1;
    if( pIdx->pPartIdxWhere ){
      sqlite3VdbeAddOp2(v, OP_IsNull, aRegIdx[i], sqlite3VdbeCurrentAddr(v)+2);
      VdbeCoverage(v);
    }
    sqlite3VdbeAddOp2(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i]);
    pik_flags = 0;
    if( useSeekResult ) pik_flags = OPFLAG_USESEEKRESULT;
    if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
      assert( pParse->nested==0 );
      pik_flags |= OPFLAG_NCHANGE;
    }
    if( pik_flags )  sqlite3VdbeChangeP5(v, pik_flags);
  }
  if( !HasRowid(pTab) ) return;
  regData = regNewData + 1;
  regRec = sqlite3GetTempReg(pParse);
  sqlite3VdbeAddOp3(v, OP_MakeRecord, regData, pTab->nCol, regRec);
  if( !bAffinityDone ) sqlite3TableAffinity(v, pTab, 0);
  sqlite3ExprCacheAffinityChange(pParse, regData, pTab->nCol);
  if( pParse->nested ){
    pik_flags = 0;
  }else{
    pik_flags = OPFLAG_NCHANGE;
    pik_flags |= (isUpdate?OPFLAG_ISUPDATE:OPFLAG_LASTROWID);
  }
  if( appendBias ){
    pik_flags |= OPFLAG_APPEND;
  }
  if( useSeekResult ){
    pik_flags |= OPFLAG_USESEEKRESULT;
  }
  sqlite3VdbeAddOp3(v, OP_Insert, iDataCur, regRec, regNewData);
  if( !pParse->nested ){
    sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_TRANSIENT);
  }
  sqlite3VdbeChangeP5(v, pik_flags);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
movb $0x0, -0x49(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6bd00
movq %rax, -0x30(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x94614
movq -0x28(%rbp), %rax
movslq -0x48(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x94549
jmp 0x945fa
movb $0x1, -0x49(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x9458d
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
callq 0x6c2b0
movq -0x58(%rbp), %rdi
movl -0x50(%rbp), %edx
movl %eax, %ecx
addl $0x2, %ecx
movl $0x4c, %esi
callq 0x6c310
movq -0x30(%rbp), %rdi
movl -0x18(%rbp), %edx
addl -0x48(%rbp), %edx
movq -0x28(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl $0x70, %esi
callq 0x6c310
movb $0x0, -0x39(%rbp)
cmpl $0x0, 0x20(%rbp)
je 0x945ba
movb $0x10, -0x39(%rbp)
movq -0x38(%rbp), %rax
movb 0x63(%rax), %al
andb $0x3, %al
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x945e5
movq -0x10(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x945e5
movzbl -0x39(%rbp), %eax
orl $0x1, %eax
movb %al, -0x39(%rbp)
cmpb $0x0, -0x39(%rbp)
je 0x945f8
movq -0x30(%rbp), %rdi
movzbl -0x39(%rbp), %esi
callq 0x17b70
jmp 0x945fa
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x9452b
movq -0x10(%rbp), %rax
movzbl 0x46(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x94629
jmp 0x9471a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6f960
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movl -0x40(%rbp), %edx
movq -0x10(%rbp), %rax
movswl 0x3e(%rax), %ecx
movl -0x44(%rbp), %r8d
movl $0x32, %esi
callq 0x56c10
cmpb $0x0, -0x49(%rbp)
jne 0x94670
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x741d0
movq -0x8(%rbp), %rdi
movl -0x40(%rbp), %esi
movq -0x10(%rbp), %rax
movswl 0x3e(%rax), %edx
callq 0x6e330
movq -0x8(%rbp), %rax
cmpb $0x0, 0x1e(%rax)
je 0x94694
movb $0x0, -0x39(%rbp)
jmp 0x946b4
movb $0x1, -0x39(%rbp)
movl 0x10(%rbp), %edx
movl $0x2, %ecx
movl $0x4, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movzbl -0x39(%rbp), %eax
orl %ecx, %eax
movb %al, -0x39(%rbp)
cmpl $0x0, 0x18(%rbp)
je 0x946c4
movzbl -0x39(%rbp), %eax
orl $0x8, %eax
movb %al, -0x39(%rbp)
cmpl $0x0, 0x20(%rbp)
je 0x946d4
movzbl -0x39(%rbp), %eax
orl $0x10, %eax
movb %al, -0x39(%rbp)
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl $0x5f, %esi
callq 0x56c10
movq -0x8(%rbp), %rax
cmpb $0x0, 0x1e(%rax)
jne 0x9470d
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x17dd0
movq -0x30(%rbp), %rdi
movzbl -0x39(%rbp), %esi
callq 0x17b70
addq $0x60, %rsp
popq %rbp
retq