// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/eis-sequencemultiread.c
// Function: seqReaderSetRead
static size_t
seqReaderSetRead(void *src, void *dest, size_t len)
{
  struct seqReaderState *state = src;
  struct seqReaderSet *readerSet;
  GtUword pos;
  size_t elemsLeft;
  gt_assert(src);
  readerSet = state->readerSet;
  elemsLeft = len;
  pos = seqReaderSetGetConsumerNextPos(state);
  while (elemsLeft)
  {
    if (pos >= readerSet->backlogStartPos + readerSet->backlogLen)
    {
      /* pos is in block that's governed by generator */
      size_t elemsGenerated =
        readerSet->generator(readerSet->generatorState, readerSet,
                             seqReaderSetMove2Backlog, dest, pos, elemsLeft,
                             state->xltor);
      seqReaderSetSetConsumerNextPos(state, pos += elemsGenerated);
      elemsLeft -= elemsGenerated;
      break;
    }
    else if (pos >= readerSet->backlogStartPos
             /* implicit because of above condition
                && pos < readerSet->backlogStartPos + readerSet->backlogLen */
      )
    {
      /* pos is in backlog */
      GtUword subLen, charsWritten;

      subLen = GT_MIN(elemsLeft, readerSet->backlogStartPos - pos
                              + readerSet->backlogLen);
      gt_assert(state->xltor.translateData == NULL);
      /*
      charsWritten = SDRTranslate(state->xltor, dest,
                                  (char *)readerSet->seqDataBacklog
                                  + (pos - readerSet->backlogStartPos)
                                  * readerSet->backlogElemSize,
                                  subLen);
      */
      memcpy(dest, (char *)readerSet->seqDataBacklog
                   + (pos - readerSet->backlogStartPos)
                   * readerSet->backlogElemSize,
             subLen * state->xltor.state.elemSize);
      charsWritten = subLen * state->xltor.state.elemSize;
      elemsLeft -= subLen;
      seqReaderSetSetConsumerNextPos(state, pos += subLen);
      dest = (char *)dest + charsWritten;
    }
    else
    {
      fprintf(stderr, "fatal error at file %s, line %d\n", __FILE__, __LINE__);
      abort();
    }
  }
  return len - elemsLeft;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x70(%rsp)
jne 0x22be7d
movq 0x410154(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2ea1bd(%rip), %rsi    # 0x516013
leaq 0x3035f0(%rip), %rdx    # 0x52f44d
leaq 0x34a21c(%rip), %rcx    # 0x576080
leaq 0x34a1af(%rip), %r8     # 0x57601a
movl $0xb2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22be7f
movq 0x58(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rdi
callq 0x22c150
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x22c0c2
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
movq 0x20(%rcx), %rcx
movq 0x50(%rsp), %rdx
addq 0x38(%rdx), %rcx
cmpq %rcx, %rax
jb 0x22bf58
movq 0x50(%rsp), %rax
movq 0x58(%rax), %rax
movq 0x50(%rsp), %rcx
movq 0x50(%rcx), %rdi
movq 0x50(%rsp), %rsi
movq 0x68(%rsp), %rcx
movq 0x48(%rsp), %r8
movq 0x40(%rsp), %r9
movq 0x58(%rsp), %r10
addq $0x30, %r10
leaq 0x298(%rip), %rdx       # 0x22c1a0
movq (%r10), %r11
movq %r11, (%rsp)
movq 0x8(%r10), %r11
movq %r11, 0x8(%rsp)
movq 0x10(%r10), %r10
movq %r10, 0x10(%rsp)
callq *%rax
movq %rax, 0x38(%rsp)
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rsi
addq 0x48(%rsp), %rsi
movq %rsi, 0x48(%rsp)
callq 0x22c5c0
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x40(%rsp)
jmp 0x22c0c2
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jb 0x22c092
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rcx
movq 0x20(%rcx), %rcx
subq 0x48(%rsp), %rcx
movq 0x50(%rsp), %rdx
addq 0x38(%rdx), %rcx
cmpq %rcx, %rax
jae 0x22bf99
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x22bfb5
movq 0x50(%rsp), %rax
movq 0x20(%rax), %rax
subq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
addq 0x38(%rcx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x38(%rax)
je 0x22c003
movq 0x40ffce(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2ea037(%rip), %rsi    # 0x516013
leaq 0x34a0ae(%rip), %rdx    # 0x576091
leaq 0x34a096(%rip), %rcx    # 0x576080
leaq 0x34a029(%rip), %r8     # 0x57601a
movl $0xcd, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22c005
movq 0x68(%rsp), %rdi
movq 0x50(%rsp), %rax
movq 0x48(%rax), %rsi
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
subq 0x20(%rcx), %rax
movq 0x50(%rsp), %rcx
imulq 0x40(%rcx), %rax
addq %rax, %rsi
movq 0x30(%rsp), %rdx
movq 0x58(%rsp), %rax
imulq 0x30(%rax), %rdx
callq 0x19610
movq 0x30(%rsp), %rax
movq 0x58(%rsp), %rcx
imulq 0x30(%rcx), %rax
movq %rax, 0x28(%rsp)
movq 0x30(%rsp), %rcx
movq 0x40(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq 0x48(%rsp), %rsi
movq %rsi, 0x48(%rsp)
callq 0x22c5c0
movq 0x68(%rsp), %rax
addq 0x28(%rsp), %rax
movq %rax, 0x68(%rsp)
jmp 0x22c0bb
movq 0x40ff07(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x34a011(%rip), %rsi    # 0x5760b4
leaq 0x349f70(%rip), %rdx    # 0x57601a
movl $0xe0, %ecx
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x22c0bd
jmp 0x22bea6
movq 0x60(%rsp), %rax
subq 0x40(%rsp), %rax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)