// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rax
movw $0x4, 0x40(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rax
cmpl $0x4, 0x34(%rax)
jle 0x3cc1c9
movq -0x30(%rbp), %rax
movl $0x4, 0x34(%rax)
movq -0x30(%rbp), %rdi
callq 0x3f0470
movl %eax, -0x1c(%rbp)
jmp 0x3cc1d9
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3c8c30
movl %eax, -0x1c(%rbp)
cmpl $0x64, -0x1c(%rbp)
jne 0x3cc2f8
movq -0x30(%rbp), %rax
movq 0x78(%rax), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movzwl 0x4a(%rax), %eax
movq -0x8(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
cmpl %ecx, %eax
jle 0x3cc21b
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
movl 0x70(%rax,%rcx,4), %eax
movl %eax, -0x40(%rbp)
jmp 0x3cc222
xorl %eax, %eax
movl %eax, -0x40(%rbp)
jmp 0x3cc222
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc, -0x3c(%rbp)
jae 0x3cc2a5
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x3cc24d
leaq 0x1c7382(%rip), %rax    # 0x5935c9
movq %rax, -0x50(%rbp)
jmp 0x3cc269
movl -0x3c(%rbp), %edx
leaq 0x1cf2c6(%rip), %rax    # 0x59b51d
leaq 0x1e0053(%rip), %rcx    # 0x5ac2b1
cmpl $0x7, %edx
cmoveq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x1e001c(%rip), %rsi    # 0x5ac294
movb $0x0, %al
callq 0x3cb7d0
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3c7180
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x3cc2f6
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
movq -0x38(%rbp), %rdx
movswl 0x48(%rdx), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movl 0x70(%rax,%rcx,4), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x3c(%rbp), %edi
callq 0x3fa6e0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4108f0
jmp 0x3cc2f8
cmpl $0x64, -0x1c(%rbp)
jne 0x3cc30a
movl $0x0, -0x1c(%rbp)
jmp 0x3cc394
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x3cc392
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3c7180
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
cmpl $0x0, -0x1c(%rbp)
jne 0x3cc35e
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1dff6c(%rip), %rsi    # 0x5ac2b6
movb $0x0, %al
callq 0x3cb7d0
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
jmp 0x3cc390
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x3cd3f0
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x1cfc9c(%rip), %rsi    # 0x59c021
movb $0x0, %al
callq 0x3cb7d0
movq %rax, -0x28(%rbp)
jmp 0x3cc392
jmp 0x3cc394
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)