// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3Step
static int sqlite3Step(Vdbe *p){
  sqlite3 *db;
  int rc;

  assert(p);
  if( p->magic!=VDBE_MAGIC_RUN ){
    /* We used to require that sqlite3_reset() be called before retrying
    ** sqlite3_step() after any error or after SQLITE_DONE.  But beginning
    ** with version 3.7.0, we changed this so that sqlite3_reset() would
    ** be called automatically instead of throwing the SQLITE_MISUSE error.
    ** This "automatic-reset" change is not technically an incompatibility, 
    ** since any application that receives an SQLITE_MISUSE is broken by
    ** definition.
    **
    ** Nevertheless, some published applications that were originally written
    ** for version 3.6.23 or earlier do in fact depend on SQLITE_MISUSE 
    ** returns, and those were broken by the automatic-reset change.  As a
    ** a work-around, the SQLITE_OMIT_AUTORESET compile-time restores the
    ** legacy behavior of returning SQLITE_MISUSE for cases where the 
    ** previous sqlite3_step() returned something other than a SQLITE_LOCKED
    ** or SQLITE_BUSY error.
    */
#ifdef SQLITE_OMIT_AUTORESET
    if( (rc = p->rc&0xff)==SQLITE_BUSY || rc==SQLITE_LOCKED ){
      sqlite3_reset((sqlite3_stmt*)p);
    }else{
      return SQLITE_MISUSE_BKPT;
    }
#else
    sqlite3_reset((sqlite3_stmt*)p);
#endif
  }

  /* Check that malloc() has not failed. If it has, return early. */
  db = p->db;
  if( db->mallocFailed ){
    p->rc = SQLITE_NOMEM;
    return SQLITE_NOMEM;
  }

  if( p->pc<=0 && p->expired ){
    p->rc = SQLITE_SCHEMA;
    rc = SQLITE_ERROR;
    goto end_of_step;
  }
  if( p->pc<0 ){
    /* If there are no other statements currently running, then
    ** reset the interrupt flag.  This prevents a call to sqlite3_interrupt
    ** from interrupting a statement that has not yet started.
    */
    if( db->nVdbeActive==0 ){
      db->u1.isInterrupted = 0;
    }

    assert( db->nVdbeWrite>0 || db->autoCommit==0 
        || (db->nDeferredCons==0 && db->nDeferredImmCons==0)
    );

#ifndef SQLITE_OMIT_TRACE
    if( db->xProfile && !db->init.busy && p->zSql ){
      sqlite3OsCurrentTimeInt64(db->pVfs, &p->startTime);
    }else{
      assert( p->startTime==0 );
    }
#endif

    db->nVdbeActive++;
    if( p->readOnly==0 ) db->nVdbeWrite++;
    if( p->bIsReader ) db->nVdbeRead++;
    p->pc = 0;
  }
#ifdef SQLITE_DEBUG
  p->rcApp = SQLITE_OK;
#endif
#ifndef SQLITE_OMIT_EXPLAIN
  if( p->explain ){
    rc = sqlite3VdbeList(p);
  }else
#endif /* SQLITE_OMIT_EXPLAIN */
  {
    db->nVdbeExec++;
    rc = sqlite3VdbeExec(p);
    db->nVdbeExec--;
  }

#ifndef SQLITE_OMIT_TRACE
  /* If the statement completed successfully, invoke the profile callback */
  if( rc!=SQLITE_ROW ) checkProfileCallback(db, p);
#endif

  if( rc==SQLITE_DONE ){
    assert( p->rc==SQLITE_OK );
    p->rc = doWalCallbacks(db);
    if( p->rc!=SQLITE_OK ){
      rc = SQLITE_ERROR;
    }
  }

  db->errCode = rc;
  if( SQLITE_NOMEM==sqlite3ApiExit(p->db, p->rc) ){
    p->rc = SQLITE_NOMEM;
  }
end_of_step:
  /* At this point local variable rc holds the value that should be 
  ** returned if this statement was compiled using the legacy 
  ** sqlite3_prepare() interface. According to the docs, this can only
  ** be one of the values in the first assert() below. Variable p->rc 
  ** contains the value that would be returned if sqlite3_finalize() 
  ** were called on statement p.
  */
  assert( rc==SQLITE_ROW  || rc==SQLITE_DONE   || rc==SQLITE_ERROR 
       || (rc&0xff)==SQLITE_BUSY || rc==SQLITE_MISUSE
  );
  assert( (p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE) || p->rc==p->rcApp );
  if( p->isPrepareV2 && rc!=SQLITE_ROW && rc!=SQLITE_DONE ){
    /* If this statement was prepared using sqlite3_prepare_v2(), and an
    ** error has occurred, then return the error code in p->rc to the
    ** caller. Set the error code in the database handle to the same value.
    */ 
    rc = sqlite3VdbeTransferError(p);
  }
  return (rc&db->errMask);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0xbdf20da3, 0x44(%rax) # imm = 0xBDF20DA3
je 0x154c2
movq -0x10(%rbp), %rdi
callq 0xb120
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, 0x51(%rax)
je 0x154f1
movq -0x10(%rbp), %rax
movl $0x7, 0x84(%rax)
movl $0x7, -0x4(%rbp)
jmp 0x15746
movq -0x10(%rbp), %rax
cmpl $0x0, 0x80(%rax)
jg 0x15533
movq -0x10(%rbp), %rax
movw 0x8c(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x15533
movq -0x10(%rbp), %rax
movl $0x11, 0x84(%rax)
movl $0x1, -0x1c(%rbp)
jmp 0x15706
movq -0x10(%rbp), %rax
cmpl $0x0, 0x80(%rax)
jge 0x15620
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa4(%rax)
jne 0x1555f
movq -0x18(%rbp), %rax
movl $0x0, 0x148(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
je 0x155a1
movq -0x18(%rbp), %rax
cmpb $0x0, 0xa1(%rax)
jne 0x155a1
movq -0x10(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
je 0x155a1
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0xb8, %rsi
callq 0x35660
jmp 0x155a3
jmp 0x155a3
movq -0x18(%rbp), %rax
movl 0xa4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa4(%rax)
movq -0x10(%rbp), %rax
movw 0x8c(%rax), %ax
shrw $0x6, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
jne 0x155e4
movq -0x18(%rbp), %rax
movl 0xac(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xac(%rax)
movq -0x10(%rbp), %rax
movw 0x8c(%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x15612
movq -0x18(%rbp), %rax
movl 0xa8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xa8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x80(%rax)
movq -0x10(%rbp), %rax
movw 0x8c(%rax), %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x15645
movq -0x10(%rbp), %rdi
callq 0x3a0b0
movl %eax, -0x1c(%rbp)
jmp 0x15677
movq -0x18(%rbp), %rax
movl 0xb0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xb0(%rax)
movq -0x10(%rbp), %rdi
callq 0x3a680
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl 0xb0(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xb0(%rax)
cmpl $0x64, -0x1c(%rbp)
je 0x1569a
movq -0x10(%rbp), %rax
cmpq $0x0, 0xb8(%rax)
jle 0x15698
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x13b20
jmp 0x1569a
cmpl $0x65, -0x1c(%rbp)
jne 0x156cb
movq -0x18(%rbp), %rdi
callq 0x424b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x84(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x84(%rax)
je 0x156c9
movl $0x1, -0x1c(%rbp)
jmp 0x156cb
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x84(%rax), %esi
callq 0x13be0
movl %eax, %ecx
movl $0x7, %eax
cmpl %ecx, %eax
jne 0x15704
movq -0x10(%rbp), %rax
movl $0x7, 0x84(%rax)
jmp 0x15706
movq -0x10(%rbp), %rax
movw 0x8c(%rax), %ax
shrw $0x8, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x15739
cmpl $0x64, -0x1c(%rbp)
je 0x15739
cmpl $0x65, -0x1c(%rbp)
je 0x15739
movq -0x10(%rbp), %rdi
callq 0x35d60
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
andl 0x48(%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop