// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbePmaReaderNext
static int vdbePmaReaderNext(PmaReader *pReadr){
  int rc = SQLITE_OK;             /* Return Code */
  u64 nRec = 0;                   /* Size of record in bytes */


  if( pReadr->iReadOff>=pReadr->iEof ){
    IncrMerger *pIncr = pReadr->pIncr;
    int bEof = 1;
    if( pIncr ){
      rc = vdbeIncrSwap(pIncr);
      if( rc==SQLITE_OK && pIncr->bEof==0 ){
        rc = vdbePmaReaderSeek(
            pIncr->pTask, pReadr, &pIncr->aFile[0], pIncr->iStartOff
        );
        bEof = 0;
      }
    }

    if( bEof ){
      /* This is an EOF condition */
      vdbePmaReaderClear(pReadr);
      testcase( rc!=SQLITE_OK );
      return rc;
    }
  }

  if( rc==SQLITE_OK ){
    rc = vdbePmaReadVarint(pReadr, &nRec);
  }
  if( rc==SQLITE_OK ){
    pReadr->nKey = (int)nRec;
    rc = vdbePmaReadBlob(pReadr, (int)nRec, &pReadr->aKey);
    testcase( rc!=SQLITE_OK );
  }

  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %r13
movq $0x0, 0x8(%rsp)
movq (%rdi), %rax
cmpq 0x8(%rdi), %rax
jge 0x2a4a72
leaq 0x8(%rsp), %rsi
movq %r13, %rdi
callq 0x2a4989
testl %eax, %eax
je 0x2a4aec
movl %eax, %ebp
jmp 0x2a4c32
movq 0x48(%r13), %r14
xorl %ebp, %ebp
testq %r14, %r14
je 0x2a4c2a
movq 0x10(%r14), %rbp
movq (%r14), %rax
movq 0x8(%r14), %rbx
movq 0x38(%r14), %r15
movq 0x10(%rax), %rax
movl 0xc(%rax), %eax
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movslq %eax, %r12
movq %r12, %rdi
callq 0x272ae6
movq %rax, 0x18(%rsp)
testq %rax, %rax
movq %r13, 0x48(%rsp)
movq %rbp, 0x50(%rsp)
je 0x2a4b0e
movq %rbp, %rax
cqto
idivq %r12
movl %edx, 0x24(%rsp)
movl %edx, 0x28(%rsp)
subq %rdx, %rbp
movq %rbp, 0x30(%rsp)
movl %r12d, 0x20(%rsp)
movq %r15, 0x38(%rsp)
jmp 0x2a4b16
movl 0x8(%rsp), %esi
movl %esi, 0x14(%r13)
leaq 0x28(%r13), %rdx
movq %r13, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a4c62
movl $0x7, 0x10(%rsp)
leaq 0x38(%r14), %rax
movq %rax, 0x40(%rsp)
leaq 0x5e(%rsp), %r12
leaq 0x10(%rsp), %r13
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %r15
movslq 0x4(%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
cmpq $0x0, 0x18(%r15,%rax)
je 0x2a4be6
movslq 0x14(%r15,%rax), %rbp
movl $0x1, %ecx
cmpl $0x80, %ebp
jb 0x2a4b74
movq %rbp, %rsi
movq %rbp, %rdx
shrq $0x7, %rdx
incq %rcx
cmpq $0x3fff, %rsi           # imm = 0x3FFF
movq %rdx, %rsi
ja 0x2a4b61
movslq 0x28(%rsp), %rdx
movq 0x30(%rsp), %rsi
addq %rbp, %rsi
addq %rdx, %rsi
addq %rcx, %rsi
movslq 0x18(%r14), %rcx
addq 0x50(%rsp), %rcx
cmpq %rcx, %rsi
jg 0x2a4be6
addq %rax, %r15
movq %r12, %rdi
movq %rbp, %rsi
callq 0x29b924
movq %r13, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x2a43d1
movq 0x28(%r15), %rsi
movq %r13, %rdi
movl %ebp, %edx
callq 0x2a43d1
movq 0x8(%r14), %rdi
leaq 0x58(%rsp), %rsi
callq 0x2a4de4
testl %eax, %eax
je 0x2a4b29
movl %eax, %ebp
leaq 0x40(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2a4473
jmp 0x2a4bf6
leaq 0x40(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x2a4473
movl %eax, %ebp
movq 0x40(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x28(%r14)
movq 0x10(%r14), %rcx
cmpq %rcx, 0x30(%r14)
movq 0x48(%rsp), %r13
jne 0x2a4c1a
movl $0x1, 0x1c(%r14)
testl %ebp, %ebp
jne 0x2a4c2a
cmpl $0x0, 0x1c(%r14)
movl $0x0, %ebp
je 0x2a4c43
movq %r13, %rdi
callq 0x291243
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rdi
addq $0x28, %r14
movq %r13, %rsi
movq %r14, %rdx
callq 0x2a484e
testl %eax, %eax
jne 0x2a4a6b
jmp 0x2a4a56