// File: /workspace/github_cpp_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
movl 0x14(%rdi), %eax
cmpl 0x20(%rdi), %eax
jae 0x13922
incl %eax
movl %eax, 0x14(%rbx)
movl 0x1c(%rbx), %r8d
testl %r8d, %r8d
je 0x1393b
incl 0x18(%rbx)
jmp 0x13b11
movl 0x8(%rbx), %esi
incl %esi
movq %rbx, %rdi
callq 0x130d8
movl $0x0, 0x1c(%rbx)
jmp 0x13b18
movq 0x28(%rbx), %rsi
movl 0x44(%rbx), %edx
movl 0x40(%rbx), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
decl %edx
movl %edx, 0x44(%rbx)
movl %ecx, %edi
movl (%rsi,%rdi,4), %edi
je 0x1395b
movl %edx, %r8d
jmp 0x1396d
incl %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %r8d
incl %eax
btl %edx, %edi
movl %r8d, %edx
jae 0x1394a
movl $0x1, %edx
movl %eax, %ecx
shll %cl, %edx
movl 0x44(%rbx), %ecx
xorl %edi, %edi
cmpl %eax, %ecx
ja 0x139ab
subl %ecx, %eax
movl 0x40(%rbx), %r8d
movl (%rsi,%r8,4), %edi
negb %cl
shll %cl, %edi
shrl %cl, %edi
movl %eax, %ecx
shll %cl, %edi
leal 0x1(%r8), %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
testl %eax, %eax
je 0x139cf
movl 0x40(%rbx), %r8d
movl 0x44(%rbx), %ecx
subl %eax, %ecx
movl %ecx, 0x44(%rbx)
movl (%rsi,%r8,4), %r8d
shrl %cl, %r8d
negb %al
movl %eax, %ecx
shll %cl, %r8d
shrl %cl, %r8d
orl %r8d, %edi
orl %edx, %edi
decl %edi
movl 0x44(%rbx), %ecx
xorl %r8d, %r8d
movl %edi, %edx
movl %edi, %eax
subl %ecx, %edx
jb 0x13a03
movl 0x40(%rbx), %eax
movl (%rsi,%rax,4), %r8d
negb %cl
shll %cl, %r8d
shrl %cl, %r8d
movl %edx, %ecx
shll %cl, %r8d
incl %eax
movl %eax, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl %edx, %eax
testl %eax, %eax
je 0x13a22
movl 0x40(%rbx), %edx
movl 0x44(%rbx), %ecx
subl %eax, %ecx
movl %ecx, 0x44(%rbx)
movl (%rsi,%rdx,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %r8d
btsl %edi, %r8d
addl %r8d, 0x18(%rbx)
movl 0x40(%rbx), %ecx
movl 0x44(%rbx), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
decl %edx
movl %edx, 0x44(%rbx)
movl %ecx, %edi
movl (%rsi,%rdi,4), %edi
je 0x13a46
movl %edx, %r8d
jmp 0x13a58
incl %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %r8d
incl %eax
btl %edx, %edi
movl %r8d, %edx
jae 0x13a35
movl $0x1, %edx
movl %eax, %ecx
shll %cl, %edx
movl 0x44(%rbx), %ecx
xorl %edi, %edi
cmpl %eax, %ecx
ja 0x13a96
subl %ecx, %eax
movl 0x40(%rbx), %r8d
movl (%rsi,%r8,4), %edi
negb %cl
shll %cl, %edi
shrl %cl, %edi
movl %eax, %ecx
shll %cl, %edi
leal 0x1(%r8), %ecx
movl %ecx, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
testl %eax, %eax
je 0x13aba
movl 0x40(%rbx), %r8d
movl 0x44(%rbx), %ecx
subl %eax, %ecx
movl %ecx, 0x44(%rbx)
movl (%rsi,%r8,4), %r8d
shrl %cl, %r8d
negb %al
movl %eax, %ecx
shll %cl, %r8d
shrl %cl, %r8d
orl %r8d, %edi
orl %edx, %edi
decl %edi
movl 0x44(%rbx), %ecx
xorl %r8d, %r8d
movl %edi, %edx
movl %edi, %eax
subl %ecx, %edx
jb 0x13aee
movl 0x40(%rbx), %eax
movl (%rsi,%rax,4), %r8d
negb %cl
shll %cl, %r8d
shrl %cl, %r8d
movl %edx, %ecx
shll %cl, %r8d
incl %eax
movl %eax, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl %edx, %eax
testl %eax, %eax
je 0x13b0d
movl 0x40(%rbx), %edx
movl 0x44(%rbx), %ecx
subl %eax, %ecx
movl %ecx, 0x44(%rbx)
movl (%rsi,%rdx,4), %edx
shrl %cl, %edx
negb %al
movl %eax, %ecx
shll %cl, %edx
shrl %cl, %edx
orl %edx, %r8d
btsl %edi, %r8d
decl %r8d
movl %r8d, 0x1c(%rbx)
movl 0x18(%rbx), %eax
popq %rbx
retq
nop