// File: /workspace/github_cpp_makefile_star2_O1/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, 0x20(%rsp)
movq %rsi, 0x10(%rsp)
movq 0xc0(%rdi), %rcx
movq %rdi, (%rsp)
leaq 0xb0(%rdi), %rax
movq %rax, 0x110(%rsp)
cmpq %rax, %rcx
je 0x7bba
movl %edx, %ebp
movq 0x20(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x108(%rsp)
movq (%rsp), %rax
leaq 0x90(%rax), %r15
movq %r15, 0x118(%rsp)
movq 0x1a0(%rcx), %r13
movq %rcx, 0x18(%rsp)
leaq 0x190(%rcx), %r12
cmpq %r12, %r13
je 0x7b9f
movq 0x18(%rsp), %rax
addq $0x188, %rax            # imm = 0x188
movq %rax, 0x140(%rsp)
movq %r12, 0x120(%rsp)
testb %bpl, %bpl
je 0x7666
incl 0x28(%r13)
movl 0x28(%r13), %eax
movq (%rsp), %rcx
cmpl 0x48(%rcx), %eax
je 0x768e
leaq 0x20(%r13), %r14
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0xe1fe
cmpq 0x108(%rsp), %rax
je 0x76ca
movq 0x10(%rsp), %rax
movb $0x1, (%rax)
movq 0x30(%r13), %rsi
movq %r15, %rdi
callq 0xe2ae
movq %r13, %rdi
callq 0x41d0
movq %rax, %rbx
movq 0x140(%rsp), %rdi
movq %r13, %rsi
callq 0xe2e4
movq %rbx, %r13
cmpq %r12, %r13
jne 0x765d
jmp 0x7b9f
testb %bpl, %bpl
je 0x78a4
leaq 0x68(%r13), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe3b4
movq %rax, %r12
leaq 0x70(%r13), %rax
cmpq %rax, %r12
je 0x78a4
movl 0x28(%r12), %eax
incl %eax
movl %eax, 0x28(%r12)
movq (%rsp), %rcx
cmpl 0x48(%rcx), %eax
jne 0x78a4
movq %rbx, 0x8(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
leaq 0xeb17(%rip), %rdx      # 0x16249
movq %rdx, %rsi
callq 0x6476
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
xorl %r10d, %r10d
movq %r10, 0x38(%rsp)
movb %r10b, 0x40(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movb %r10b, 0x60(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %r10, 0x78(%rsp)
movb %r10b, 0x80(%rsp)
leaq 0xa0(%rsp), %r15
movq %r15, 0x90(%rsp)
movq %r10, 0x98(%rsp)
movb %r10b, 0xa0(%rsp)
movl %r10d, 0xb0(%rsp)
movw $0x0, 0xb4(%rsp)
subq $0x8, %rsp
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq 0x18(%rsp)
movl $0x1, %eax
pushq %rax
leaq 0xc8(%rsp), %r11
pushq %r11
pushq %r10
leaq 0x58(%rsp), %r10
pushq %r10
pushq %rax
pushq %rbx
callq 0x81d6
addq $0x40, %rsp
movq 0x90(%rsp), %rdi
cmpq %r15, %rdi
movq 0x8(%rsp), %rbx
je 0x781a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x783c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x7858
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x7874
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x7899
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x4270
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe464
movq 0x50(%r13), %r12
leaq 0x40(%r13), %r15
cmpq %r15, %r12
je 0x7b7f
leaq 0x28(%r13), %rax
movq %rax, 0x130(%rsp)
leaq 0x38(%r13), %rbx
leaq 0x68(%r13), %rax
movq %rax, 0x8(%rsp)
leaq 0x70(%r13), %rax
movq %rax, 0x138(%rsp)
testb %bpl, %bpl
je 0x78e4
incl 0x28(%r12)
leaq 0x20(%r12), %r14
movl 0x28(%r12), %eax
movq (%rsp), %rcx
cmpl 0x50(%rcx), %eax
je 0x790e
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0xe1fe
cmpq 0x108(%rsp), %rax
je 0x7949
movq 0x10(%rsp), %rax
movb $0x1, (%rax)
movq 0x30(%r13), %rdi
addq $0x10, %rdi
movq %r14, %rsi
callq 0x65c2
movq %r12, %rdi
callq 0x41d0
movq %rax, %r14
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe464
movq %r14, %r12
cmpq %r15, %r12
jne 0x78da
jmp 0x7b7f
testb %bpl, %bpl
je 0x7b6f
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xe3b4
cmpq 0x138(%rsp), %rax
je 0x7b6f
movl 0x28(%rax), %edx
incl %edx
movl %edx, 0x28(%rax)
movq (%rsp), %rcx
cmpl 0x50(%rcx), %edx
jne 0x7b6f
movq %rax, 0x128(%rsp)
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xe8a0(%rip), %rdx      # 0x16249
movq %rdx, %rsi
callq 0x6476
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
xorl %edi, %edi
movq %rdi, 0x38(%rsp)
movb %dil, 0x40(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %rdi, 0x58(%rsp)
movb %dil, 0x60(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %rdi, 0x78(%rsp)
movb %dil, 0x80(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %rdi, 0x98(%rsp)
movb %dil, 0xa0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xd0(%rsp)
leaq 0xd8(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq %rax, 0xf0(%rsp)
movq %rdi, 0xf8(%rsp)
movl %edi, 0x28(%rsp)
movw $0x0, 0x2c(%rsp)
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq 0x130(%rsp), %rsi
movq %r14, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x1, %r9d
pushq 0x10(%rsp)
movl $0x1, %eax
pushq %rax
leaq 0x38(%rsp), %r10
pushq %r10
pushq %rax
leaq 0xf0(%rsp), %r14
pushq %r14
pushq %rax
pushq %rdi
leaq 0x68(%rsp), %rdi
pushq %rdi
pushq %rax
leaq 0xf8(%rsp), %rax
pushq %rax
callq 0x8748
addq $0x50, %rsp
movq %r14, %rdi
callq 0x612a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x7ade
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x7b00
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x7b1c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x7b38
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x7b5d
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x8(%rsp), %rdi
movq 0x128(%rsp), %rsi
callq 0xe464
movq %r12, %rdi
callq 0x41d0
movq %rax, %r12
jmp 0x793f
movq %r13, %rdi
callq 0x41d0
movq %rax, %r13
movq 0x118(%rsp), %r15
movq 0x120(%rsp), %r12
jmp 0x76c0
movq 0x18(%rsp), %rdi
callq 0x41d0
movq %rax, %rcx
cmpq 0x110(%rsp), %rax
jne 0x7626
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc160
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x7c3e
movq 0xe0(%rsp), %rsi
jmp 0x7c36
jmp 0x7bfa
movq %rax, %rbx
jmp 0x7c3e
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x612a
leaq 0x30(%rsp), %rdi
callq 0xc160
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x7c3e
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x4270
movq %rbx, %rdi
callq 0x43e0