// File: /workspace/github_cpp_makefile_star2_O2/dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::ThunderNetworkInfo(std::_Rb_tree_iterator<std::pair<CMACAddress const, CDlanMonitor::NetwAdapter>>, CMACAddress const&, CDlanMonitor::NetworkInfoResponse const&)
void CDlanMonitor::ThunderNetworkInfo(
  std::map<CMACAddress,NetwAdapter>::iterator itNIC,  
  const CMACAddress& addr, 
  const NetworkInfoResponse& nwinfo)
{
  bool bUpdate = false;
    
  itNIC->second.mapNetworkInfoResponses[addr] = nwinfo;
    
  std::map<CMACAddress,LocalDevice>::iterator itLocalDevice = itNIC->second.mapLocalDevices.find(addr);
  if(itLocalDevice != itNIC->second.mapLocalDevices.end())
  {
    for(std::list<HomePlugAvMMEs::ThunderNetworkInfo::StationInfo>::const_iterator itStation = nwinfo.stations.begin();
      (itStation != nwinfo.stations.end()); itStation++)
    {
      std::map<CMACAddress,std::string>::const_iterator itVersion;
      if((itVersion = itNIC->second.mapGetVersionResponses.find(itStation->GetAddress())) != 
        itNIC->second.mapGetVersionResponses.end())
      {
        std::map<CMACAddress,UserDataResponse>::iterator itUserData = itNIC->second.mapUserDataResponses.find(itStation->GetAddress());
        bool bKeepUserData = (itUserData == itNIC->second.mapUserDataResponses.end());

        UpdateRemoteDevice(itLocalDevice->second, itStation->GetAddress(), true,
          CDlanDevice::eThunderbolt, false, itVersion->second, false, 
          bKeepUserData ? UserDataResponse() : itUserData->second, bKeepUserData,
          itStation->GetTxRawRate(), itStation->GetRxRawRate(), false, 
          std::map<CMACAddress, CDlanDataRates>(), true, itStation->GetFirstBridgedAddress(), false, bUpdate);
      }
    }
  }
  else
  {
    for(std::map<CMACAddress,LocalDevice>::iterator itLocalDevice = itNIC->second.mapLocalDevices.begin();
      (itLocalDevice != itNIC->second.mapLocalDevices.end()); ++itLocalDevice)
    {
      if(itLocalDevice->second.mapRemoteDeviceAges.find(addr) != itLocalDevice->second.mapRemoteDeviceAges.end())
      {
        std::map<CMACAddress, CDlanDataRates> remoteDataRates;
        for(std::list<HomePlugAvMMEs::ThunderNetworkInfo::StationInfo>::const_iterator itStation = nwinfo.stations.begin(); 
          (itStation != nwinfo.stations.end()); itStation++)
        {
          remoteDataRates[itStation->GetAddress()] = CDlanDataRates(itStation->GetTxRawRate(), itStation->GetRxRawRate());
        }
        
        UpdateRemoteDevice(itLocalDevice->second, addr, false, CDlanDevice::eThunderbolt, false, 
          "", true, UserDataResponse(), true, 0.0, 0.0, true, remoteDataRates, false, CMACAddress(), true, bUpdate);

        break;
      }
    }

    if(bUpdate)
      OnUpdate();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, 0x6(%rsp)
leaq 0x158(%rsi), %rdi
movq %rdx, %rsi
callq 0xb432
movq %rax, %rdi
movq %rbp, %rsi
callq 0xb498
leaq 0x188(%rbx), %rdi
movq %r13, %rsi
callq 0xd5b6
leaq 0x190(%rbx), %rcx
cmpq %rcx, %rax
je 0xa47d
addq $0x8, %rbp
leaq 0xf8(%rbx), %rcx
movq %rcx, 0x68(%rsp)
leaq 0x100(%rbx), %rcx
movq %rcx, 0x60(%rsp)
leaq 0x128(%rbx), %rcx
movq %rcx, 0x50(%rsp)
addq $0x130, %rbx            # imm = 0x130
movq %rbx, 0x8(%rsp)
addq $0x28, %rax
movq %rax, 0x58(%rsp)
leaq 0x20(%rsp), %r14
leaq 0x70(%rsp), %r12
movq %rbp, 0x10(%rsp)
movq %rbp, %rbx
movq (%rbx), %rbx
cmpq 0x10(%rsp), %rbx
je 0xa620
leaq 0x10(%rbx), %r15
movq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0xd82e
cmpq 0x60(%rsp), %rax
je 0xa300
movq %rax, %rbp
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0xd86c
movq %rax, %r13
movq 0x8(%rsp), %rdx
cmpq %rdx, %rax
je 0xa356
leaq 0x28(%r13), %rsi
movq %r12, %rdi
callq 0xb032
movq 0x8(%rsp), %rdx
jmp 0xa3d2
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
andq $0x0, 0x78(%rsp)
xorl %ecx, %ecx
movb %cl, 0x80(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
andq $0x0, 0x98(%rsp)
movb %cl, 0xa0(%rsp)
leaq 0xc0(%rsp), %rax
movq %rax, 0xb0(%rsp)
andq $0x0, 0xb8(%rsp)
movb %cl, 0xc0(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
andq $0x0, 0xd8(%rsp)
movb %cl, 0xe0(%rsp)
addq $0x28, %rbp
xorl %eax, %eax
cmpq %rdx, %r13
sete %al
movl 0x1c(%rbx), %ecx
movl 0x20(%rbx), %edx
cvtsi2sd %rcx, %xmm0
movsd 0x9f97(%rip), %xmm2     # 0x14388
mulsd %xmm2, %xmm0
movsd 0x9f93(%rip), %xmm3     # 0x14390
mulsd %xmm3, %xmm0
cvtsi2sd %rdx, %xmm1
mulsd %xmm2, %xmm1
andq $0x0, 0x30(%rsp)
mulsd %xmm3, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm2, 0x20(%rsp)
leaq 0x28(%rsp), %rcx
movq %rcx, 0x38(%rsp)
movq %rcx, 0x40(%rsp)
andq $0x0, 0x48(%rsp)
leaq 0x16(%rbx), %rdi
movq 0x58(%rsp), %rsi
movq %r15, %rdx
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
xorl %r9d, %r9d
leaq 0x6(%rsp), %r10
pushq %r10
pushq $0x0
pushq %rdi
pushq $0x1
pushq %r14
pushq $0x0
pushq %rax
pushq %r12
pushq $0x0
pushq %rbp
callq 0x7f00
addq $0x50, %rsp
movq %r14, %rdi
callq 0x5a86
movq %r12, %rdi
callq 0x589e
jmp 0xa300
movq 0x1a0(%rbx), %r12
cmpq %rax, %r12
je 0xa620
movq %rax, %rbx
leaq 0x38(%r12), %rdi
movq %r13, %rsi
callq 0xd10c
leaq 0x40(%r12), %rcx
cmpq %rcx, %rax
jne 0xa4b7
movq %r12, %rdi
callq 0x41e0
movq %rax, %r12
movq %rbx, %rax
jmp 0xa484
leaq 0x28(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
addq $0x8, %rbp
leaq 0x20(%rsp), %r15
movq %rbp, %rbx
movq (%rbx), %rbx
cmpq %rbp, %rbx
je 0xa52f
leaq 0x10(%rbx), %rsi
movsd 0x1c(%rbx), %xmm0
movapd %xmm0, 0x10(%rsp)
movq %r15, %rdi
callq 0xb4c0
movapd 0x10(%rsp), %xmm1
unpcklps 0x9e27(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
movapd 0x9e2f(%rip), %xmm0     # 0x14340
orpd %xmm0, %xmm1
subpd %xmm0, %xmm1
mulpd 0x9e2f(%rip), %xmm1     # 0x14350
mulpd 0x9e37(%rip), %xmm1     # 0x14360
movupd %xmm1, (%rax)
jmp 0xa4dd
leaq 0x9d13(%rip), %rsi      # 0x14249
leaq 0xf8(%rsp), %rbx
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
callq 0x4ab0
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xf0(%rsp), %r10
andw $0x0, 0x4(%r10)
addq $0x28, %r12
andl $0x0, (%r10)
leaq 0x6(%rsp), %r11
pushq $0x1
popq %rax
leaq 0x70(%rsp), %rdi
pushq $0x2
popq %r8
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq %r12, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %r11
pushq %rax
pushq %r10
pushq $0x0
pushq %r15
pushq %rax
pushq %rax
pushq %rdi
pushq %rax
pushq %rbx
callq 0x7f00
addq $0x50, %rsp
leaq 0x70(%rsp), %rdi
callq 0x589e
leaq 0xf8(%rsp), %rdi
callq 0x4170
leaq 0x20(%rsp), %rdi
callq 0x5a86
testb $0x1, 0x6(%rsp)
je 0xa620
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0xa620
movq (%rdi), %rax
callq *(%rax)
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x589e
leaq 0xf8(%rsp), %rdi
callq 0x4170
jmp 0xa653
jmp 0xa650
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5a86
jmp 0xa676
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5a86
leaq 0x70(%rsp), %rdi
callq 0x589e
movq %rbx, %rdi
callq 0x4410