// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/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 register r[1] in the SQL statement to integer iRow.
  ** This is done directly as a performance optimization
  */
  v->aMem[1].flags = MEM_Int;
  v->aMem[1].u.i = iRow;

  /* If the statement has been run before (and is paused at the OP_ResultRow)
  ** then back it up to the point where it does the OP_NotExists.  This could
  ** have been down with an extra OP_Goto, but simply setting the program
  ** counter is faster. */
  if( v->pc>4 ){
    v->pc = 4;
    assert( v->aOp[v->pc].opcode==OP_NotExists );
    rc = sqlite3VdbeExec(v);
  }else{
    rc = sqlite3_step(p->pStmt);
  }
  if( rc==SQLITE_ROW ){
    VdbeCursor *pC = v->apCsr[0];
    u32 type = pC->nHdrParsed>p->iCol ? pC->aType[p->iCol] : 0;
    testcase( pC->nHdrParsed==p->iCol );
    testcase( pC->nHdrParsed==p->iCol+1 );
    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 = pC->aType[p->iCol + pC->nField];
      p->nByte = sqlite3VdbeSerialTypeLen(type);
      p->pCsr =  pC->uc.pCursor;
      sqlite3BtreeIncrblobCursor(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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %r13
movq 0x68(%r13), %rax
movw $0x4, 0x40(%rax)
movq %rsi, 0x38(%rax)
cmpl $0x5, 0x34(%r13)
jl 0x28562d
movl $0x4, 0x34(%r13)
movq %r13, %rdi
callq 0x29c738
jmp 0x285636
movq 0x18(%r15), %rdi
callq 0x282502
movl %eax, %ebp
xorl %r12d, %r12d
cmpl $0x64, %eax
jne 0x2856fb
movq 0x78(%r13), %rax
movq (%rax), %rax
movzwl 0x8(%r15), %edx
xorl %ecx, %ecx
cmpw %dx, 0x4a(%rax)
jbe 0x28565c
movl 0x70(%rax,%rdx,4), %ecx
cmpl $0xb, %ecx
ja 0x2856b0
movq 0x20(%r15), %rdi
cmpl $0x7, %ecx
leaq 0x15af06(%rip), %rax    # 0x3e0575
leaq 0x14c052(%rip), %rsi    # 0x3d16c8
cmoveq %rax, %rsi
testl %ecx, %ecx
leaq 0x1443a9(%rip), %rdx    # 0x3c9a2c
cmovneq %rsi, %rdx
leaq 0x15aeca(%rip), %rsi    # 0x3e0558
xorl %eax, %eax
callq 0x284f95
movq %rax, %r12
movq 0x18(%r15), %rdi
callq 0x2817e7
movq $0x0, 0x18(%r15)
movl $0x1, %ebp
jmp 0x2856fb
movswq 0x48(%rax), %rsi
addq %rdx, %rsi
movl 0x70(%rax,%rsi,4), %edx
movl %edx, 0x4(%r15)
cmpl $0x80, %ecx
jb 0x2856cf
addl $-0xc, %ecx
shrl %ecx
jmp 0x2856dc
movl %ecx, %ecx
leaq 0x155f18(%rip), %rdx    # 0x3db5f0
movzbl (%rcx,%rdx), %ecx
movl %ecx, (%r15)
movq 0x30(%rax), %rax
movq %rax, 0x10(%r15)
orb $0x10, 0x1(%rax)
movq 0x8(%rax), %rax
movb $0x1, 0x13(%rax)
movl $0x64, %ebp
xorl %r12d, %r12d
cmpl $0x64, %ebp
jne 0x285704
xorl %ebp, %ebp
jmp 0x285761
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x285761
callq 0x2817e7
movq $0x0, 0x18(%r15)
movq 0x20(%r15), %r15
testl %eax, %eax
je 0x285745
movl %eax, %ebp
movq %r15, %rdi
callq 0x286451
leaq 0x14ca9e(%rip), %rsi    # 0x3d21d1
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x284f95
movq %rax, %r12
jmp 0x285761
leaq 0x15ae2e(%rip), %rsi    # 0x3e057a
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x284f95
movq %rax, %r12
movl $0x1, %ebp
movq %r12, (%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq