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

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

  return pair_type(this->val, this->sample.first + this->cur);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %eax
cmpl 0x20(%rdi), %eax
jae 0x13d32
incl %eax
movl %eax, 0x14(%rbx)
movl 0x1c(%rbx), %r9d
testl %r9d, %r9d
je 0x13d4e
incl 0x18(%rbx)
jmp 0x13f3c
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0x130d8
movl $0x0, 0x1c(%rbx)
movl 0xc(%rbx), %eax
jmp 0x13f46
movq 0x28(%rbx), %rdi
movl 0x44(%rbx), %esi
movl 0x40(%rbx), %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
decl %esi
movl %esi, 0x44(%rbx)
movl %ecx, %r8d
movl (%rdi,%r8,4), %r8d
je 0x13d70
movl %esi, %r9d
jmp 0x13d82
incl %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %r9d
incl %edx
btl %esi, %r8d
movl %r9d, %esi
jae 0x13d5d
movl $0x1, %esi
movl %edx, %ecx
shll %cl, %esi
movl 0x44(%rbx), %ecx
xorl %r8d, %r8d
cmpl %edx, %ecx
ja 0x13dc5
subl %ecx, %edx
movl 0x40(%rbx), %r9d
movl (%rdi,%r9,4), %r8d
negb %cl
shll %cl, %r8d
shrl %cl, %r8d
movl %edx, %ecx
shll %cl, %r8d
leal 0x1(%r9), %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
testl %edx, %edx
je 0x13de9
movl 0x40(%rbx), %r9d
movl 0x44(%rbx), %ecx
subl %edx, %ecx
movl %ecx, 0x44(%rbx)
movl (%rdi,%r9,4), %r9d
shrl %cl, %r9d
negb %dl
movl %edx, %ecx
shll %cl, %r9d
shrl %cl, %r9d
orl %r9d, %r8d
orl %esi, %r8d
decl %r8d
movl 0x44(%rbx), %ecx
xorl %r9d, %r9d
movl %r8d, %esi
movl %r8d, %edx
subl %ecx, %esi
jb 0x13e22
movl 0x40(%rbx), %edx
movl (%rdi,%rdx,4), %r9d
negb %cl
shll %cl, %r9d
shrl %cl, %r9d
movl %esi, %ecx
shll %cl, %r9d
leal 0x1(%rdx), %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl %esi, %edx
testl %edx, %edx
je 0x13e41
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %ecx
subl %edx, %ecx
movl %ecx, 0x44(%rbx)
movl (%rdi,%rsi,4), %esi
shrl %cl, %esi
negb %dl
movl %edx, %ecx
shll %cl, %esi
shrl %cl, %esi
orl %esi, %r9d
btsl %r8d, %r9d
addl %r9d, 0x18(%rbx)
movl 0x40(%rbx), %ecx
movl 0x44(%rbx), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
decl %esi
movl %esi, 0x44(%rbx)
movl %ecx, %r8d
movl (%rdi,%r8,4), %r8d
je 0x13e67
movl %esi, %r9d
jmp 0x13e79
incl %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %r9d
incl %edx
btl %esi, %r8d
movl %r9d, %esi
jae 0x13e54
movl $0x1, %esi
movl %edx, %ecx
shll %cl, %esi
movl 0x44(%rbx), %ecx
xorl %r8d, %r8d
cmpl %edx, %ecx
ja 0x13ebc
subl %ecx, %edx
movl 0x40(%rbx), %r9d
movl (%rdi,%r9,4), %r8d
negb %cl
shll %cl, %r8d
shrl %cl, %r8d
movl %edx, %ecx
shll %cl, %r8d
leal 0x1(%r9), %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
testl %edx, %edx
je 0x13ee0
movl 0x40(%rbx), %r9d
movl 0x44(%rbx), %ecx
subl %edx, %ecx
movl %ecx, 0x44(%rbx)
movl (%rdi,%r9,4), %r9d
shrl %cl, %r9d
negb %dl
movl %edx, %ecx
shll %cl, %r9d
shrl %cl, %r9d
orl %r9d, %r8d
orl %esi, %r8d
decl %r8d
movl 0x44(%rbx), %ecx
xorl %r9d, %r9d
movl %r8d, %esi
movl %r8d, %edx
subl %ecx, %esi
jb 0x13f19
movl 0x40(%rbx), %edx
movl (%rdi,%rdx,4), %r9d
negb %cl
shll %cl, %r9d
shrl %cl, %r9d
movl %esi, %ecx
shll %cl, %r9d
leal 0x1(%rdx), %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl %esi, %edx
testl %edx, %edx
je 0x13f38
movl 0x40(%rbx), %esi
movl 0x44(%rbx), %ecx
subl %edx, %ecx
movl %ecx, 0x44(%rbx)
movl (%rdi,%rsi,4), %esi
shrl %cl, %esi
negb %dl
movl %edx, %ecx
shll %cl, %esi
shrl %cl, %esi
orl %esi, %r9d
btsl %r8d, %r9d
decl %r9d
movl %r9d, 0x1c(%rbx)
addl 0xc(%rbx), %eax
movl 0x18(%rbx), %ecx
shlq $0x20, %rax
orq %rcx, %rax
popq %rbx
retq