// File: /workspace/github_cpp_makefile_star2_O3/dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::UpdateAdapters(bool&, std::set<CMACAddress, std::less<CMACAddress>, std::allocator<CMACAddress>> const&)
void CDlanMonitor::UpdateAdapters(
  bool& bUpdate,
  const std::set<CMACAddress>& setAdapters)
{
  for(std::set<CMACAddress>::const_iterator itAdapter = setAdapters.begin(); 
    (itAdapter != setAdapters.end()); ++itAdapter)
  {
    if((*itAdapter != CMACAddress::Null()) && (m_mapNICs.find(*itAdapter) == m_mapNICs.end()))
      m_mapNICs.insert(std::make_pair(*itAdapter,NetwAdapter()));
  }

  std::map<CMACAddress,NetwAdapter>::iterator itNIC = m_mapNICs.begin();
  while(itNIC != m_mapNICs.end())
  {
    if(setAdapters.find(itNIC->first) == setAdapters.end())
    {
      while(!itNIC->second.mapLocalDevices.empty())
      {
        bUpdate = true;
        m_listLocalDevices.erase(itNIC->second.mapLocalDevices.begin()->second.itPublicDevice);
        itNIC->second.mapLocalDevices.erase(itNIC->second.mapLocalDevices.begin());
      }

      while(!itNIC->second.queuePendingPackets.empty()) 
      {
        delete itNIC->second.queuePendingPackets.front();
        itNIC->second.queuePendingPackets.pop();
      }

      m_mapNICs.erase(itNIC++);      
    }
    else
    {
      ++itNIC;
    }
  } 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdx), %r12
movq %rdx, (%rsp)
leaq 0x8(%rdx), %rax
movq %rax, 0x8(%rsp)
cmpq %rax, %r12
je 0x7e65
movl $0xa8, %eax
leaq (%r15,%rax), %rbx
leaq 0xb0(%r15), %rcx
movq %rcx, 0x18(%rsp)
leaq 0x20(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movw $0x0, 0x24(%rsp)
movl $0x0, 0x20(%rsp)
movzwl 0x24(%r12), %eax
orl 0x20(%r12), %eax
je 0x7e4f
leaq 0x20(%r12), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xdc9e
cmpq 0x18(%rsp), %rax
jne 0x7e4f
leaq 0x208(%rsp), %rbp
movq %rbp, %rdi
callq 0xbc20
movzwl 0x4(%r13), %eax
movw %ax, 0x24(%rsp)
movl (%r13), %eax
movl %eax, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xc96c
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
callq 0xdd50
leaq 0x1b8(%rsp), %rdi
callq 0x5c54
leaq 0x188(%rsp), %rdi
callq 0x5cac
leaq 0x158(%rsp), %rdi
callq 0x5d5e
leaq 0x128(%rsp), %rdi
callq 0x5de8
leaq 0xf8(%rsp), %rdi
callq 0x5eac
movq 0x10(%rsp), %rdi
callq 0x5f24
leaq 0x98(%rsp), %rdi
callq 0x5f24
leaq 0x68(%rsp), %rdi
callq 0x5f24
leaq 0x38(%rsp), %rdi
callq 0x5f24
leaq 0x398(%rsp), %rdi
callq 0x5c54
leaq 0x368(%rsp), %rdi
callq 0x5cac
leaq 0x338(%rsp), %rdi
callq 0x5d5e
leaq 0x308(%rsp), %rdi
callq 0x5de8
leaq 0x2d8(%rsp), %rdi
callq 0x5eac
leaq 0x2a8(%rsp), %rdi
callq 0x5f24
leaq 0x278(%rsp), %rdi
callq 0x5f24
leaq 0x248(%rsp), %rdi
callq 0x5f24
leaq 0x218(%rsp), %rdi
callq 0x5f24
movq %r12, %rdi
callq 0x42d0
movq %rax, %r12
cmpq 0x8(%rsp), %rax
jne 0x7cf7
movq 0xc0(%r15), %r13
leaq 0xb0(%r15), %r12
cmpq %r12, %r13
movq (%rsp), %rbp
je 0x7f54
leaq 0xa8(%r15), %rbx
addq $0x90, %r15
leaq 0x20(%r13), %rsi
movq %rbp, %rdi
callq 0xdf9c
cmpq 0x8(%rsp), %rax
je 0x7eb1
movq %r13, %rdi
callq 0x41d0
movq %rax, %r13
jmp 0x7f4b
cmpq $0x0, 0x1b0(%r13)
je 0x7ef2
leaq 0x188(%r13), %rbp
movb $0x1, (%r14)
movq 0x1a0(%r13), %rax
movq 0x30(%rax), %rsi
movq %r15, %rdi
callq 0xe04e
movq 0x1a0(%r13), %rsi
movq %rbp, %rdi
callq 0xe084
cmpq $0x0, 0x1b0(%r13)
jne 0x7ec2
movq 0x1c8(%r13), %rax
cmpq %rax, 0x1e8(%r13)
je 0x7f2e
leaq 0x1b8(%r13), %rbp
movq (%rax), %rdi
movl $0x8, %esi
callq 0x4270
movq %rbp, %rdi
callq 0xe0c8
movq 0x1c8(%r13), %rax
cmpq %rax, 0x1e8(%r13)
jne 0x7f09
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbp
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe116
movq %rbp, %r13
movq (%rsp), %rbp
cmpq %r12, %r13
jne 0x7e8e
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xbe28
jmp 0x7f78
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0xbe94
movq %rbx, %rdi
callq 0x43e0
nop