// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::selectNext()
usint
RLEVector::Iterator::selectNext()
{
  if(this->cur >= this->block_items)
  {
    this->getSample(this->block + 1);
    this->run = 0;
    return this->val;
  }

  this->cur++;
  if(this->run > 0)
  {
    this->val++;
    this->run--;
  }
  else
  {
    this->val += this->buffer.readDeltaCode();
    this->run = this->buffer.readDeltaCode() - 1;
  }

  return this->val;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x14(%rdi), %eax
cmpl 0x20(%rdi), %eax
jae 0x13ce1
incl %eax
movl %eax, 0x14(%rbx)
movl 0x1c(%rbx), %r10d
testl %r10d, %r10d
je 0x13cfd
movl 0x18(%rbx), %eax
incl %eax
movl %eax, 0x18(%rbx)
jmp 0x13ee3
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0x135a4
movl $0x0, 0x1c(%rbx)
movl 0x18(%rbx), %eax
jmp 0x13eea
movq 0x28(%rbx), %rdi
movl 0x44(%rbx), %edx
movl 0x40(%rbx), %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %edx, %ecx
decl %ecx
movl %ecx, 0x44(%rbx)
movl %r8d, %edx
movl (%rdi,%rdx,4), %esi
je 0x13d20
movl %ecx, %edx
jmp 0x13d33
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %edx
incl %eax
btl %ecx, %esi
jae 0x13d0d
movl $0x1, %esi
movl %eax, %ecx
shll %cl, %esi
xorl %r9d, %r9d
cmpl %eax, %edx
ja 0x13d75
subl %edx, %eax
movl %r8d, %ecx
movl (%rdi,%rcx,4), %r9d
negb %dl
movl %edx, %ecx
shll %cl, %r9d
shrl %cl, %r9d
movl %eax, %ecx
shll %cl, %r9d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %edx
movl %r8d, %r10d
testl %eax, %eax
je 0x13d97
subl %eax, %edx
movl %edx, 0x44(%rbx)
movl (%rdi,%r10,4), %r11d
movl %edx, %ecx
shrl %cl, %r11d
negb %al
movl %eax, %ecx
shll %cl, %r11d
shrl %cl, %r11d
orl %r11d, %r9d
orl %esi, %r9d
decl %r9d
xorl %eax, %eax
movl %r9d, %esi
subl %edx, %esi
jae 0x13dab
movl %r9d, %esi
jmp 0x13dc7
movl (%rdi,%r10,4), %eax
negb %dl
movl %edx, %ecx
shll %cl, %eax
shrl %cl, %eax
movl %esi, %ecx
shll %cl, %eax
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, %edx
testl %esi, %esi
je 0x13dea
subl %esi, %edx
movl %edx, 0x44(%rbx)
movl %r8d, %ecx
movl (%rdi,%rcx,4), %r10d
movl %edx, %ecx
shrl %cl, %r10d
negb %sil
movl %esi, %ecx
shll %cl, %r10d
shrl %cl, %r10d
orl %r10d, %eax
btsl %r9d, %eax
addl 0x18(%rbx), %eax
movl %eax, 0x18(%rbx)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %edx, %ecx
decl %ecx
movl %ecx, 0x44(%rbx)
movl %r8d, %edx
movl (%rdi,%rdx,4), %r9d
je 0x13e0d
movl %ecx, %edx
jmp 0x13e20
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %edx
incl %esi
btl %ecx, %r9d
jae 0x13df9
movl $0x1, %r10d
movl %esi, %ecx
shll %cl, %r10d
xorl %r9d, %r9d
cmpl %esi, %edx
ja 0x13e65
subl %edx, %esi
movl %r8d, %ecx
movl (%rdi,%rcx,4), %r9d
negb %dl
movl %edx, %ecx
shll %cl, %r9d
shrl %cl, %r9d
movl %esi, %ecx
shll %cl, %r9d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %edx
movl %r8d, %r11d
testl %esi, %esi
je 0x13e85
subl %esi, %edx
movl %edx, 0x44(%rbx)
movl (%rdi,%r11,4), %ebp
movl %edx, %ecx
shrl %cl, %ebp
negb %sil
movl %esi, %ecx
shll %cl, %ebp
shrl %cl, %ebp
orl %ebp, %r9d
orl %r10d, %r9d
decl %r9d
xorl %r10d, %r10d
movl %r9d, %esi
subl %edx, %esi
jae 0x13e9a
movl %r9d, %esi
jmp 0x13ec0
movl (%rdi,%r11,4), %r10d
negb %dl
movl %edx, %ecx
shll %cl, %r10d
shrl %cl, %r10d
movl %esi, %ecx
shll %cl, %r10d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %edx
testl %esi, %esi
je 0x13edf
subl %esi, %edx
movl %edx, 0x44(%rbx)
movl %r8d, %ecx
movl (%rdi,%rcx,4), %edi
movl %edx, %ecx
shrl %cl, %edi
negb %sil
movl %esi, %ecx
shll %cl, %edi
shrl %cl, %edi
orl %edi, %r10d
btsl %r9d, %r10d
decl %r10d
movl %r10d, 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop