// File: /workspace/github_cpp_makefile_star2_O1/BUSEC[P]RPKI_Downgrade_Detector/./exp.cpp
// Function: NotValidToValid(ROAGroup, ROAGroup, std::unordered_map<int, PrefixRange*, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, PrefixRange*>>>*)
void NotValidToValid(ROAGroup newPrefixes, ROAGroup oldPrefixes, unordered_map<int, PrefixRange*>* notValidToValidPrefixes){ 
  set<int>* ASes = newPrefixes.getASes();

  for( set<int>::iterator i = ASes->begin(); i != ASes->end(); ++i) {
    int as = *i;

    PrefixRange* rPrimeValid = newPrefixes.getByAS(as); 

    PrefixRange empty = PrefixRange();

    PrefixRange* oldValid = &empty; 

    // If oldPrefixes has the as we are working on then set it
    if ( oldPrefixes.hasAS(as) ) oldValid = oldPrefixes.getByAS(as); 

    rPrimeValid->denseIntersectWith( oldValid->complement() , true);

    if ( ! rPrimeValid->empty() ) notValidToValidPrefixes->insert( make_pair(as, new PrefixRange( *rPrimeValid ) ) );
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x38(%rsp)
movq %rsi, (%rsp)
movq 0x60(%rdi), %r11
leaq 0x50(%rdi), %rax
movq %rax, 0x48(%rsp)
cmpq %rax, %r11
je 0x30e2
leaq 0x20(%rsp), %r14
leaq 0x8(%rsp), %r15
movq %rdi, 0x40(%rsp)
movl 0x20(%r11), %r13d
movl %r13d, 0x20(%rsp)
movslq %r13d, %rbp
movq (%rdi), %rsi
movq 0x8(%rdi), %r10
movq %rbp, %rax
xorl %edx, %edx
divq %r10
movq %rdx, %rcx
movq (%rsi,%rdx,8), %rdx
movl $0x0, %eax
testq %rdx, %rdx
je 0x2ea4
movq (%rdx), %r8
movq %rdx, %rax
cmpl %r13d, 0x8(%r8)
je 0x2ea4
movq %r8, %r9
movq (%r8), %r8
testq %r8, %r8
je 0x2ea2
movslq 0x8(%r8), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %r10
movl $0x0, %eax
cmpq %rcx, %rdx
jne 0x2ea4
movq %r9, %rax
cmpl %r13d, %esi
jne 0x2e77
jmp 0x2ea4
xorl %eax, %eax
movq %r11, 0x50(%rsp)
testq %rax, %rax
je 0x30f1
cmpq $0x0, (%rax)
je 0x30f1
movq %r14, %rsi
callq 0x7402
movq (%rax), %rbx
movq $0x0, 0x28(%rsp)
movq %r14, %rdi
movl $0x20, %esi
callq 0x62f4
movq (%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdi
movq %rbp, %rax
xorl %edx, %edx
divq %rdi
movq %rdx, %rcx
movq (%rsi,%rdx,8), %r8
movl $0x0, %eax
testq %r8, %r8
je 0x2f3a
movq (%r8), %r9
movq %r8, %rax
cmpl %r13d, 0x8(%r9)
je 0x2f3a
movq %r9, %r10
movq (%r9), %r9
testq %r9, %r9
je 0x2f38
movslq 0x8(%r9), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %eax
cmpq %rcx, %rdx
jne 0x2f3a
movq %r10, %rax
cmpl %r13d, %esi
jne 0x2f0d
jmp 0x2f3a
xorl %eax, %eax
movq %r14, %rsi
testq %rax, %rax
je 0x2faf
cmpq $0x0, (%rax)
movq %r14, %rsi
je 0x2faf
movl %r13d, 0x8(%rsp)
testq %r8, %r8
je 0x2f8a
movq (%r8), %r9
cmpl %r13d, 0x8(%r9)
je 0x2f8d
movq %r9, %r10
movq (%r9), %r9
testq %r9, %r9
je 0x2f8a
movslq 0x8(%r9), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r8d
cmpq %rcx, %rdx
jne 0x2f8d
movq %r10, %r8
cmpl %r13d, %esi
jne 0x2f5e
jmp 0x2f8d
xorl %r8d, %r8d
testq %r8, %r8
je 0x30f1
cmpq $0x0, (%r8)
je 0x30f1
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x7402
movq (%rax), %rsi
movq %r15, %rdi
callq 0x4d1a
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x4c96
movq 0x8(%rsp), %rbp
testq %rbp, %rbp
je 0x300f
movq -0x8(%rbp), %r14
testq %r14, %r14
je 0x2ff1
imulq $0x38, %r14, %r15
leaq -0x38(%rbp), %r12
leaq (%r12,%r15), %rdi
callq 0x6422
addq $-0x38, %r15
jne 0x2fe2
addq $-0x8, %rbp
imulq $0x38, %r14, %rsi
addq $0x8, %rsi
movq %rbp, %rdi
callq 0x2390
leaq 0x20(%rsp), %r14
leaq 0x8(%rsp), %r15
movslq 0x14(%rbx), %rax
testq %rax, %rax
setle %cl
jle 0x304a
movq (%rbx), %rcx
cmpq $0x0, 0x28(%rcx)
jne 0x304e
addq $0x60, %rcx
movl $0x1, %esi
movq %rsi, %rdx
cmpq %rsi, %rax
je 0x3044
leaq 0x1(%rdx), %rsi
cmpq $0x0, (%rcx)
leaq 0x38(%rcx), %rcx
je 0x302e
cmpq %rax, %rdx
setae %cl
testb %cl, %cl
jne 0x307d
movl $0x18, %edi
callq 0x2230
movq %rax, %rbp
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4ea8
movl %r13d, 0x8(%rsp)
movq %rbp, 0x10(%rsp)
movq 0x38(%rsp), %rdi
movq %r15, %rsi
callq 0x7680
movq 0x20(%rsp), %rbx
testq %rbx, %rbx
je 0x30c5
movq -0x8(%rbx), %r14
testq %r14, %r14
je 0x30a7
imulq $0x38, %r14, %r15
leaq -0x38(%rbx), %r12
leaq (%r12,%r15), %rdi
callq 0x6422
addq $-0x38, %r15
jne 0x3098
addq $-0x8, %rbx
imulq $0x38, %r14, %rsi
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x2390
leaq 0x20(%rsp), %r14
leaq 0x8(%rsp), %r15
movq 0x50(%rsp), %rdi
callq 0x2290
movq %rax, %r11
cmpq 0x48(%rsp), %rax
movq 0x40(%rsp), %rdi
jne 0x2e3f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6099(%rip), %rdi      # 0x9191
leaq 0x5f81(%rip), %rsi      # 0x9080
leaq 0x6095(%rip), %rcx      # 0x919b
movl $0x2d9, %edx            # imm = 0x2D9
callq 0x2150
jmp 0x3135
movq %rax, %rbx
movl $0x18, %esi
movq %rbp, %rdi
callq 0x2240
jmp 0x3138
jmp 0x3135
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4e4c
jmp 0x3138
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4e4c
movq %rbx, %rdi
callq 0x2360