// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, %rbp
movq %rdi, %rbx
addq $0xa8, %rdi
callq 0xccd4
movq %rax, %r14
leaq 0xb0(%rbx), %rax
cmpq %rax, %r14
je 0x8e2b
movb $0x0, 0xa(%rsp)
movzwl 0xa(%rbp), %eax
movw %ax, 0xf4(%rsp)
movl 0x6(%rbp), %eax
movl %eax, 0xf0(%rsp)
leaq 0xb70f(%rip), %rsi      # 0x14249
leaq 0x40(%rsp), %r15
leaq 0x12(%rsp), %rdx
movq %r15, %rdi
callq 0x4ab0
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %eax, %eax
movb %al, (%rcx)
leaq 0xa0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xc0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xe0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq 0x110(%rsp), %r12
andw $0x0, 0x4(%r12)
movb %al, (%rcx)
andl $0x0, (%r12)
subq $0x8, %rsp
leaq 0x12(%rsp), %rax
leaq 0x78(%rsp), %r13
leaq 0xf8(%rsp), %rdx
pushq $0x1
popq %rcx
movq %rbx, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq $0x0
pushq %r12
pushq $0x1
pushq %r13
pushq $0x0
pushq %r15
callq 0x7bd4
addq $0x40, %rsp
movq %rax, 0x28(%rsp)
movq %r13, %rdi
callq 0x589e
movq %r15, %rdi
callq 0x4170
movq %r12, %rdi
movq %rbp, %rsi
callq 0xadc6
leaq 0x98(%r14), %rax
movq %rax, 0x38(%rsp)
leaq 0x68(%r14), %rax
movq %rax, 0x30(%rsp)
addq $0x70, %r14
movq %r14, 0x20(%rsp)
movq %r12, %rbx
movq (%r12), %r12
cmpq %rbx, %r12
je 0x8e04
leaq 0x10(%r12), %rbp
movq %r13, %rdi
movq %rbp, %rsi
callq 0xadf0
andw $0x0, 0x44(%rsp)
andl $0x0, 0x40(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x6400
testb %al, %al
je 0x8c2f
movq %rbp, %rdi
callq 0xae52
testb %al, %al
je 0x8de7
movq %r13, %rdi
movq %rbp, %rsi
callq 0xadf0
movq 0x30(%rsp), %rdi
movq %r13, %rsi
callq 0xe0ae
movq %rax, %r14
leaq 0x12(%rsp), %rdi
movq %rbp, %rsi
callq 0xadf0
leaq 0xf0(%rsp), %rbp
movq %rbp, %rdi
leaq 0xb599(%rip), %rsi      # 0x14249
leaq 0xb(%rsp), %rdx
callq 0x4ab0
xorl %r9d, %r9d
xorl %r8d, %r8d
cmpq 0x20(%rsp), %r14
sete %r9b
setne %r8b
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)
movzwl 0x16(%r12), %eax
cvtsi2sd %eax, %xmm0
divsd 0xb615(%rip), %xmm0     # 0x14370
xorps %xmm1, %xmm1
movaps %xmm1, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x58(%rsp)
movq %rax, 0x60(%rsp)
andq $0x0, 0x68(%rsp)
mulsd 0xb5f2(%rip), %xmm0     # 0x14378
andw $0x0, 0x10(%rsp)
addsd 0xb5ec(%rip), %xmm0     # 0x14380
andl $0x0, 0xc(%rsp)
xorps %xmm1, %xmm1
movq 0x28(%rsp), %rsi
leaq 0x12(%rsp), %rdx
pushq $0x1
popq %rcx
leaq 0xa(%rsp), %rax
pushq %rax
pushq %rcx
leaq 0x1c(%rsp), %rax
pushq %rax
pushq %rcx
pushq %r15
pushq $0x0
pushq %rcx
pushq %r13
pushq $0x0
pushq %rbp
callq 0x7f00
addq $0x50, %rsp
movq %r15, %rdi
callq 0x5a86
movq %r13, %rdi
callq 0x589e
movq %rbp, %rdi
callq 0x4170
jmp 0x8c2f
movq %r13, %rdi
movq %rbp, %rsi
callq 0xadf0
movq 0x38(%rsp), %rdi
movq %r13, %rsi
callq 0xdfea
jmp 0x8c2f
cmpb $0x0, 0xa(%rsp)
je 0x8e1e
movq 0x18(%rsp), %rax
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0x8e1e
movq (%rdi), %rax
callq *(%rax)
leaq 0x110(%rsp), %rdi
callq 0xc142
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8e93
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x589e
leaq 0x40(%rsp), %rdi
callq 0x4170
jmp 0x8ea3
movq %rax, %rbx
jmp 0x8ea3
jmp 0x8e93
jmp 0x8e93
jmp 0x8e93
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x5a86
leaq 0x70(%rsp), %rdi
callq 0x589e
leaq 0xf0(%rsp), %rdi
callq 0x4170
jmp 0x8e96
jmp 0x8e93
jmp 0x8e93
jmp 0x8e93
jmp 0x8e93
jmp 0x8e93
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0xc142
movq %rbx, %rdi
callq 0x4410
nop