// File: /workspace/github_c_makefile_star2_O3/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3AutoincrementEnd
SQLITE_PRIVATE void sqlite3AutoincrementEnd(Parse *pParse){
  AutoincInfo *p;
  Vdbe *v = pParse->pVdbe;
  sqlite3 *db = pParse->db;

  assert( v );
  for(p = pParse->pAinc; p; p = p->pNext){
    Db *pDb = &db->aDb[p->iDb];
    int addr1;
    int iRec;
    int memId = p->regCtr;

    iRec = sqlite3GetTempReg(pParse);
    assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
    sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
    addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, memId+1); VdbeCoverage(v);
    sqlite3VdbeAddOp2(v, OP_NewRowid, 0, memId+1);
    sqlite3VdbeJumpHere(v, addr1);
    sqlite3VdbeAddOp3(v, OP_MakeRecord, memId-1, 2, iRec);
    sqlite3VdbeAddOp3(v, OP_Insert, 0, iRec, memId+1);
    sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
    sqlite3VdbeAddOp0(v, OP_Close);
    sqlite3ReleaseTempReg(pParse, iRec);
  }
}

// Assembly:
movq 0x1b8(%rdi), %rcx
testq %rcx, %rcx
je 0x6a19d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %r14
movq (%rdi), %rax
movq %rax, -0x40(%rbp)
leaq 0x294de(%rip), %r12     # 0x934f8
movq %rdi, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movslq 0x10(%rcx), %rdx
movq %rcx, -0x48(%rbp)
movl 0x14(%rcx), %r13d
movb 0x1f(%rdi), %cl
testb %cl, %cl
je 0x6a048
decb %cl
movb %cl, 0x1f(%rdi)
movzbl %cl, %ecx
movl 0x24(%rdi,%rcx,4), %r15d
jmp 0x6a053
movl 0x54(%rdi), %r15d
incl %r15d
movl %r15d, 0x54(%rdi)
movq %rdx, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rax
movq 0x68(%rax), %rcx
xorl %esi, %esi
movl $0x38, %r8d
callq 0x4f965
leal 0x1(%r13), %ebx
movq %r14, %rdi
movl $0x4d, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
movl $0x54, %esi
xorl %edx, %edx
movl %ebx, -0x30(%rbp)
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl 0x3c(%r14), %eax
leal -0x1(%rax), %ecx
movq 0x30(%r14), %rdx
movl %ecx, 0x68(%rdx)
movq (%r14), %rdx
cmpb $0x0, 0x51(%rdx)
movq %r12, %rdx
jne 0x6a0d3
movl -0x2c(%rbp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rdx
shlq $0x3, %rdx
addq 0x8(%r14), %rdx
movl %eax, 0x8(%rdx)
decl %r13d
movq %r14, %rdi
movl $0x32, %esi
movl %r13d, %edx
movl $0x2, %ecx
movl %r15d, %r8d
callq 0x3ea9f
movq %r14, %rdi
movl $0x5f, %esi
xorl %edx, %edx
movl %r15d, %ecx
movl -0x30(%rbp), %r8d
callq 0x3ea9f
movq (%r14), %rax
cmpb $0x0, 0x51(%rax)
movq %r12, %rax
jne 0x6a127
movslq 0x3c(%r14), %rax
movq 0x8(%r14), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $-0x18, %rax
movb $0x8, 0x3(%rax)
movq %r14, %rdi
movl $0x3e, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
testl %r15d, %r15d
movq -0x38(%rbp), %rdi
je 0x6a17f
movzbl 0x1f(%rdi), %eax
cmpq $0x7, %rax
ja 0x6a17f
xorl %ecx, %ecx
cmpl %r15d, 0x94(%rdi,%rcx)
je 0x6a177
addq $0x14, %rcx
cmpl $0xc8, %ecx
jne 0x6a154
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rdi)
movl %r15d, 0x24(%rdi,%rax,4)
jmp 0x6a17f
movb $0x1, 0x8e(%rdi,%rcx)
movq -0x48(%rbp), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x6a01e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq