// File: /workspace/github_c_makefile_star2_O0/skeeto[P]flappy/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 ){
    VdbeCursor *pC = v->apCsr[0];
    u32 type = pC->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 = pC->aType[p->iCol + pC->nField];
      p->nByte = sqlite3VdbeSerialTypeLen(type);
      p->pCsr =  pC->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
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 -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x78(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x141e0
movl %eax, -0x1c(%rbp)
cmpl $0x64, -0x1c(%rbp)
jne 0x1765d
movq -0x30(%rbp), %rax
movq 0x70(%rax), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0xc(%rcx), %rcx
movl 0x70(%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc, -0x3c(%rbp)
jae 0x175f1
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x48(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x17599
leaq 0x8199f(%rip), %rax     # 0x98f32
movq %rax, -0x50(%rbp)
jmp 0x175b5
movl -0x3c(%rbp), %edx
leaq 0x82d13(%rip), %rax     # 0x9a2b6
leaq 0x82d07(%rip), %rcx     # 0x9a2b1
cmpl $0x7, %edx
cmoveq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x82cd0(%rip), %rsi     # 0x9a294
movb $0x0, %al
callq 0x16a10
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x12d20
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x1765b
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0xc(%rcx), %ecx
movq -0x38(%rbp), %rdx
movswl 0x20(%rdx), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movl 0x70(%rax,%rcx,4), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x3c(%rbp), %edi
callq 0x3fbe0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x38(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4f0c0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4f0e0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4f110
jmp 0x1765d
cmpl $0x64, -0x1c(%rbp)
jne 0x1766f
movl $0x0, -0x1c(%rbp)
jmp 0x176f9
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x176f7
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x12d20
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
cmpl $0x0, -0x1c(%rbp)
jne 0x176c3
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x82c0f(%rip), %rsi     # 0x9a2be
movb $0x0, %al
callq 0x16a10
movq %rax, -0x28(%rbp)
movl $0x1, -0x1c(%rbp)
jmp 0x176f5
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x18710
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x81869(%rip), %rsi     # 0x98f53
movb $0x0, %al
callq 0x16a10
movq %rax, -0x28(%rbp)
jmp 0x176f7
jmp 0x176f9
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)