// File: BUSEC[P]RPKI_Downgrade_Detector/./exp.cpp
// Function: PrefixRange::Setup(int)
void Setup( int boundingMaxLength ) {
    if (boundingMaxLength<bound.getLength()) {
      lists = NULL;
      len = 0;
      endLength = boundingMaxLength;
      return;
    }
    endLength = boundingMaxLength;
    len = endLength-bound.getLength()+1;
    lists = new IntervalList<IPAddr>[len];
    for (int i = bound.getLength(); i<=endLength; i++) {
      // lists[i-bound.getLengt()] is responsible for storing intervals
      // at level i of the prefix tree, i.e., prefixes that end in /i
      // At this level, to consecutive prefixes differ by 2^(IPAdder::numBits-i)
      // For example, if i==24, then we store /24 prefixes in lists[i-bound.getLength()]
      // Two /24 prefixes are contiguous if they differ by 2^(32-24)=2^8=256
      if ( i == 0 ) lists[i-bound.getLength()].setIncrement(1); // avoiding issues from left shifting by 32
      else lists[i-bound.getLength()].setIncrement(1<<((IPAddr::numBits)-i)); //~erh refactor
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
addq $0x8, %rdi
callq 0x5b30
movl %eax, %ecx
movl -0x24(%rbp), %eax
cmpl %ecx, %eax
jge 0xa36f
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, 0x14(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, 0x10(%rax)
jmp 0xa550
movq -0x30(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, 0x10(%rdi)
movl 0x10(%rdi), %eax
movl %eax, -0x54(%rbp)
addq $0x8, %rdi
callq 0x5b30
movl -0x54(%rbp), %ecx
movl %eax, %edx
movq -0x30(%rbp), %rax
subl %edx, %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movslq 0x14(%rax), %rax
movq %rax, -0x48(%rbp)
movl $0x38, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x50(%rbp)
callq 0x3030
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x38(%rbp)
cmpq $0x0, %rax
je 0xa429
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
imulq $0x38, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0xa570
jmp 0xa414
movq -0x68(%rbp), %rcx
movq -0x70(%rbp), %rax
addq $0x38, %rax
cmpq %rcx, %rax
movq %rax, -0x60(%rbp)
jne 0xa405
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rax
movq %rax, (%rdi)
addq $0x8, %rdi
callq 0x5b30
movl %eax, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0x10(%rcx), %eax
jg 0xa550
cmpl $0x0, -0x20(%rbp)
jne 0xa4f2
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0x80(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x74(%rbp)
addq $0x8, %rdi
callq 0x5b30
movq -0x80(%rbp), %rdi
movl %eax, %ecx
movl -0x74(%rbp), %eax
subl %ecx, %eax
cltq
imulq $0x38, %rax, %rax
addq %rax, %rdi
movl $0x1, %esi
callq 0xa5c0
jmp 0xa540
movq -0x38(%rbp), %rcx
movq %rax, %rsi
movq -0x70(%rbp), %rax
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x88(%rbp)
je 0xa4e3
movq -0x88(%rbp), %rdi
addq $-0x38, %rdi
movq %rdi, -0x90(%rbp)
callq 0xa5a0
movq -0x38(%rbp), %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x88(%rbp)
jne 0xa4b5
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdi
callq 0x3430
jmp 0xa559
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0xa0(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x94(%rbp)
addq $0x8, %rdi
callq 0x5b30
movq -0xa0(%rbp), %rdi
movl %eax, %ecx
movl -0x94(%rbp), %eax
subl %ecx, %eax
cltq
imulq $0x38, %rax, %rax
addq %rax, %rdi
movl $0x20, %ecx
subl -0x20(%rbp), %ecx
movl $0x1, %esi
shll %cl, %esi
callq 0xa5c0
jmp 0xa542
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xa440
addq $0xa0, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)
nopl (%rax)