// File: /workspace/github_c_makefile_star2_O1/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, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %rbx
movq 0x78(%rbx), %rax
movq %rsi, 0x18(%rax)
movq 0x18(%rdi), %rdi
callq 0xf4d2
xorl %r13d, %r13d
cmpl $0x64, %eax
jne 0x12029
movq 0x70(%rbx), %rax
movq (%rax), %rcx
movq 0x70(%rcx), %rax
movslq 0xc(%r15), %rdx
movl (%rax,%rdx,4), %eax
cmpl $0xb, %eax
ja 0x1202e
movq 0x20(%r15), %rdi
cmpl $0x7, %eax
leaq 0x689e7(%rip), %rcx     # 0x7a9ce
leaq 0x689e5(%rip), %rsi     # 0x7a9d3
cmoveq %rcx, %rsi
testl %eax, %eax
leaq 0x6c29a(%rip), %rdx     # 0x7e295
cmovneq %rsi, %rdx
leaq 0x689ab(%rip), %rsi     # 0x7a9b1
xorl %eax, %eax
callq 0x117e2
movq %rax, %r13
movq 0x18(%r15), %rdi
callq 0xe974
movq $0x0, 0x18(%r15)
movl $0x1, %r12d
jmp 0x12067
movl %eax, %r12d
jmp 0x12067
movq 0x78(%rcx), %rsi
movl (%rsi,%rdx,4), %edx
movl %edx, 0x8(%r15)
addl $-0xc, %eax
shrl %eax
movl %eax, 0x4(%r15)
movq (%rcx), %rbx
movq %rbx, 0x10(%r15)
movq 0x28(%rbx), %rdi
callq 0xa2e8
movq $0x0, 0x28(%rbx)
movb $0x1, 0x78(%rbx)
movl $0x64, %r12d
xorl %r13d, %r13d
cmpl $0x64, %r12d
jne 0x12072
xorl %r12d, %r12d
jmp 0x120d1
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x120d1
callq 0xe974
movq $0x0, 0x18(%r15)
movq 0x20(%r15), %r15
testl %eax, %eax
je 0x120b4
movl %eax, %r12d
movq %r15, %rdi
callq 0x12bfd
leaq 0x67637(%rip), %rsi     # 0x796d9
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x117e2
movq %rax, %r13
jmp 0x120d1
leaq 0x68920(%rip), %rsi     # 0x7a9db
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x117e2
movq %rax, %r13
movl $0x1, %r12d
movq -0x30(%rbp), %rax
movq %r13, (%rax)
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq