// File: /workspace/github_c_makefile_star2_O0/ukontainer[P]sqlite-bench/sqlite3.c
// Function: btreePrevious
static SQLITE_NOINLINE int btreePrevious(BtCursor *pCur){
  int rc;
  MemPage *pPage;

  assert( cursorOwnsBtShared(pCur) );
  assert( pCur->skipNext==0 || pCur->eState!=CURSOR_VALID );
  assert( (pCur->curFlags & (BTCF_AtLast|BTCF_ValidOvfl|BTCF_ValidNKey))==0 );
  assert( pCur->info.nSize==0 );
  if( pCur->eState!=CURSOR_VALID ){
    rc = restoreCursorPosition(pCur);
    if( rc!=SQLITE_OK ){
      return rc;
    }
    if( CURSOR_INVALID==pCur->eState ){
      return SQLITE_DONE;
    }
    if( pCur->skipNext ){
      assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_SKIPNEXT );
      pCur->eState = CURSOR_VALID;
      if( pCur->skipNext<0 ){
        pCur->skipNext = 0;
        return SQLITE_OK;
      }
      pCur->skipNext = 0;
    }
  }

  pPage = pCur->pPage;
  assert( pPage->isInit );
  if( !pPage->leaf ){
    int idx = pCur->ix;
    rc = moveToChild(pCur, get4byte(findCell(pPage, idx)));
    if( rc ) return rc;
    rc = moveToRightmost(pCur);
  }else{
    while( pCur->ix==0 ){
      if( pCur->iPage==0 ){
        pCur->eState = CURSOR_INVALID;
        return SQLITE_DONE;
      }
      moveToParent(pCur);
    }
    assert( pCur->info.nSize==0 );
    assert( (pCur->curFlags & (BTCF_ValidOvfl))==0 );

    pCur->ix--;
    pPage = pCur->pPage;
    if( pPage->intKey && !pPage->leaf ){
      rc = sqlite3BtreePrevious(pCur, 0);
    }else{
      rc = SQLITE_OK;
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x446b1f
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3, %eax
jl 0x446aa6
movq -0x10(%rbp), %rdi
callq 0x444a50
movl %eax, -0x28(%rbp)
jmp 0x446aad
xorl %eax, %eax
movl %eax, -0x28(%rbp)
jmp 0x446aad
movl -0x28(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x446ac4
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x446c55
movq -0x10(%rbp), %rax
movzbl (%rax), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x446ae0
movl $0x65, -0x4(%rbp)
jmp 0x446c55
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
je 0x446b1d
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jge 0x446b12
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x446c55
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
jmp 0x446b1f
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpb $0x0, 0x8(%rax)
jne 0x446bc9
movq -0x10(%rbp), %rax
movzwl 0x56(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x20(%rbp), %rax
movzwl 0x18(%rax), %eax
movq -0x20(%rbp), %rcx
movq 0x60(%rcx), %rcx
movl -0x24(%rbp), %edx
shll %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
shll $0x8, %ecx
movq -0x20(%rbp), %rdx
movq 0x60(%rdx), %rdx
movl -0x24(%rbp), %esi
shll %esi
movslq %esi, %rsi
movzbl 0x1(%rdx,%rsi), %edx
orl %edx, %ecx
andl %ecx, %eax
cltq
addq %rax, %rdi
callq 0x420960
movq -0x30(%rbp), %rdi
movl %eax, %esi
callq 0x445210
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x446bb8
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x446c55
movq -0x10(%rbp), %rdi
callq 0x446c60
movl %eax, -0x14(%rbp)
jmp 0x446c4f
jmp 0x446bcb
movq -0x10(%rbp), %rax
movzwl 0x56(%rax), %eax
cmpl $0x0, %eax
jne 0x446c00
movq -0x10(%rbp), %rax
movsbl 0x54(%rax), %eax
cmpl $0x0, %eax
jne 0x446bf5
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movl $0x65, -0x4(%rbp)
jmp 0x446c55
movq -0x10(%rbp), %rdi
callq 0x445180
jmp 0x446bcb
movq -0x10(%rbp), %rax
movw 0x56(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x56(%rax)
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x0, %eax
je 0x446c46
movq -0x20(%rbp), %rax
cmpb $0x0, 0x8(%rax)
jne 0x446c46
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x440320
movl %eax, -0x14(%rbp)
jmp 0x446c4d
movl $0x0, -0x14(%rbp)
jmp 0x446c4f
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop