// File: /workspace/github_cpp_makefile_star2_O3/adamnovak[P]rlcsa/bits/rlevector.cpp
// Function: CSA::RLEVector::Iterator::valueLoop(unsigned int)
void
RLEVector::Iterator::valueLoop(usint value)
{
  this->getSample(this->sampleForValue(value));
  this->run = 0;

  if(this->val >= value) { return; }
  while(this->cur < this->block_items)
  {
    this->val += this->buffer.readDeltaCode();
    this->cur++;
    this->run = this->buffer.readDeltaCode() - 1;
    if(this->val >= value) { break; }

    this->cur += this->run;
    this->val += this->run;
    if(this->val >= value)
    {
      this->run = this->val - value;
      this->val = value;
      this->cur -= this->run;
      break;
    }
    this->run = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x12586
movq %rbx, %rdi
movl %eax, %esi
callq 0x135a4
movl $0x0, 0x1c(%rbx)
movl 0x18(%rbx), %edi
cmpl %ebp, %edi
jae 0x13a3e
movl 0x14(%rbx), %esi
movl 0x20(%rbx), %r8d
cmpl %r8d, %esi
jae 0x13a3e
movq 0x28(%rbx), %r9
movl 0x44(%rbx), %eax
movl 0x40(%rbx), %r10d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
decl %ecx
movl %ecx, 0x44(%rbx)
movl %r10d, %eax
movl (%r9,%rax,4), %r11d
je 0x1382e
movl %ecx, %eax
jmp 0x13841
incl %r10d
movl %r10d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
incl %edx
btl %ecx, %r11d
jae 0x1381a
movl $0x1, %r14d
movl %edx, %ecx
shll %cl, %r14d
xorl %r11d, %r11d
cmpl %edx, %eax
ja 0x13886
subl %eax, %edx
movl %r10d, %ecx
movl (%r9,%rcx,4), %r11d
negb %al
movl %eax, %ecx
shll %cl, %r11d
shrl %cl, %r11d
movl %edx, %ecx
shll %cl, %r11d
incl %r10d
movl %r10d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
movl %r10d, %r15d
testl %edx, %edx
je 0x138a8
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl (%r9,%r15,4), %r12d
movl %eax, %ecx
shrl %cl, %r12d
negb %dl
movl %edx, %ecx
shll %cl, %r12d
shrl %cl, %r12d
orl %r12d, %r11d
orl %r14d, %r11d
decl %r11d
xorl %r14d, %r14d
movl %r11d, %edx
subl %eax, %edx
jae 0x138bd
movl %r11d, %edx
jmp 0x138dc
movl (%r9,%r15,4), %r14d
negb %al
movl %eax, %ecx
shll %cl, %r14d
shrl %cl, %r14d
movl %edx, %ecx
shll %cl, %r14d
incl %r10d
movl %r10d, 0x40(%rbx)
movl $0x20, %eax
testl %edx, %edx
je 0x138fe
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl %r10d, %ecx
movl (%r9,%rcx,4), %r15d
movl %eax, %ecx
shrl %cl, %r15d
negb %dl
movl %edx, %ecx
shll %cl, %r15d
shrl %cl, %r15d
orl %r15d, %r14d
btsl %r11d, %r14d
addl %r14d, %edi
movl %edi, 0x18(%rbx)
leal 0x1(%rsi), %ecx
movl %ecx, 0x14(%rbx)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
decl %ecx
movl %ecx, 0x44(%rbx)
movl %r10d, %eax
movl (%r9,%rax,4), %r11d
je 0x13927
movl %ecx, %eax
jmp 0x1393a
incl %r10d
movl %r10d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
incl %edx
btl %ecx, %r11d
jae 0x13913
movl $0x1, %r14d
movl %edx, %ecx
shll %cl, %r14d
xorl %r11d, %r11d
cmpl %edx, %eax
ja 0x1397f
subl %eax, %edx
movl %r10d, %ecx
movl (%r9,%rcx,4), %r11d
negb %al
movl %eax, %ecx
shll %cl, %r11d
shrl %cl, %r11d
movl %edx, %ecx
shll %cl, %r11d
incl %r10d
movl %r10d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
movl %r10d, %r15d
testl %edx, %edx
je 0x139a1
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl (%r9,%r15,4), %r12d
movl %eax, %ecx
shrl %cl, %r12d
negb %dl
movl %edx, %ecx
shll %cl, %r12d
shrl %cl, %r12d
orl %r12d, %r11d
orl %r14d, %r11d
decl %r11d
xorl %r14d, %r14d
movl %r11d, %edx
subl %eax, %edx
jae 0x139b6
movl %r11d, %edx
jmp 0x139dc
movl (%r9,%r15,4), %r14d
negb %al
movl %eax, %ecx
shll %cl, %r14d
shrl %cl, %r14d
movl %edx, %ecx
shll %cl, %r14d
incl %r10d
movl %r10d, 0x40(%rbx)
movl $0x20, 0x44(%rbx)
movl $0x20, %eax
testl %edx, %edx
je 0x13a01
subl %edx, %eax
movl %eax, 0x44(%rbx)
movl %r10d, %ecx
movl (%r9,%rcx,4), %r15d
movl %eax, %ecx
shrl %cl, %r15d
negb %dl
movl %edx, %ecx
shll %cl, %r15d
shrl %cl, %r15d
orl %r14d, %r15d
movl %r15d, %r14d
btsl %r11d, %r14d
leal -0x1(%r14), %ecx
movl %ecx, 0x1c(%rbx)
cmpl %ebp, %edi
jae 0x13a3e
addl %r14d, %esi
movl %esi, 0x14(%rbx)
addl %ecx, %edi
movl %edi, 0x18(%rbx)
movl %edi, %ecx
subl %ebp, %ecx
jae 0x13a33
movl $0x0, 0x1c(%rbx)
cmpl %r8d, %esi
jb 0x13815
jmp 0x13a3e
movl %ecx, 0x1c(%rbx)
movl %ebp, 0x18(%rbx)
subl %ecx, %esi
movl %esi, 0x14(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop