// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %esi
cmpl 0x20(%rdi), %esi
jae 0x14245
incl %esi
movl %esi, 0x14(%rbx)
movl 0x1c(%rbx), %r11d
testl %r11d, %r11d
je 0x14265
movl 0x18(%rbx), %r9d
incl %r9d
movl %r9d, 0x18(%rbx)
jmp 0x1444f
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0x135a4
movl $0x0, 0x1c(%rbx)
movl 0xc(%rbx), %esi
movl 0x18(%rbx), %r9d
jmp 0x14459
movq 0x28(%rbx), %rdi
movl 0x44(%rbx), %eax
movl 0x40(%rbx), %r8d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
decl %ecx
movl %ecx, 0x44(%rbx)
movl %r8d, %eax
movl (%rdi,%rax,4), %r9d
je 0x14289
movl %ecx, %eax
jmp 0x1429c
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
incl %edx
btl %ecx, %r9d
jae 0x14275
movl $0x1, %r9d
movl %edx, %ecx
shll %cl, %r9d
xorl %r10d, %r10d
cmpl %edx, %eax
ja 0x142e1
subl %eax, %edx
movl %r8d, %ecx
movl (%rdi,%rcx,4), %r10d
negb %al
movl %eax, %ecx
shll %cl, %r10d
shrl %cl, %r10d
movl %edx, %ecx
shll %cl, %r10d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
movl %r8d, %r11d
testl %edx, %edx
je 0x14300
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl (%rdi,%r11,4), %ebp
movl %eax, %ecx
shrl %cl, %ebp
negb %dl
movl %edx, %ecx
shll %cl, %ebp
shrl %cl, %ebp
orl %ebp, %r10d
orl %r9d, %r10d
decl %r10d
xorl %r9d, %r9d
movl %r10d, %edx
subl %eax, %edx
jae 0x14315
movl %r10d, %edx
jmp 0x14334
movl (%rdi,%r11,4), %r9d
negb %al
movl %eax, %ecx
shll %cl, %r9d
shrl %cl, %r9d
movl %edx, %ecx
shll %cl, %r9d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, %eax
testl %edx, %edx
je 0x14356
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl %r8d, %ecx
movl (%rdi,%rcx,4), %r11d
movl %eax, %ecx
shrl %cl, %r11d
negb %dl
movl %edx, %ecx
shll %cl, %r11d
shrl %cl, %r11d
orl %r11d, %r9d
btsl %r10d, %r9d
addl 0x18(%rbx), %r9d
movl %r9d, 0x18(%rbx)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
decl %ecx
movl %ecx, 0x44(%rbx)
movl %r8d, %eax
movl (%rdi,%rax,4), %r10d
je 0x1437b
movl %ecx, %eax
jmp 0x1438e
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
incl %edx
btl %ecx, %r10d
jae 0x14367
movl $0x1, %r11d
movl %edx, %ecx
shll %cl, %r11d
xorl %r10d, %r10d
cmpl %edx, %eax
ja 0x143d3
subl %eax, %edx
movl %r8d, %ecx
movl (%rdi,%rcx,4), %r10d
negb %al
movl %eax, %ecx
shll %cl, %r10d
shrl %cl, %r10d
movl %edx, %ecx
shll %cl, %r10d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
movl %r8d, %r14d
testl %edx, %edx
je 0x143f2
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl (%rdi,%r14,4), %ebp
movl %eax, %ecx
shrl %cl, %ebp
negb %dl
movl %edx, %ecx
shll %cl, %ebp
shrl %cl, %ebp
orl %ebp, %r10d
orl %r11d, %r10d
decl %r10d
xorl %r11d, %r11d
movl %r10d, %edx
subl %eax, %edx
jae 0x14407
movl %r10d, %edx
jmp 0x1442d
movl (%rdi,%r14,4), %r11d
negb %al
movl %eax, %ecx
shll %cl, %r11d
shrl %cl, %r11d
movl %edx, %ecx
shll %cl, %r11d
incl %r8d
movl %r8d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
testl %edx, %edx
je 0x1444b
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl %r8d, %ecx
movl (%rdi,%rcx,4), %edi
movl %eax, %ecx
shrl %cl, %edi
negb %dl
movl %edx, %ecx
shll %cl, %edi
shrl %cl, %edi
orl %edi, %r11d
btsl %r10d, %r11d
decl %r11d
movl %r11d, 0x1c(%rbx)
addl 0xc(%rbx), %esi
shlq $0x20, %rsi
movl %r9d, %eax
orq %rsi, %rax
popq %rbx
popq %r14
popq %rbp
retq