// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq $0x0, 0x8(%rsp)
movq (%rdi), %rax
xorl %ebp, %ebp
cmpq 0x8(%rdi), %rax
jl 0x2ae7a6
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0x2ae641
movq %rbx, 0x60(%rsp)
movq 0x10(%r14), %r15
movq (%r14), %rax
movq 0x8(%r14), %rbx
movq 0x38(%r14), %r13
movq 0x10(%rax), %rax
movl 0xc(%rax), %eax
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movslq %eax, %r12
movq %r12, %rdi
callq 0x27c381
movq %rax, 0x28(%rsp)
testq %rax, %rax
je 0x2ae64a
movq %r15, %rax
cqto
idivq %r12
movl %edx, 0x34(%rsp)
movl %edx, 0x38(%rsp)
movq %r15, %rax
subq %rdx, %rax
movq %rax, 0x40(%rsp)
movl %r12d, 0x30(%rsp)
movq %r13, 0x48(%rsp)
jmp 0x2ae652
xorl %ebp, %ebp
xorl %eax, %eax
jmp 0x2ae7a2
movl $0x7, 0x20(%rsp)
leaq 0x38(%r14), %rax
movq %rax, 0x58(%rsp)
xorl %r13d, %r13d
testl %r13d, %r13d
jne 0x2ae740
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %r12
movslq 0x4(%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
cmpq $0x0, 0x18(%r12,%rax)
je 0x2ae733
movslq 0x14(%r12,%rax), %rbp
movl $0x1, %ecx
cmpl $0x80, %ebp
jb 0x2ae6b2
movq %rbp, %rsi
movq %rbp, %rdx
shrq $0x7, %rdx
incq %rcx
cmpq $0x3fff, %rsi           # imm = 0x3FFF
movq %rdx, %rsi
ja 0x2ae69f
movslq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
addq %rbp, %rsi
addq %rdx, %rsi
addq %rcx, %rsi
movslq 0x18(%r14), %rdx
addq %r15, %rdx
xorl %r13d, %r13d
movl $0x0, %ecx
cmpq %rdx, %rsi
jg 0x2ae738
addq %rax, %r12
leaq 0x14(%rsp), %rdi
movq %rbp, %rsi
callq 0x2a4a2b
movq %rbx, %r13
movq %r14, %rbx
movq %r15, %r14
leaq 0x20(%rsp), %r15
movq %r15, %rdi
leaq 0x14(%rsp), %rsi
movl %eax, %edx
callq 0x2adf3f
movq 0x28(%r12), %rsi
movq %r15, %rdi
movq %r14, %r15
movq %rbx, %r14
movq %r13, %rbx
movl %ebp, %edx
callq 0x2adf3f
movq 0x8(%r14), %rdi
leaq 0x14(%rsp), %rsi
callq 0x2ae98a
movl %eax, %r13d
movb $0x1, %cl
jmp 0x2ae738
xorl %r13d, %r13d
xorl %ecx, %ecx
testb %cl, %cl
jne 0x2ae65e
leaq 0x40(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0x2adfe1
movl %eax, %ebp
testl %r13d, %r13d
cmovnel %r13d, %ebp
movq 0x58(%rsp), %rax
movups (%rax), %xmm0
movups %xmm0, 0x28(%r14)
movq 0x10(%r14), %rcx
cmpq %rcx, 0x30(%r14)
jne 0x2ae776
movl $0x1, 0x1c(%r14)
xorl %eax, %eax
testl %ebp, %ebp
movq 0x60(%rsp), %rbx
jne 0x2ae7a2
cmpl $0x0, 0x1c(%r14)
je 0x2ae78c
xorl %ebp, %ebp
jmp 0x2ae7a2
movq (%r14), %rdi
addq $0x28, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2ae3b3
movl %eax, %ebp
movb $0x1, %al
testb %al, %al
je 0x2ae7db
testl %ebp, %ebp
jne 0x2ae7b9
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2ae4fc
movl %eax, %ebp
testl %ebp, %ebp
jne 0x2ae7e3
movl 0x8(%rsp), %esi
movl %esi, 0x14(%rbx)
leaq 0x28(%rbx), %rdx
movq %rbx, %rdi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2ae7f4
movq %rbx, %rdi
callq 0x29af68
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq