// File: dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::OnInt51NetStatResponse(CMACAddress const&, HomePlugMMEs::Int51NetStat::CResponse const&)
void CDlanMonitor::OnInt51NetStatResponse(
  const CMACAddress& adapter, 
  const HomePlugMMEs::Int51NetStat::CResponse& mme)
{
  std::map<CMACAddress,NetwAdapter>::iterator itNIC;

  if((itNIC = m_mapNICs.find(adapter)) != m_mapNICs.end())
  {
    bool bUpdate = false;

    LocalDevice& localDevice = UpdateLocalDevice(itNIC, mme.GetAddress(), true, 
      CDlanDevice::eHP1, false, "", false, UserDataResponse(), true, CMACAddress::Null(), false, bUpdate);

    std::list<HomePlugMMEs::Int51NetStat::Destination> listDestinations = mme.GetDestinations();
    for(std::list<HomePlugMMEs::Int51NetStat::Destination>::iterator itDest = listDestinations.begin();
      (itDest != listDestinations.end()); itDest++)
    {
      if(itDest->GetAddress() != CMACAddress::Null())
      {
        if(itDest->IsToneMapValid())
        {
          bool bTurbo =
            itNIC->second.setRemoteTurboResponses.find(itDest->GetAddress()) != itNIC->second.setRemoteTurboResponses.end();

          UpdateRemoteDevice(localDevice, itDest->GetAddress(), true, 
            bTurbo ? CDlanDevice::eTurbo : CDlanDevice::eHP1, !bTurbo, "", false, UserDataResponse(), true, 
            itDest->GetTxRate(), 0.0, false, std::map<CMACAddress, CDlanDataRates>(), true, CMACAddress(), true, bUpdate);
        }
        else
        {
          itNIC->second.setDevicesToTrigger.insert(itDest->GetAddress());
        }
      }
    }

    if(bUpdate)
      OnUpdate();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x193b0
movq -0x270(%rbp), %rdi
addq $0xa8, %rdi
movq -0x10(%rbp), %rsi
callq 0x17a40
movq -0x270(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
addq $0xa8, %rdi
callq 0x17a70
movq %rax, -0x30(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x17cb0
testb $0x1, %al
jne 0x13dbb
jmp 0x14496
movb $0x0, -0x31(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x4e(%rbp), %rdi
callq 0x19450
leaq -0x71(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x5540
movq -0x278(%rbp), %rdx
leaq 0x2436f(%rip), %rsi     # 0x38161
leaq -0x70(%rbp), %rdi
callq 0x62a0
jmp 0x13dfd
leaq -0x108(%rbp), %rdi
callq 0x18100
jmp 0x13e0b
leaq -0x10e(%rbp), %rdi
callq 0xb750
jmp 0x13e19
movq -0x270(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rsp, %rax
leaq -0x31(%rbp), %rcx
movq %rcx, 0x30(%rax)
leaq -0x10e(%rbp), %rcx
movq %rcx, 0x20(%rax)
leaq -0x108(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movl $0x0, 0x28(%rax)
movl $0x1, 0x18(%rax)
movl $0x0, 0x8(%rax)
leaq -0x4e(%rbp), %rdx
movl $0x1, %ecx
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x11920
movq %rax, -0x280(%rbp)
jmp 0x13e7e
leaq -0x10e(%rbp), %rdi
callq 0x6b70
leaq -0x108(%rbp), %rdi
callq 0x9d10
leaq -0x70(%rbp), %rdi
callq 0x5240
leaq -0x71(%rbp), %rdi
callq 0x5380
leaq -0x4e(%rbp), %rdi
callq 0x6b70
movq -0x280(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x128(%rbp), %rdi
callq 0x19480
leaq -0x128(%rbp), %rdi
callq 0x19510
movq %rax, -0x130(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x19570
movq %rax, -0x138(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x19540
testb $0x1, %al
jne 0x13f0e
jmp 0x14464
leaq -0x130(%rbp), %rdi
callq 0x195a0
movq %rax, %rsi
leaq -0x13e(%rbp), %rdi
callq 0x195c0
jmp 0x13f2b
leaq -0x144(%rbp), %rdi
callq 0xb750
jmp 0x13f39
leaq -0x13e(%rbp), %rdi
leaq -0x144(%rbp), %rsi
callq 0xd590
movb %al, -0x281(%rbp)
jmp 0x13f54
leaq -0x144(%rbp), %rdi
callq 0x6b70
leaq -0x13e(%rbp), %rdi
callq 0x6b70
movb -0x281(%rbp), %al
testb $0x1, %al
jne 0x13f7b
jmp 0x14448
leaq -0x130(%rbp), %rdi
callq 0x195a0
movq %rax, %rdi
callq 0x196a0
movb %al, -0x282(%rbp)
jmp 0x13f97
movb -0x282(%rbp), %al
testb $0x1, %al
jne 0x13fa6
jmp 0x143ae
leaq -0x20(%rbp), %rdi
callq 0x17d40
addq $0x48, %rax
movq %rax, -0x290(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x195a0
movq %rax, %rsi
leaq -0x156(%rbp), %rdi
callq 0x195c0
jmp 0x13fd7
movq -0x290(%rbp), %rdi
leaq -0x156(%rbp), %rsi
callq 0x197a0
movq %rax, -0x298(%rbp)
jmp 0x13ff3
movq -0x298(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x48, %rdi
callq 0x179e0
movq %rax, -0x160(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xe190
movb %al, -0x2a1(%rbp)
leaq -0x156(%rbp), %rdi
callq 0x6b70
movb -0x2a1(%rbp), %al
movb %al, -0x145(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x2a0(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x195a0
movq %rax, %rsi
leaq -0x166(%rbp), %rdi
callq 0x195c0
jmp 0x14076
movzbl -0x145(%rbp), %ecx
movb %cl, %al
andl $0x1, %ecx
movl %ecx, -0x2b8(%rbp)
xorb $0x1, %al
movb %al, -0x2b1(%rbp)
leaq -0x189(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x5540
movq -0x2b0(%rbp), %rdx
leaq 0x240b0(%rip), %rsi     # 0x38161
leaq -0x188(%rbp), %rdi
callq 0x62a0
jmp 0x140bf
leaq -0x210(%rbp), %rdi
callq 0x18100
jmp 0x140cd
leaq -0x130(%rbp), %rdi
callq 0x195a0
movq %rax, %rdi
callq 0x197e0
movsd %xmm0, -0x2c0(%rbp)
jmp 0x140eb
xorps %xmm0, %xmm0
movaps %xmm0, -0x220(%rbp)
movaps %xmm0, -0x230(%rbp)
movaps %xmm0, -0x240(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x18220
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x246(%rbp), %rdi
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x6230
jmp 0x14135
movsd -0x2c0(%rbp), %xmm0
movl -0x2b8(%rbp), %r8d
movq -0x2a0(%rbp), %rsi
movq -0x270(%rbp), %rdi
movb -0x2b1(%rbp), %al
movq %rsp, %rcx
movq %rcx, -0x2c8(%rbp)
leaq -0x31(%rbp), %rdx
movq %rdx, 0x48(%rcx)
leaq -0x246(%rbp), %rdx
movq %rdx, 0x38(%rcx)
leaq -0x240(%rbp), %rdx
movq %rdx, 0x28(%rcx)
leaq -0x210(%rbp), %rdx
movq %rdx, 0x10(%rcx)
leaq -0x188(%rbp), %rdx
movq %rdx, (%rcx)
movl $0x1, 0x40(%rcx)
movl $0x1, 0x30(%rcx)
movl $0x0, 0x20(%rcx)
movl $0x1, 0x18(%rcx)
movl $0x0, 0x8(%rcx)
movzbl %al, %r9d
andl $0x1, %r9d
leaq -0x166(%rbp), %rdx
movl $0x1, %ecx
xorps %xmm1, %xmm1
callq 0x120e0
jmp 0x141d6
leaq -0x246(%rbp), %rdi
callq 0x6b70
leaq -0x240(%rbp), %rdi
callq 0xacb0
leaq -0x210(%rbp), %rdi
callq 0x9d10
leaq -0x188(%rbp), %rdi
callq 0x5240
leaq -0x189(%rbp), %rdi
callq 0x5380
leaq -0x166(%rbp), %rdi
callq 0x6b70
jmp 0x14446
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x14286
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1427d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x14271
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x10e(%rbp), %rdi
callq 0x6b70
leaq -0x108(%rbp), %rdi
callq 0x9d10
leaq -0x70(%rbp), %rdi
callq 0x5240
leaq -0x71(%rbp), %rdi
callq 0x5380
leaq -0x4e(%rbp), %rdi
callq 0x6b70
jmp 0x1449f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x14488
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x142dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x144(%rbp), %rdi
callq 0x6b70
leaq -0x13e(%rbp), %rdi
callq 0x6b70
jmp 0x14488
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x156(%rbp), %rdi
callq 0x6b70
jmp 0x14488
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x14391
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x14385
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x14379
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x1436d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x246(%rbp), %rdi
callq 0x6b70
leaq -0x240(%rbp), %rdi
callq 0xacb0
leaq -0x210(%rbp), %rdi
callq 0x9d10
leaq -0x188(%rbp), %rdi
callq 0x5240
leaq -0x189(%rbp), %rdi
callq 0x5380
leaq -0x166(%rbp), %rdi
callq 0x6b70
jmp 0x14488
leaq -0x20(%rbp), %rdi
callq 0x17d40
addq $0x78, %rax
movq %rax, -0x2d0(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x195a0
movq %rax, %rsi
leaq -0x24c(%rbp), %rdi
callq 0x195c0
jmp 0x143df
movq -0x2d0(%rbp), %rdi
leaq -0x24c(%rbp), %rsi
callq 0x193d0
movb %dl, -0x2d9(%rbp)
movq %rax, -0x2d8(%rbp)
jmp 0x14401
movb -0x2d9(%rbp), %al
movq -0x2d8(%rbp), %rcx
movq %rcx, -0x260(%rbp)
movb %al, -0x258(%rbp)
leaq -0x24c(%rbp), %rdi
callq 0x6b70
jmp 0x14446
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x24c(%rbp), %rdi
callq 0x6b70
jmp 0x14488
jmp 0x14448
jmp 0x1444a
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
callq 0x19820
movq %rax, -0x268(%rbp)
jmp 0x13edf
testb $0x1, -0x31(%rbp)
je 0x1447a
movq -0x270(%rbp), %rdi
callq 0x17980
jmp 0x14478
jmp 0x1447a
leaq -0x128(%rbp), %rdi
callq 0x19850
jmp 0x14496
leaq -0x128(%rbp), %rdi
callq 0x19850
jmp 0x1449f
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x5530
nopl (%rax,%rax)