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

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

    if(mme.IsRemote())
    {
      for(std::map<CMACAddress,LocalDevice>::iterator itLocalDevice = itNIC->second.mapLocalDevices.begin();
        (itLocalDevice != itNIC->second.mapLocalDevices.end()); ++itLocalDevice)
      {
        if(itLocalDevice->second.mapRemoteDeviceAges.find(mme.GetAddress()) != itLocalDevice->second.mapRemoteDeviceAges.end())
        {
          UpdateRemoteDevice(itLocalDevice->second, mme.GetAddress(), true, CDlanDevice::eTurbo, false, "", false, 
            UserDataResponse(mme.GetManufacturer() + " " + mme.GetProductName()), false, 0.0, 0.0, true, 
            std::map<CMACAddress, CDlanDataRates>(), true, CMACAddress(), true, bUpdate);
          break;
        }
      }

      itNIC->second.setRemoteTurboResponses.insert(mme.GetAddress());
    }
    else
    {
      UpdateLocalDevice(itNIC, mme.GetAddress(), true, CDlanDevice::eTurbo, false, "", false, 
        mme.GetManufacturer() + " " + mme.GetProductName(), false, CMACAddress::Null(), false, bUpdate);
    }

    if(bUpdate)
      OnUpdate();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3f0, %rsp            # imm = 0x3F0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x338(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x193b0
movq -0x338(%rbp), %rdi
addq $0xa8, %rdi
movq -0x10(%rbp), %rsi
callq 0x17a40
movq -0x338(%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 0x1455b
jmp 0x14cb9
movb $0x0, -0x31(%rbp)
movq -0x18(%rbp), %rdi
callq 0x19870
testb $0x1, %al
jne 0x14571
jmp 0x14a1e
leaq -0x20(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x17dd0
movq %rax, -0x40(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x17d40
movq %rax, %rdi
addq $0x8, %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x17fc0
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x17f90
testb $0x1, %al
jne 0x145c7
jmp 0x14989
leaq -0x40(%rbp), %rdi
callq 0x17e00
addq $0x18, %rax
movq %rax, -0x350(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x56(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x19890
movq -0x350(%rbp), %rdi
movq -0x348(%rbp), %rsi
callq 0x18080
movq %rax, -0x340(%rbp)
jmp 0x1460b
movq -0x340(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x17e00
movq %rax, %rdi
addq $0x8, %rdi
addq $0x10, %rdi
callq 0x180b0
movq %rax, -0x70(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x18050
movb %al, -0x351(%rbp)
leaq -0x56(%rbp), %rdi
callq 0x6b70
movb -0x351(%rbp), %al
testb $0x1, %al
jne 0x1465e
jmp 0x14979
leaq -0x40(%rbp), %rdi
callq 0x17e00
addq $0x8, %rax
movq %rax, -0x368(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x76(%rbp), %rdi
callq 0x19890
leaq -0x99(%rbp), %rdi
movq %rdi, -0x360(%rbp)
callq 0x5540
movq -0x360(%rbp), %rdx
leaq 0x23ac1(%rip), %rsi     # 0x38161
leaq -0x98(%rbp), %rdi
callq 0x62a0
jmp 0x146ae
movq -0x18(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x199e0
jmp 0x146c0
leaq 0x23aff(%rip), %rdx     # 0x381c6
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x19990
jmp 0x146dc
movq -0x18(%rbp), %rsi
leaq -0x1a0(%rbp), %rdi
callq 0x19aa0
jmp 0x146ee
leaq -0x140(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0x198c0
jmp 0x1470a
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x19ba0
jmp 0x1471f
xorps %xmm0, %xmm0
movaps %xmm0, -0x1b0(%rbp)
movaps %xmm0, -0x1c0(%rbp)
movaps %xmm0, -0x1d0(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x18220
movq %rsp, %rax
movl $0x0, (%rax)
leaq -0x1d6(%rbp), %rdi
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x6230
jmp 0x14769
movq -0x368(%rbp), %rsi
movq -0x338(%rbp), %rdi
movq %rsp, %rax
movq %rax, -0x370(%rbp)
leaq -0x31(%rbp), %rcx
movq %rcx, 0x48(%rax)
leaq -0x1d6(%rbp), %rcx
movq %rcx, 0x38(%rax)
leaq -0x1d0(%rbp), %rcx
movq %rcx, 0x28(%rax)
leaq -0x120(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x98(%rbp), %rcx
movq %rcx, (%rax)
movl $0x1, 0x40(%rax)
movl $0x1, 0x30(%rax)
movl $0x1, 0x20(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x8(%rax)
leaq -0x76(%rbp), %rdx
movl $0x1, %r8d
xorl %r9d, %r9d
xorps %xmm1, %xmm1
movl %r8d, %ecx
movaps %xmm1, %xmm0
callq 0x120e0
jmp 0x147f4
leaq -0x1d6(%rbp), %rdi
callq 0x6b70
leaq -0x1d0(%rbp), %rdi
callq 0xacb0
leaq -0x120(%rbp), %rdi
callq 0x9d10
leaq -0x140(%rbp), %rdi
callq 0x5240
leaq -0x1a0(%rbp), %rdi
callq 0x5240
leaq -0x160(%rbp), %rdi
callq 0x5240
leaq -0x180(%rbp), %rdi
callq 0x5240
leaq -0x98(%rbp), %rdi
callq 0x5240
leaq -0x99(%rbp), %rdi
callq 0x5380
leaq -0x76(%rbp), %rdi
callq 0x6b70
jmp 0x14989
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x56(%rbp), %rdi
callq 0x6b70
jmp 0x14cc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1495f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14953
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14947
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1493b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1492f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14923
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1490b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1d6(%rbp), %rdi
callq 0x6b70
leaq -0x1d0(%rbp), %rdi
callq 0xacb0
leaq -0x120(%rbp), %rdi
callq 0x9d10
leaq -0x140(%rbp), %rdi
callq 0x5240
leaq -0x1a0(%rbp), %rdi
callq 0x5240
leaq -0x160(%rbp), %rdi
callq 0x5240
leaq -0x180(%rbp), %rdi
callq 0x5240
leaq -0x98(%rbp), %rdi
callq 0x5240
leaq -0x99(%rbp), %rdi
callq 0x5380
leaq -0x76(%rbp), %rdi
callq 0x6b70
jmp 0x14cc2
jmp 0x1497b
leaq -0x40(%rbp), %rdi
callq 0x18270
jmp 0x14591
leaq -0x20(%rbp), %rdi
callq 0x17d40
addq $0x48, %rax
movq %rax, -0x390(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x1dc(%rbp), %rdi
movq %rdi, -0x388(%rbp)
callq 0x19890
movq -0x390(%rbp), %rdi
movq -0x388(%rbp), %rsi
callq 0x193d0
movb %dl, -0x379(%rbp)
movq %rax, -0x378(%rbp)
jmp 0x149d6
movb -0x379(%rbp), %al
movq -0x378(%rbp), %rcx
movq %rcx, -0x1f0(%rbp)
movb %al, -0x1e8(%rbp)
leaq -0x1dc(%rbp), %rdi
callq 0x6b70
jmp 0x14ca5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1dc(%rbp), %rdi
callq 0x6b70
jmp 0x14cc2
movq -0x20(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x1fe(%rbp), %rdi
callq 0x19890
leaq -0x221(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x5540
movq -0x398(%rbp), %rdx
leaq 0x23707(%rip), %rsi     # 0x38161
leaq -0x220(%rbp), %rdi
callq 0x62a0
jmp 0x14a68
movq -0x18(%rbp), %rsi
leaq -0x308(%rbp), %rdi
callq 0x199e0
jmp 0x14a7a
leaq 0x23745(%rip), %rdx     # 0x381c6
leaq -0x2e8(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x19990
jmp 0x14a96
movq -0x18(%rbp), %rsi
leaq -0x328(%rbp), %rdi
callq 0x19aa0
jmp 0x14aa8
leaq -0x2c8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
leaq -0x328(%rbp), %rdx
callq 0x198c0
jmp 0x14ac4
leaq -0x2a8(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x19ba0
jmp 0x14ad9
leaq -0x32e(%rbp), %rdi
callq 0xb750
jmp 0x14ae7
movq -0x338(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
movq %rsp, %rax
leaq -0x31(%rbp), %rcx
movq %rcx, 0x30(%rax)
leaq -0x32e(%rbp), %rcx
movq %rcx, 0x20(%rax)
leaq -0x2a8(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x220(%rbp), %rcx
movq %rcx, (%rax)
movl $0x0, 0x28(%rax)
movl $0x0, 0x18(%rax)
movl $0x0, 0x8(%rax)
leaq -0x1fe(%rbp), %rdx
movl $0x1, %r8d
xorl %r9d, %r9d
movl %r8d, %ecx
callq 0x11920
jmp 0x14b4f
leaq -0x32e(%rbp), %rdi
callq 0x6b70
leaq -0x2a8(%rbp), %rdi
callq 0x9d10
leaq -0x2c8(%rbp), %rdi
callq 0x5240
leaq -0x328(%rbp), %rdi
callq 0x5240
leaq -0x2e8(%rbp), %rdi
callq 0x5240
leaq -0x308(%rbp), %rdi
callq 0x5240
leaq -0x220(%rbp), %rdi
callq 0x5240
leaq -0x221(%rbp), %rdi
callq 0x5380
leaq -0x1fe(%rbp), %rdi
callq 0x6b70
jmp 0x14ca5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x14c43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x32e(%rbp), %rdi
callq 0x6b70
leaq -0x2a8(%rbp), %rdi
callq 0x9d10
leaq -0x2c8(%rbp), %rdi
callq 0x5240
leaq -0x328(%rbp), %rdi
callq 0x5240
leaq -0x2e8(%rbp), %rdi
callq 0x5240
leaq -0x308(%rbp), %rdi
callq 0x5240
leaq -0x220(%rbp), %rdi
callq 0x5240
leaq -0x221(%rbp), %rdi
callq 0x5380
leaq -0x1fe(%rbp), %rdi
callq 0x6b70
jmp 0x14cc2
testb $0x1, -0x31(%rbp)
je 0x14cb7
movq -0x338(%rbp), %rdi
callq 0x17980
jmp 0x14cb9
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x5530
nopl (%rax,%rax)