// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeReset
SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *p){
  sqlite3 *db;
  db = p->db;

  /* If the VM did not run to completion or if it encountered an
  ** error, then it might not have been halted properly.  So halt
  ** it now.
  */
  sqlite3VdbeHalt(p);

  /* If the VDBE has be run even partially, then transfer the error code
  ** and error message from the VDBE into the main database structure.  But
  ** if the VDBE has just been set to run but has not actually executed any
  ** instructions yet, leave the main database error information unchanged.
  */
  if( p->pc>=0 ){
    vdbeInvokeSqllog(p);
    sqlite3VdbeTransferError(p);
    sqlite3DbFree(db, p->zErrMsg);
    p->zErrMsg = 0;
    if( p->runOnlyOnce ) p->expired = 1;
  }else if( p->rc && p->expired ){
    /* The expired flag was set on the VDBE before the first call
    ** to sqlite3_step(). For consistency (since sqlite3_step() was
    ** called), set the database error in this case as well.
    */
    sqlite3ErrorWithMsg(db, p->rc, p->zErrMsg ? "%s" : 0, p->zErrMsg);
    sqlite3DbFree(db, p->zErrMsg);
    p->zErrMsg = 0;
  }

  /* Reclaim all memory used by the VDBE
  */
  Cleanup(p);

  /* Save profiling information from this VDBE run.
  */
#ifdef VDBE_PROFILE
  {
    FILE *out = fopen("vdbe_profile.out", "a");
    if( out ){
      int i;
      fprintf(out, "---- ");
      for(i=0; i<p->nOp; i++){
        fprintf(out, "%02x", p->aOp[i].opcode);
      }
      fprintf(out, "\n");
      if( p->zSql ){
        char c, pc = 0;
        fprintf(out, "-- ");
        for(i=0; (c = p->zSql[i])!=0; i++){
          if( pc=='\n' ) fprintf(out, "-- ");
          putc(c, out);
          pc = c;
        }
        if( pc!='\n' ) fprintf(out, "\n");
      }
      for(i=0; i<p->nOp; i++){
        char zHdr[100];
        sqlite3_snprintf(sizeof(zHdr), zHdr, "%6u %12llu %8llu ",
           p->aOp[i].cnt,
           p->aOp[i].cycles,
           p->aOp[i].cnt>0 ? p->aOp[i].cycles/p->aOp[i].cnt : 0
        );
        fprintf(out, "%s", zHdr);
        sqlite3VdbePrintOp(out, i, &p->aOp[i]);
      }
      fclose(out);
    }
  }
#endif
  p->iCurrentTime = 0;
  p->magic = VDBE_MAGIC_INIT;
  return p->rc & db->errMask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x357c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x80(%rax)
jl 0x13d5a
movq -0x8(%rbp), %rdi
callq 0x35d60
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0xd260
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movw 0x8c(%rax), %ax
shrw $0x4, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x13d58
movq -0x8(%rbp), %rax
movw 0x8c(%rax), %cx
andw $-0x9, %cx
orw $0x8, %cx
movw %cx, 0x8c(%rax)
jmp 0x13dd9
movq -0x8(%rbp), %rax
cmpl $0x0, 0x84(%rax)
je 0x13dd7
movq -0x8(%rbp), %rax
movw 0x8c(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x13dd7
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x84(%rax), %esi
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x91f19(%rip), %rax     # 0xa5cbc
cmpq $0x0, %rcx
cmovneq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rcx
movb $0x0, %al
callq 0x11390
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0xd260
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
jmp 0x13dd9
movq -0x8(%rbp), %rdi
callq 0x35e20
movq -0x8(%rbp), %rax
movq $0x0, 0xc0(%rax)
movq -0x8(%rbp), %rax
movl $0x26bceaa5, 0x44(%rax) # imm = 0x26BCEAA5
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
movq -0x10(%rbp), %rcx
andl 0x48(%rcx), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)