// File: /workspace/github_cpp_makefile_star2_O1/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 $0x108, %rsp            # imm = 0x108
movq %rcx, %r12
movq %rdx, %r13
movq %rdi, %r14
movb $0x0, 0x7(%rsp)
movq %rsi, %r15
leaq 0x158(%rsi), %rdi
movq %rdx, %rsi
callq 0xcad8
cmpq %r12, %rax
je 0xb71c
movzwl 0x4(%r12), %ecx
movw %cx, 0x4(%rax)
movl (%r12), %ecx
movl %ecx, (%rax)
leaq 0x8(%r12), %rdx
addq $0x8, %rax
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0xdba4
leaq 0x188(%r15), %rdi
movq %r13, %rsi
callq 0xe946
leaq 0x190(%r15), %rbx
movq %rax, 0x18(%rsp)
cmpq %rbx, %rax
je 0xb9a7
movq 0x8(%r12), %r14
addq $0x8, %r12
cmpq %r12, %r14
je 0xbbfb
leaq 0xf8(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x100(%r15), %rax
movq %rax, 0xd8(%rsp)
leaq 0x128(%r15), %rax
movq %rax, 0xd0(%rsp)
addq $0x130, %r15            # imm = 0x130
movq %r15, 0x8(%rsp)
addq $0x28, 0x18(%rsp)
leaq 0x10(%r14), %rbp
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0xec36
cmpq 0xd8(%rsp), %rax
je 0xb996
movq %rax, %r13
movq %r12, %r15
movq 0xd0(%rsp), %rdi
movq %rbp, %rsi
callq 0xece6
movq %rax, %r12
movq 0x8(%rsp), %rcx
cmpq %rcx, %rax
je 0xb7ec
leaq 0x28(%r12), %rsi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0xc688
movq 0x8(%rsp), %rcx
xorl %r11d, %r11d
jmp 0xb850
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %r11d, %r11d
movq %r11, 0x28(%rsp)
movb %r11b, 0x30(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movb %r11b, 0x50(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %r11, 0x68(%rsp)
movb %r11b, 0x70(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %r11, 0x88(%rsp)
movb %r11b, 0x90(%rsp)
leaq 0x20(%rsp), %rbx
addq $0x28, %r13
xorl %eax, %eax
cmpq %rcx, %r12
sete %al
movl 0x1c(%r14), %ecx
movl 0x20(%r14), %edx
cvtsi2sd %rcx, %xmm0
movsd 0xaba7(%rip), %xmm2     # 0x16418
mulsd %xmm2, %xmm0
movsd 0xaba3(%rip), %xmm3     # 0x16420
mulsd %xmm3, %xmm0
cvtsi2sd %rdx, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm2, 0xb0(%rsp)
movapd %xmm2, 0xc0(%rsp)
movapd %xmm2, 0xa0(%rsp)
leaq 0xa8(%rsp), %rcx
movq %rcx, 0xb8(%rsp)
movq %rcx, 0xc0(%rsp)
movq $0x0, 0xc8(%rsp)
leaq 0x16(%r14), %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %rdx
movl $0x1, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
leaq 0x7(%rsp), %r10
pushq %r10
pushq %r11
pushq %rdi
pushq $0x1
leaq 0xc0(%rsp), %r12
pushq %r12
pushq %r11
pushq %rax
pushq %rbx
pushq %r11
pushq %r13
callq 0x8748
addq $0x50, %rsp
movq %r12, %rdi
callq 0x612a
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
movq %r15, %r12
je 0xb942
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xb95e
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0xb97a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xb996
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4270
movq (%r14), %r14
cmpq %r12, %r14
jne 0xb78e
jmp 0xbbfb
movq 0x1a0(%r15), %r15
cmpq %rbx, %r15
je 0xbbe6
leaq 0x38(%r15), %rdi
movq %r13, %rsi
callq 0xe3b4
leaq 0x40(%r15), %rcx
cmpq %rcx, %rax
jne 0xb9e1
movq %r15, %rdi
callq 0x41d0
movq %rax, %r15
cmpq %rbx, %rax
jne 0xb9b7
jmp 0xbbe6
movq %r13, 0x8(%rsp)
movq %r14, 0x10(%rsp)
leaq 0xa8(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq 0x8(%r12), %rbx
addq $0x8, %r12
cmpq %r12, %rbx
je 0xba7d
movq %r12, %r13
leaq 0xa0(%rsp), %r12
leaq 0x10(%rbx), %rsi
movl 0x1c(%rbx), %ebp
movl 0x20(%rbx), %r14d
movq %r12, %rdi
callq 0xcb56
movl %r14d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
movsd 0xa9ce(%rip), %xmm2     # 0x16418
mulsd %xmm2, %xmm0
movsd 0xa9ca(%rip), %xmm3     # 0x16420
mulsd %xmm3, %xmm0
movl %ebp, %ecx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
movsd %xmm1, (%rax)
movsd %xmm0, 0x8(%rax)
movq (%rbx), %rbx
cmpq %r13, %rbx
jne 0xba24
leaq 0xf0(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xa7b9(%rip), %rdx      # 0x16249
leaq 0xe0(%rsp), %rdi
movq %rdi, %r13
movq %rdx, %rsi
callq 0x6476
addq $0x28, %r15
leaq 0x30(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x70(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq %rax, -0x8(%rbx)
movb %al, (%rbx)
leaq 0x90(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq %rax, -0x8(%rbp)
movb %al, (%rbp)
leaq 0x100(%rsp), %r11
movl %eax, (%r11)
movw $0x0, 0x4(%r11)
leaq 0x7(%rsp), %r14
movl $0x1, %edi
leaq 0xa0(%rsp), %r10
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movq %r15, %rsi
movq 0x8(%rsp), %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
pushq %r14
pushq %rdi
pushq %r11
pushq %rax
pushq %r10
pushq %rdi
pushq %rdi
leaq 0x58(%rsp), %rax
pushq %rax
pushq %rdi
pushq %r13
callq 0x8748
addq $0x50, %rsp
movq 0x80(%rsp), %rdi
cmpq %rbp, %rdi
je 0xbb65
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x60(%rsp), %rdi
cmpq %rbx, %rdi
movq 0x10(%rsp), %r14
je 0xbb81
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0xbb98
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xbbb4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xbbd9
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0xa0(%rsp), %rdi
callq 0x612a
cmpb $0x1, 0x7(%rsp)
jne 0xbbfb
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0xbbfb
movq (%rdi), %rax
callq *(%rax)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xc160
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xbc46
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4270
jmp 0xbc46
jmp 0xbc43
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x612a
jmp 0xbc6f
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x612a
leaq 0x20(%rsp), %rdi
callq 0xc160
movq %rbx, %rdi
callq 0x43e0
nop