// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: blobSeekToRow
static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr){
  int rc;                         /* Error code */
  char *zErr = 0;                 /* Error message */
  Vdbe *v = (Vdbe *)p->pStmt;

  /* Set the value of the SQL statements only variable to integer iRow. 
  ** This is done directly instead of using sqlite3_bind_int64() to avoid 
  ** triggering asserts related to mutexes.
  */
  assert( v->aVar[0].flags&MEM_Int );
  v->aVar[0].u.i = iRow;

  rc = sqlite3_step(p->pStmt);
  if( rc==SQLITE_ROW ){
    u32 type = v->apCsr[0]->aType[p->iCol];
    if( type<12 ){
      zErr = sqlite3MPrintf(p->db, "cannot open value of type %s",
          type==0?"null": type==7?"real": "integer"
      );
      rc = SQLITE_ERROR;
      sqlite3_finalize(p->pStmt);
      p->pStmt = 0;
    }else{
      p->iOffset = v->apCsr[0]->aOffset[p->iCol];
      p->nByte = sqlite3VdbeSerialTypeLen(type);
      p->pCsr =  v->apCsr[0]->pCursor;
      sqlite3BtreeEnterCursor(p->pCsr);
      sqlite3BtreeCacheOverflow(p->pCsr);
      sqlite3BtreeLeaveCursor(p->pCsr);
    }
  }

  if( rc==SQLITE_ROW ){
    rc = SQLITE_OK;
  }else if( p->pStmt ){
    rc = sqlite3_finalize(p->pStmt);
    p->pStmt = 0;
    if( rc==SQLITE_OK ){
      zErr = sqlite3MPrintf(p->db, "no such rowid: %lld", iRow);
      rc = SQLITE_ERROR;
    }else{
      zErr = sqlite3MPrintf(p->db, "%s", sqlite3_errmsg(p->db));
    }
  }

  assert( rc!=SQLITE_OK || zErr==0 );
  assert( rc!=SQLITE_ROW && rc!=SQLITE_DONE );

  *pzErr = zErr;
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
movq 0x18(%rdi), %r13
movq 0x78(%r13), %rax
movq %rsi, 0x18(%rax)
movq 0x18(%rdi), %rdi
callq 0xe65d
cmpl $0x64, %eax
jne 0x10d55
movq 0x70(%r13), %rax
movq (%rax), %rcx
movq 0x70(%rcx), %rax
movslq 0xc(%r14), %rdx
movl (%rax,%rdx,4), %eax
cmpl $0xb, %eax
ja 0x10d94
movq 0x20(%r14), %rdi
cmpl $0x7, %eax
leaq 0x5bcd5(%rip), %rcx     # 0x6c9ee
leaq 0x5bcd3(%rip), %rsi     # 0x6c9f3
cmoveq %rcx, %rsi
testl %eax, %eax
leaq 0x5f534(%rip), %rdx     # 0x70261
cmovneq %rsi, %rdx
leaq 0x5bc99(%rip), %rsi     # 0x6c9d1
xorl %eax, %eax
callq 0x10594
movq %rax, %r12
movq 0x18(%r14), %rdi
callq 0xdbaa
andq $0x0, 0x18(%r14)
jmp 0x10de3
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x10dc4
callq 0xdbaa
andq $0x0, 0x18(%r14)
movq 0x20(%r14), %r14
testl %eax, %eax
je 0x10dcc
movl %eax, %r15d
movq %r14, %rdi
callq 0x11788
leaq 0x5a977(%rip), %rsi     # 0x6b6f9
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x10594
movq %rax, %r12
jmp 0x10de7
movq 0x78(%rcx), %rsi
movl (%rsi,%rdx,4), %edx
movl %edx, 0x8(%r14)
addl $-0xc, %eax
shrl %eax
movl %eax, 0x4(%r14)
movq (%rcx), %r15
movq %r15, 0x10(%r14)
movq %r15, %rdi
callq 0x1e351
movb $0x1, 0x78(%r15)
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x10de7
movl %eax, %r15d
xorl %r12d, %r12d
jmp 0x10de7
leaq 0x5bc28(%rip), %rsi     # 0x6c9fb
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x10594
movq %rax, %r12
pushq $0x1
popq %r15
movq %r12, (%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq