// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PagerRollback
SQLITE_PRIVATE int sqlite3PagerRollback(Pager *pPager){
  int rc = SQLITE_OK;                  /* Return code */
  PAGERTRACE(("ROLLBACK %d\n", PAGERID(pPager)));

  /* PagerRollback() is a no-op if called in READER or OPEN state. If
  ** the pager is already in the ERROR state, the rollback is not 
  ** attempted here. Instead, the error code is returned to the caller.
  */
  assert( assert_pager_state(pPager) );
  if( pPager->eState==PAGER_ERROR ) return pPager->errCode;
  if( pPager->eState<=PAGER_READER ) return SQLITE_OK;

  if( pagerUseWal(pPager) ){
    int rc2;
    rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_ROLLBACK, -1);
    rc2 = pager_end_transaction(pPager, pPager->setMaster, 0);
    if( rc==SQLITE_OK ) rc = rc2;
  }else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){
    int eState = pPager->eState;
    rc = pager_end_transaction(pPager, 0, 0);
    if( !MEMDB && eState>PAGER_WRITER_LOCKED ){
      /* This can happen using journal_mode=off. Move the pager to the error 
      ** state to indicate that the contents of the cache may not be trusted.
      ** Any active readers will get SQLITE_ABORT.
      */
      pPager->errCode = SQLITE_ABORT;
      pPager->eState = PAGER_ERROR;
      return rc;
    }
  }else{
    rc = pager_playback(pPager, 0);
  }

  assert( pPager->eState==PAGER_READER || rc!=SQLITE_OK );
  assert( rc==SQLITE_OK || rc==SQLITE_FULL || rc==SQLITE_CORRUPT
          || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR );

  /* If an error occurs during a ROLLBACK, we can no longer trust the pager
  ** cache. So call pager_error() on the way out to make any error persistent.
  */
  return pager_error(pPager, rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x13(%rax), %eax
cmpl $0x6, %eax
jne 0x2686f
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x26952
movq -0x10(%rbp), %rax
movzbl 0x13(%rax), %eax
cmpl $0x1, %eax
jg 0x26888
movl $0x0, -0x4(%rbp)
jmp 0x26952
movq -0x10(%rbp), %rdi
callq 0x211a0
cmpl $0x0, %eax
je 0x268d0
movq -0x10(%rbp), %rdi
movl $0x2, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x26bf0
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movzbl 0x16(%rax), %esi
xorl %edx, %edx
callq 0x26960
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x268ce
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x26943
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
cmpq $0x0, (%rax)
je 0x268eb
movq -0x10(%rbp), %rax
movzbl 0x13(%rax), %eax
cmpl $0x2, %eax
jne 0x26933
movq -0x10(%rbp), %rax
movzbl 0x13(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x26960
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x12(%rax)
jne 0x26931
cmpl $0x2, -0x1c(%rbp)
jle 0x26931
movq -0x10(%rbp), %rax
movl $0x4, 0x2c(%rax)
movq -0x10(%rbp), %rax
movb $0x6, 0x13(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x26952
jmp 0x26941
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x26d50
movl %eax, -0x14(%rbp)
jmp 0x26943
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x21960
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)