// File: /workspace/github_cpp_makefile_star2_O1/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 $0x138, %rsp            # imm = 0x138
movq %rdx, %r12
movq %rdi, %r14
addq $0xa8, %rdi
callq 0xdefe
movq %rax, %r13
leaq 0xb0(%r14), %rax
cmpq %rax, %r13
je 0xb413
cmpb $0x0, 0x14(%r12)
jne 0xb413
movb $0x0, 0xf(%rsp)
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0xc9c0
movzwl 0xa(%r12), %eax
leaq 0xe0(%rsp), %rsi
movw %ax, 0x4(%rsi)
movl 0x6(%r12), %eax
movl %eax, (%rsi)
leaq 0xf8(%r13), %rdi
callq 0xca5a
leaq 0x6(%r12), %r15
leaq 0x30(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x42f0
movq (%rbx), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xae84
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4270
movq %r14, 0x28(%rsp)
leaq 0x128(%r13), %rdi
movzwl 0x4(%r15), %eax
leaq 0x30(%rsp), %rbx
movw %ax, 0x4(%rbx)
movl (%r15), %eax
movl %eax, (%rbx)
movq %rbx, %rsi
callq 0xece6
movq %rax, 0x18(%rsp)
leaq 0x130(%r13), %rax
movq %rax, 0x20(%rsp)
leaq 0x158(%r13), %rdi
movzwl 0x4(%r15), %eax
movw %ax, 0x4(%rbx)
movl (%r15), %eax
movl %eax, (%rbx)
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0xff2a
movq %rax, %r14
leaq 0x160(%r13), %rbp
leaq 0xc8(%r13), %rdi
movzwl 0x4(%r15), %eax
movw %ax, 0x4(%rbx)
movl (%r15), %eax
movl %eax, (%rbx)
leaq 0x30(%rsp), %rsi
callq 0xf5f6
leaq 0xd0(%r13), %rcx
cmpq %rcx, %rax
je 0xaf65
movzwl 0x4(%r15), %eax
movw %ax, 0xc4(%rsp)
movl (%r15), %eax
movl %eax, 0xc0(%rsp)
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc9c0
movq 0x18(%rsp), %r15
cmpq 0x20(%rsp), %r15
je 0xb299
leaq 0x28(%r15), %rsi
leaq 0x30(%rsp), %rdi
callq 0xc688
movq 0x28(%rsp), %rdi
jmp 0xb2e3
movq %r12, 0x130(%rsp)
movq 0x170(%r13), %rcx
cmpq %rbp, %rcx
je 0xb3f9
leaq 0x188(%r13), %rax
movq %rax, 0x120(%rsp)
addq $0x190, %r13            # imm = 0x190
movq 0x18(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x128(%rsp)
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %r13, 0x118(%rsp)
movq %rbp, 0x110(%rsp)
movq %rcx, 0xb0(%rsp)
leaq 0x20(%rcx), %rsi
movq 0x120(%rsp), %rdi
callq 0xe946
movq %rax, 0xb8(%rsp)
cmpq %r13, %rax
je 0xb262
testb $0x1, %bl
jne 0xb262
movq 0xb0(%rsp), %rax
leaq 0x30(%rax), %rbp
movq 0x30(%rax), %r13
cmpq %rbp, %r13
je 0xb262
addq $0x28, 0xb8(%rsp)
movzwl 0x4(%r15), %eax
movw %ax, 0x34(%rsp)
movl (%r15), %ecx
movl %ecx, 0x30(%rsp)
xorl 0x10(%r13), %ecx
xorw 0x14(%r13), %ax
movzwl %ax, %eax
orl %ecx, %eax
jne 0xb250
leaq 0xc0(%rsp), %rdi
movq 0x130(%rsp), %rsi
callq 0xc9c0
movq 0x20(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0xb06b
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq 0x128(%rsp), %rsi
callq 0xc688
jmp 0xb0d2
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %r12, 0x38(%rsp)
movb %r12b, 0x40(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
movq %r12, 0x58(%rsp)
movb %r12b, 0x60(%rsp)
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq %r12, 0x78(%rsp)
movb %r12b, 0x80(%rsp)
leaq 0xa0(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %r12, 0x98(%rsp)
movb %r12b, 0xa0(%rsp)
leaq 0x30(%rsp), %rbx
leaq 0x10(%r13), %rdx
xorl %eax, %eax
movq 0x20(%rsp), %rcx
cmpq %rcx, 0x18(%rsp)
sete %al
movl 0x1c(%r13), %ecx
movl 0x20(%r13), %esi
cvtsi2sd %rcx, %xmm0
movsd 0xb31e(%rip), %xmm2     # 0x16418
mulsd %xmm2, %xmm0
movsd 0xb31a(%rip), %xmm3     # 0x16420
mulsd %xmm3, %xmm0
cvtsi2sd %rsi, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
xorpd %xmm2, %xmm2
movapd %xmm2, 0xf0(%rsp)
movapd %xmm2, 0x100(%rsp)
movapd %xmm2, 0xe0(%rsp)
leaq 0xe8(%rsp), %rcx
movq %rcx, 0xf8(%rsp)
movq %rcx, 0x100(%rsp)
movq $0x0, 0x108(%rsp)
leaq 0x16(%r13), %rdi
movq 0xb8(%rsp), %rsi
movl $0x1, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
leaq 0xf(%rsp), %r10
pushq %r10
pushq %r12
pushq %rdi
pushq $0x1
leaq 0x100(%rsp), %r14
pushq %r14
pushq %r12
pushq %rax
pushq %rbx
pushq %r12
leaq 0x108(%rsp), %rax
pushq %rax
callq 0x8748
addq $0x50, %rsp
movq %r14, %rdi
callq 0x612a
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xb1cf
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xb1f1
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xb20d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xb229
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0xb24e
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4270
movb $0x1, %bl
testb $0x1, %bl
jne 0xb262
movq (%r13), %r13
cmpq %rbp, %r13
jne 0xb00e
movq 0xb0(%rsp), %rdi
callq 0x42d0
movq %rax, %rcx
testb $0x1, %bl
movq 0x118(%rsp), %r13
movq 0x110(%rsp), %rax
jne 0xb3f9
cmpq %rax, %rcx
jne 0xafb9
jmp 0xb3f9
leaq 0x60(%rsp), %rax
leaq 0x40(%rsp), %rcx
movq %rcx, -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 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rcx, -0x8(%rax)
movb %cl, (%rax)
movq 0x28(%rsp), %rdi
cmpq %rbp, %r14
je 0xb2fc
movzwl 0x2c(%r14), %eax
movw %ax, 0x14(%rsp)
movl 0x28(%r14), %eax
movl %eax, 0x10(%rsp)
jmp 0xb30b
movw $0x0, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
xorl %eax, %eax
cmpq %rbp, %r14
sete %al
xorl %r10d, %r10d
cmpq 0x20(%rsp), %r15
sete %r10b
subq $0x8, %rsp
leaq 0x17(%rsp), %r11
leaq 0x18(%rsp), %r14
leaq 0xc8(%rsp), %rdx
movq %r13, %rsi
movl $0x1, %ecx
movl $0x2, %r8d
xorl %r9d, %r9d
pushq %r11
pushq %rax
pushq %r14
pushq %r10
leaq 0x58(%rsp), %rax
pushq %rax
pushq $0x0
pushq %rbx
callq 0x81d6
addq $0x40, %rsp
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb380
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb3a1
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb3bc
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0xb3d8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4270
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb3f9
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x4270
cmpb $0x1, 0xf(%rsp)
jne 0xb413
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0xb413
movq (%rdi), %rax
callq *(%rax)
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xb437
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xc160
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb4b3
movq 0xf0(%rsp), %rsi
jmp 0xb4ab
movq %rax, %rbx
jmp 0xb4b3
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb4b3
movq 0x40(%rsp), %rsi
jmp 0xb4ab
movq %rax, %rbx
jmp 0xb48e
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x612a
leaq 0x30(%rsp), %rdi
callq 0xc160
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0xb4b3
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x4270
movq %rbx, %rdi
callq 0x43e0
nop