// File: /workspace/github_cpp_makefile_star2_O1/BUSEC[P]RPKI_Downgrade_Detector/./exp.cpp
// Function: ValidToInvalid(ROAGroup*, PrefixRange*, int)
void ValidToInvalid( ROAGroup* newPrefixes, PrefixRange* rOld, int as){
  bool argDense = false;  // most likely, known has many entries and the intersections have few entries

  PrefixRange noLongerValid =  PrefixRange(); 

  if( newPrefixes->hasAS( as ) ) { 

    // ( R.valid -  new.AS.Valid)
    PrefixRange* newASValid = newPrefixes->getByAS(as);
    PrefixRange newASUnknownOrInvalid = newASValid->complement();
    rOld->denseIntersectWith( newASUnknownOrInvalid, argDense); // LEOCOM: would it be more efficent to do a subtraction, ETHANCOM: unfortunately substraction only applies to IPPrefixes which don't have MaxLen

  } // if new.AS.valid doesn't exist then ( R.valid -  new.AS.valid) = (R.valid) and we can skip ahead

  // subtracting new.unknown is the same as intersecting with new.known
  rOld->denseIntersectWith( *(newPrefixes->getKnown()), argDense);
  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rdi
movq $0x0, 0x8(%rdi)
movl $0x20, %esi
callq 0x62f4
movslq %ebp, %rax
movq (%r14), %rsi
movq 0x8(%r14), %rdi
xorl %r10d, %r10d
xorl %edx, %edx
divq %rdi
movq %rdx, %rcx
movq (%rsi,%rdx,8), %r8
testq %r8, %r8
je 0x2c92
movq (%r8), %r9
movq %r8, %r10
cmpl %ebp, 0x8(%r9)
je 0x2c92
movq %r9, %r11
movq (%r9), %r9
testq %r9, %r9
je 0x2c8f
movslq 0x8(%r9), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r10d
cmpq %rcx, %rdx
jne 0x2c92
movq %r11, %r10
cmpl %ebp, %esi
jne 0x2c64
jmp 0x2c92
xorl %r10d, %r10d
testq %r10, %r10
je 0x2d61
cmpq $0x0, (%r10)
je 0x2d61
movl %ebp, 0x8(%rsp)
testq %r8, %r8
je 0x2ce2
movq (%r8), %r9
cmpl %ebp, 0x8(%r9)
je 0x2ce5
movq %r9, %r10
movq (%r9), %r9
testq %r9, %r9
je 0x2ce2
movslq 0x8(%r9), %rsi
movq %rsi, %rax
xorl %edx, %edx
divq %rdi
movl $0x0, %r8d
cmpq %rcx, %rdx
jne 0x2ce5
movq %r10, %r8
cmpl %ebp, %esi
jne 0x2cb7
jmp 0x2ce5
xorl %r8d, %r8d
testq %r8, %r8
je 0x2dbc
cmpq $0x0, (%r8)
je 0x2dbc
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7402
movq (%rax), %rsi
leaq 0x8(%rsp), %rdi
callq 0x4d1a
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4c96
movq 0x8(%rsp), %r12
testq %r12, %r12
je 0x2d61
leaq -0x8(%r12), %r15
movq -0x8(%r12), %r13
testq %r13, %r13
je 0x2d51
imulq $0x38, %r13, %rbp
addq $-0x38, %r12
leaq (%r12,%rbp), %rdi
callq 0x6422
addq $-0x38, %rbp
jne 0x2d42
imulq $0x38, %r13, %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x2390
movq 0x38(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x4c96
movq 0x20(%rsp), %r14
testq %r14, %r14
je 0x2dad
leaq -0x8(%r14), %rbx
movq -0x8(%r14), %r15
testq %r15, %r15
je 0x2d9d
imulq $0x38, %r15, %r12
addq $-0x38, %r14
leaq (%r14,%r12), %rdi
callq 0x6422
addq $-0x38, %r12
jne 0x2d8e
imulq $0x38, %r15, %rsi
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x2390
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x63ce(%rip), %rdi      # 0x9191
leaq 0x62b6(%rip), %rsi      # 0x9080
leaq 0x63ca(%rip), %rcx      # 0x919b
movl $0x2d9, %edx            # imm = 0x2D9
callq 0x2150
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4e4c
jmp 0x2df1
jmp 0x2dee
jmp 0x2dee
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4e4c
movq %rbx, %rdi
callq 0x2360