// File: /workspace/github_cpp_makefile_star2_O3/dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::RemoveDevices(bool&, bool, std::set<CMACAddress, std::less<CMACAddress>, std::allocator<CMACAddress>> const&)
void CDlanMonitor::RemoveDevices(
  bool& bUpdate,
  bool bAge,    
  const std::set<CMACAddress>& setForceRemove)
{
  for(std::map<CMACAddress,NetwAdapter>::iterator itNIC = m_mapNICs.begin(); 
    (itNIC != m_mapNICs.end()); ++itNIC)
  {
    std::map<CMACAddress,LocalDevice>::iterator itLocalDevice = itNIC->second.mapLocalDevices.begin();
    while(itLocalDevice != itNIC->second.mapLocalDevices.end())
    {
      if(bAge) ++itLocalDevice->second.iAge;

      if((itLocalDevice->second.iAge == m_timings.LocalVanishedAge) || 
        (setForceRemove.find(itLocalDevice->first) != setForceRemove.end()))
      {
        bUpdate = true;
        m_listLocalDevices.erase(itLocalDevice->second.itPublicDevice);
        itNIC->second.mapLocalDevices.erase(itLocalDevice++);
      }
      else
      {
        std::map<CMACAddress,int>::iterator itUserDataAge;
        if(bAge &&
          ((itUserDataAge = itLocalDevice->second.mapUserDataAges.find(itLocalDevice->first)) != itLocalDevice->second.mapUserDataAges.end()) &&
          (++itUserDataAge->second == m_timings.LocalVanishedAge))
        {
          UpdateLocalDevice(itNIC, itLocalDevice->first, false, CDlanDevice::eThunderbolt, true, 
            "", true, UserDataResponse(), false, CMACAddress::Null(), true, bUpdate);
          itLocalDevice->second.mapUserDataAges.erase(itUserDataAge);
        }

        std::map<CMACAddress,int>::iterator itRemoteDevice = itLocalDevice->second.mapRemoteDeviceAges.begin();
        while(itRemoteDevice != itLocalDevice->second.mapRemoteDeviceAges.end())
        {
          if(bAge) ++itRemoteDevice->second;
        
          if((itRemoteDevice->second == m_timings.RemoteVanishedAge) ||
            (setForceRemove.find(itRemoteDevice->first) != setForceRemove.end()))
          {
            bUpdate = true;
            itLocalDevice->second.itPublicDevice->RemoveRemoteDevice(itRemoteDevice->first);
            itLocalDevice->second.mapRemoteDeviceAges.erase(itRemoteDevice++);
          }
          else
          {
            if(bAge &&
              ((itUserDataAge = itLocalDevice->second.mapUserDataAges.find(itRemoteDevice->first)) != itLocalDevice->second.mapUserDataAges.end()) &&
              (++itUserDataAge->second == m_timings.RemoteVanishedAge))
            {
              UpdateRemoteDevice(itLocalDevice->second, itRemoteDevice->first, false,
                CDlanDevice::eThunderbolt, true, "", true, UserDataResponse(), false, 0.0, 0.0, true, 
                std::map<CMACAddress, CDlanDataRates>(), true, CMACAddress(), true, bUpdate);
              itLocalDevice->second.mapUserDataAges.erase(itUserDataAge);
            }

            ++itRemoteDevice;
          }
        }
        ++itLocalDevice;
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rcx, 0x28(%rsp)
movq %rsi, 0x18(%rsp)
movq 0xc0(%rdi), %rcx
movq %rdi, 0x8(%rsp)
leaq 0xb0(%rdi), %rax
movq %rax, 0x110(%rsp)
cmpq %rax, %rcx
je 0x7ade
movl %edx, %ebp
movq 0x28(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xd8(%rsp)
movq 0x8(%rsp), %rax
leaq 0x90(%rax), %r15
movq %rcx, %rax
movq %r15, 0x118(%rsp)
movq 0x1a0(%rax), %r13
movq %rax, 0x20(%rsp)
leaq 0x190(%rax), %r12
cmpq %r12, %r13
je 0x7ac6
movq 0x20(%rsp), %rax
addq $0x188, %rax            # imm = 0x188
movq %rax, 0x140(%rsp)
movq %r12, 0x120(%rsp)
movl 0x28(%r13), %eax
testb %bpl, %bpl
je 0x758d
incl %eax
movl %eax, 0x28(%r13)
movq 0x8(%rsp), %rcx
cmpl 0x48(%rcx), %eax
je 0x75b2
leaq 0x20(%r13), %r14
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xdf9c
cmpq 0xd8(%rsp), %rax
je 0x75ee
movq 0x18(%rsp), %rax
movb $0x1, (%rax)
movq 0x30(%r13), %rsi
movq %r15, %rdi
callq 0xe04e
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbx
movq 0x140(%rsp), %rdi
movq %r13, %rsi
callq 0xe084
movq %rbx, %r13
cmpq %r12, %r13
jne 0x757e
jmp 0x7ac6
testb %bpl, %bpl
je 0x77cc
leaq 0x68(%r13), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe154
movq %rax, %r12
leaq 0x70(%r13), %rax
cmpq %rax, %r12
je 0x77cc
movl 0x28(%r12), %eax
incl %eax
movl %eax, 0x28(%r12)
movq 0x8(%rsp), %rcx
cmpl 0x48(%rcx), %eax
jne 0x77cc
movq %rbx, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
leaq 0xebf2(%rip), %rdx      # 0x16249
movq %rdx, %rsi
callq 0x642c
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
xorl %r10d, %r10d
movq %r10, 0x40(%rsp)
movb %r10b, 0x48(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %r10, 0x60(%rsp)
movb %r10b, 0x68(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq %r10, 0x80(%rsp)
movb %r10b, 0x88(%rsp)
leaq 0xa8(%rsp), %r15
movq %r15, 0x98(%rsp)
movq %r10, 0xa0(%rsp)
movb %r10b, 0xa8(%rsp)
movl %r10d, 0xb8(%rsp)
movw $0x0, 0xbc(%rsp)
subq $0x8, %rsp
movq 0x10(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq 0x20(%rsp)
movl $0x1, %eax
pushq %rax
leaq 0xd0(%rsp), %r11
pushq %r11
pushq %r10
leaq 0x60(%rsp), %r10
pushq %r10
pushq %rax
pushq %rbx
callq 0x80e6
addq $0x40, %rsp
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
movq 0x10(%rsp), %rbx
je 0x7742
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x7764
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x7780
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x779c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x77c1
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4270
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe206
movq 0x50(%r13), %r12
leaq 0x40(%r13), %r15
cmpq %r15, %r12
je 0x7aa6
leaq 0x28(%r13), %rax
movq %rax, 0x130(%rsp)
leaq 0x38(%r13), %rbx
leaq 0x68(%r13), %rax
movq %rax, 0x10(%rsp)
leaq 0x70(%r13), %rax
movq %rax, 0x138(%rsp)
movl 0x28(%r12), %eax
testb %bpl, %bpl
je 0x7813
incl %eax
movl %eax, 0x28(%r12)
leaq 0x20(%r12), %r14
movq 0x8(%rsp), %rcx
cmpl 0x50(%rcx), %eax
je 0x7839
movq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0xdf9c
cmpq 0xd8(%rsp), %rax
je 0x7874
movq 0x18(%rsp), %rax
movb $0x1, (%rax)
movq 0x30(%r13), %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x6578
movq %r12, %rdi
callq 0x41d0
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe206
movq %r14, %r12
cmpq %r15, %r12
jne 0x7802
jmp 0x7aa6
testb %bpl, %bpl
je 0x7a96
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xe154
cmpq 0x138(%rsp), %rax
je 0x7a96
movl 0x28(%rax), %edx
incl %edx
movl %edx, 0x28(%rax)
movq 0x8(%rsp), %rcx
cmpl 0x50(%rcx), %edx
jne 0x7a96
movq %rax, 0x128(%rsp)
leaq 0xc8(%rsp), %rax
movq %rax, 0xb8(%rsp)
leaq 0xb8(%rsp), %rdi
leaq 0xe974(%rip), %rdx      # 0x16249
movq %rdx, %rsi
callq 0x642c
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
xorl %edi, %edi
movq %rdi, 0x40(%rsp)
movb %dil, 0x48(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x60(%rsp)
movb %dil, 0x68(%rsp)
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq %rdi, 0x80(%rsp)
movb %dil, 0x88(%rsp)
leaq 0xa8(%rsp), %rax
movq %rax, 0x98(%rsp)
movq %rdi, 0xa0(%rsp)
movb %dil, 0xa8(%rsp)
movq %rdi, 0xf0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
leaq 0xe8(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq %rax, 0x100(%rsp)
movq %rdi, 0x108(%rsp)
movl %edi, 0x30(%rsp)
movw $0x0, 0x34(%rsp)
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq 0x130(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq 0x18(%rsp)
movl $0x1, %eax
pushq %rax
leaq 0x40(%rsp), %r10
pushq %r10
pushq %rax
leaq 0x100(%rsp), %r14
pushq %r14
pushq %rax
pushq %rdi
leaq 0x70(%rsp), %rdi
pushq %rdi
pushq %rax
leaq 0x100(%rsp), %rax
pushq %rax
callq 0x85ba
addq $0x50, %rsp
movq %r14, %rdi
callq 0x60e0
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x7a05
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x7a27
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x7a43
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x7a5f
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x7a84
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x10(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0xe206
movq %r12, %rdi
callq 0x41d0
movq %rax, %r12
jmp 0x786a
movq %r13, %rdi
callq 0x41d0
movq %rax, %r13
movq 0x118(%rsp), %r15
movq 0x120(%rsp), %r12
jmp 0x75e4
movq 0x20(%rsp), %rdi
callq 0x41d0
cmpq 0x110(%rsp), %rax
jne 0x7547
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xbf00
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x7b62
movq 0xf0(%rsp), %rsi
jmp 0x7b5a
jmp 0x7b1e
movq %rax, %rbx
jmp 0x7b62
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x60e0
leaq 0x38(%rsp), %rdi
callq 0xbf00
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x7b62
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x4270
movq %rbx, %rdi
callq 0x43e0