// File: /workspace/github_cpp_makefile_star2_O3/dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::OnThunderGetVersionConfirm(CMACAddress const&, HomePlugAvMMEs::ThunderGetVersion::CConfirm const&)
void CDlanMonitor::OnThunderGetVersionConfirm(
  const CMACAddress& adapter, 
  const HomePlugAvMMEs::ThunderGetVersion::CConfirm& mme)
{
  std::map<CMACAddress,NetwAdapter>::iterator itNIC;

  if(((itNIC = m_mapNICs.find(adapter)) != m_mapNICs.end()) &&
    (mme.GetStatus() == HomePlugAvMMEs::ThunderGetVersion::eSuccess))
  {
    bool bUpdate = false;

    itNIC->second.mapGetVersionResponses[mme.GetAddress()] = mme.GetVersion();

    std::map<CMACAddress,UserDataResponse>::iterator itUserData = itNIC->second.mapUserDataResponses.find(mme.GetAddress());
    bool bKeepUserData = (itUserData == itNIC->second.mapUserDataResponses.end());
    
    std::map<CMACAddress,NetworkInfoResponse>::const_iterator itNetworkInfo = itNIC->second.mapNetworkInfoResponses.find(mme.GetAddress());
    bool bKeepCCo = (itNetworkInfo == itNIC->second.mapNetworkInfoResponses.end());

    if(itNIC->second.setReadModDataResponses.find(mme.GetAddress()) != itNIC->second.setReadModDataResponses.end())
    {
      UpdateLocalDevice(itNIC, mme.GetAddress(), true, CDlanDevice::eThunderbolt, false, 
        mme.GetVersion(), false, bKeepUserData ? UserDataResponse() : itUserData->second, bKeepUserData, 
        bKeepCCo ? CMACAddress::Null() : itNetworkInfo->second.ccoAddr, bKeepCCo, bUpdate);
    }
    else
    {
      bool bDone = false;
      for(itNetworkInfo = itNIC->second.mapNetworkInfoResponses.begin();
        !bDone && (itNetworkInfo != itNIC->second.mapNetworkInfoResponses.end()); ++itNetworkInfo)
      {
        std::map<CMACAddress,LocalDevice>::iterator itLocalDevice = itNIC->second.mapLocalDevices.find(itNetworkInfo->first);
        if(itLocalDevice != itNIC->second.mapLocalDevices.end())
        {
          for(std::list<HomePlugAvMMEs::ThunderNetworkInfo::StationInfo>::const_iterator itStation = itNetworkInfo->second.stations.begin();
            !bDone && (itStation != itNetworkInfo->second.stations.end()); ++itStation)
          {
            if(itStation->GetAddress() == mme.GetAddress())
            {
              UpdateRemoteDevice(itLocalDevice->second, itStation->GetAddress(), true,
                CDlanDevice::eThunderbolt, false, mme.GetVersion(), false, 
                bKeepUserData ? UserDataResponse() : itUserData->second, bKeepUserData,
                itStation->GetTxRawRate(), itStation->GetRxRawRate(), false, 
                std::map<CMACAddress, CDlanDataRates>(), true, itStation->GetFirstBridgedAddress(), false, bUpdate);
              bDone = true;
            }
          }
        }
      }
    }

    if(bUpdate)
      OnUpdate();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdx, %rbp
movq %rdi, %rbx
addq $0xa8, %rdi
callq 0xdc9e
movq %rax, %r15
leaq 0xb0(%rbx), %rax
cmpq %rax, %r15
je 0xb1d0
cmpb $0x0, 0x14(%rbp)
jne 0xb1d0
movb $0x0, 0xf(%rsp)
leaq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0xc750
movzwl 0xa(%rbp), %eax
leaq 0xb0(%rsp), %rsi
movw %ax, 0x4(%rsi)
movl 0x6(%rbp), %eax
movl %eax, (%rsi)
leaq 0xf8(%r15), %rdi
callq 0xc7ea
movq %rbx, 0xa8(%rsp)
leaq 0x6(%rbp), %r13
leaq 0x28(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42f0
movq (%rbx), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xacdf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0x128(%r15), %rdi
movzwl 0x4(%r13), %eax
leaq 0x28(%rsp), %rbx
movw %ax, 0x4(%rbx)
movl (%r13), %eax
movl %eax, (%rbx)
movq %rbx, %rsi
callq 0xea9a
movq %rax, 0x20(%rsp)
leaq 0x130(%r15), %rax
movq %rax, 0x18(%rsp)
leaq 0x158(%r15), %rdi
movzwl 0x4(%r13), %eax
movw %ax, 0x4(%rbx)
movl (%r13), %eax
movl %eax, (%rbx)
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0xfcd2
movq %rax, %r12
leaq 0x160(%r15), %r14
leaq 0xc8(%r15), %rdi
movzwl 0x4(%r13), %eax
movw %ax, 0x4(%rbx)
movl (%r13), %eax
movl %eax, (%rbx)
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0xf3a4
leaq 0xd0(%r15), %rcx
cmpq %rcx, %rax
je 0xadbf
movzwl 0x4(%r13), %eax
movw %ax, 0xe4(%rsp)
movl (%r13), %eax
movl %eax, 0xe0(%rsp)
leaq 0xb0(%rsp), %rdi
movq %rbp, %rsi
callq 0xc750
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
leaq 0x38(%rsp), %r13
je 0xae62
leaq 0x28(%rax), %rsi
leaq 0x28(%rsp), %rdi
callq 0xc418
jmp 0xae9f
movq 0x170(%r15), %r12
cmpq %r14, %r12
je 0xb1b3
leaq 0x188(%r15), %rax
movq %rax, 0x110(%rsp)
addq $0x190, %r15            # imm = 0x190
movq 0x20(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x100(%rsp)
leaq 0x20(%r12), %rsi
movq 0x110(%rsp), %rdi
callq 0xe6ee
movq %rax, 0x108(%rsp)
cmpq %r15, %rax
je 0xae4d
leaq 0x30(%r12), %rax
movq 0x30(%r12), %rbx
cmpq %rax, %rbx
je 0xae4d
movzwl 0x4(%r13), %ecx
movw %cx, 0x2c(%rsp)
movl (%r13), %edx
movl %edx, 0x28(%rsp)
xorl 0x10(%rbx), %edx
xorw 0x14(%rbx), %cx
movzwl %cx, %ecx
orl %edx, %ecx
je 0xafbf
movq (%rbx), %rbx
jmp 0xae1f
movq %r12, %rdi
callq 0x42d0
movq %rax, %r12
cmpq %r14, %rax
jne 0xadf6
jmp 0xb1b3
leaq 0x58(%rsp), %rax
movq %r13, -0x30(%rax)
xorl %ecx, %ecx
movq %rcx, -0x28(%rax)
movb %cl, -0x20(%rax)
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movq %rbx, %rbp
cmpq %r14, %r12
je 0xaebd
movzwl 0x2c(%r12), %eax
movw %ax, 0x14(%rsp)
movl 0x28(%r12), %eax
movl %eax, 0x10(%rsp)
jmp 0xaecc
movw $0x0, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
xorl %eax, %eax
cmpq %r14, %r12
sete %al
xorl %r10d, %r10d
movq 0x18(%rsp), %rcx
cmpq %rcx, 0x20(%rsp)
sete %r10b
subq $0x8, %rsp
leaq 0x17(%rsp), %r11
leaq 0x18(%rsp), %rbx
leaq 0xe8(%rsp), %rdx
movq 0xb0(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
pushq %r11
pushq %rax
pushq %rbx
pushq %r10
pushq %rbp
pushq $0x0
leaq 0xe8(%rsp), %rax
pushq %rax
callq 0x80e6
addq $0x40, %rsp
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf50
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf6b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xaf86
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xaf9d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb1b3
movq 0xc0(%rsp), %rsi
jmp 0xb1ab
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
callq 0xc750
movq 0x20(%rsp), %r13
cmpq 0x18(%rsp), %r13
je 0xaffc
leaq 0x28(%rsp), %rdi
movq 0x100(%rsp), %rsi
callq 0xc418
leaq 0x38(%rsp), %r12
leaq 0x58(%rsp), %rbp
jmp 0xb056
leaq 0x38(%rsp), %r12
movq %r12, 0x28(%rsp)
xorl %eax, %eax
movq %rax, 0x30(%rsp)
movb %al, 0x38(%rsp)
leaq 0x58(%rsp), %rbp
movq %rbp, 0x48(%rsp)
movq %rax, 0x50(%rsp)
movb %al, 0x58(%rsp)
leaq 0x78(%rsp), %rcx
movq %rcx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movb %al, 0x78(%rsp)
leaq 0x98(%rsp), %rcx
movq %rcx, 0x88(%rsp)
movq %rax, 0x90(%rsp)
movb %al, 0x98(%rsp)
leaq 0x10(%rbx), %rdx
movq 0x108(%rsp), %rsi
addq $0x28, %rsi
xorl %eax, %eax
cmpq 0x18(%rsp), %r13
sete %al
movl 0x1c(%rbx), %ecx
movl 0x20(%rbx), %edi
cvtsi2sd %rcx, %xmm0
movsd 0xb355(%rip), %xmm2     # 0x163d8
mulsd %xmm2, %xmm0
movsd 0xb351(%rip), %xmm3     # 0x163e0
mulsd %xmm3, %xmm0
cvtsi2sd %rdi, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
xorl %edi, %edi
movq %rdi, 0xc0(%rsp)
xorpd %xmm2, %xmm2
movapd %xmm2, 0xb0(%rsp)
leaq 0xb8(%rsp), %rcx
movq %rcx, 0xc8(%rsp)
movq %rcx, 0xd0(%rsp)
movq %rdi, 0xd8(%rsp)
addq $0x16, %rbx
leaq 0xf(%rsp), %r10
movl $0x1, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
pushq %r10
pushq %rdi
pushq %rbx
pushq $0x1
leaq 0xd0(%rsp), %r10
pushq %r10
pushq %rdi
pushq %rax
leaq 0x60(%rsp), %rax
pushq %rax
pushq %rdi
pushq %r15
callq 0x85ba
addq $0x50, %rsp
leaq 0xb0(%rsp), %rdi
callq 0x60e0
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xb144
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb160
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb177
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0xb18e
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xb1b3
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4270
cmpb $0x1, 0xf(%rsp)
jne 0xb1d0
movq 0xa8(%rsp), %rax
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0xb1d0
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
jmp 0xb201
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x60e0
leaq 0x28(%rsp), %rdi
callq 0xbf00
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xb270
movq 0xf0(%rsp), %rsi
jmp 0xb268
movq %rax, %rbx
jmp 0xb232
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbf00
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb270
movq 0xc0(%rsp), %rsi
jmp 0xb268
movq %rax, %rbx
jmp 0xb270
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb270
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4270
movq %rbx, %rdi
callq 0x43e0