// File: /workspace/github_cpp_makefile_star2_O1/dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::OnThunderNetworkInfoConfirm(CMACAddress const&, HomePlugAvMMEs::ThunderNetworkInfo::CConfirm const&)
void CDlanMonitor::OnThunderNetworkInfoConfirm(
  const CMACAddress& adapter, 
  const HomePlugAvMMEs::ThunderNetworkInfo::CConfirm& mme)
{
  std::map<CMACAddress,NetwAdapter>::iterator itNIC;
  
  if((itNIC = m_mapNICs.find(adapter)) != m_mapNICs.end())
  {

    NetworkInfoResponse nwinfo(mme.GetCCoAddress(), mme.GetStations());

    std::list<HomePlugAvMMEs::ThunderNetworkInfo::StationInfo>::const_iterator itStation = nwinfo.stations.begin();
    for( ; (itStation != nwinfo.stations.end()); itStation++)
    {
      if((itStation->GetTxCodedRate() == 255) || (itStation->GetRxCodedRate() == 255))
        break;
    }
    if(itStation == nwinfo.stations.end())
    {
      ThunderNetworkInfo(itNIC, mme.GetAddress(), nwinfo);
    }
    else if(!itNIC->second.bNetworkInfoV1Sent)
    {
      itNIC->second.bNetworkInfoV1Sent = true;
      itNIC->second.queuePendingPackets.push(
        new HomePlugAvMMEs::ThunderNetworkInfoV1::CRequest(CMACAddress::Broadcast(), itNIC->first));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r12
movq %rdi, %r15
addq $0xa8, %rdi
callq 0xdefe
movq %rax, %r14
leaq 0xb0(%r15), %rax
cmpq %rax, %r14
je 0xb659
movzwl 0x23(%r12), %eax
movw %ax, 0xc(%rsp)
movl 0x1f(%r12), %eax
movl %eax, 0x8(%rsp)
leaq 0x27(%r12), %rsi
movzbl 0x26(%r12), %eax
leaq (%rax,%rax,4), %rax
leaq (%rax,%rax,2), %rax
leaq 0x27(%r12,%rax), %rdx
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0xd962
movl 0x8(%rsp), %eax
leaq 0x30(%rsp), %rbx
movl %eax, -0x8(%rbx)
movzwl 0xc(%rsp), %eax
movw %ax, -0x4(%rbx)
leaq 0x10(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xda20
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xb578
movq (%rdi), %rbp
movl $0x28, %esi
callq 0x4270
movq %rbp, %rdi
cmpq %r13, %rbp
jne 0xb563
movq 0x30(%rsp), %rax
cmpq %rbx, %rax
je 0xb599
cmpl $0xff, 0x1c(%rax)
je 0xb599
cmpl $0xff, 0x20(%rax)
je 0xb599
movq (%rax), %rax
jmp 0xb57d
cmpq %rbx, %rax
je 0xb614
cmpb $0x0, 0x30(%r14)
jne 0xb63a
movb $0x1, 0x30(%r14)
movl $0x28, %edi
callq 0x4260
leaq 0x20(%r14), %rcx
addq $0x1b8, %r14            # imm = 0x1B8
movw $0xffff, 0xc(%rax)      # imm = 0xFFFF
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
leaq 0x12501(%rip), %rdx     # 0x1dad8
movq %rdx, (%rax)
movl (%rcx), %edx
movl %edx, 0xe(%rax)
movzwl 0x4(%rcx), %ecx
movw %cx, 0x12(%rax)
movw $0xe188, 0x14(%rax)     # imm = 0xE188
movb $0x1, 0x16(%rax)
movl $0xa038, 0x17(%rax)     # imm = 0xA038
movw $0xb000, 0x1b(%rax)     # imm = 0xB000
movb $0x52, 0x1d(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %r14, %rdi
callq 0xe4a0
jmp 0xb63a
movzwl 0xa(%r12), %eax
leaq 0x10(%rsp), %rdx
movw %ax, 0x4(%rdx)
movl 0x6(%r12), %eax
movl %eax, (%rdx)
leaq 0x28(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0xb6c0
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb659
movq (%rdi), %r14
movl $0x28, %esi
callq 0x4270
movq %r14, %rdi
cmpq %rbx, %r14
jne 0xb644
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb66c
jmp 0xb66c
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0xb6b7
movq (%rdi), %r15
movl $0x28, %esi
callq 0x4270
movq %r15, %rdi
cmpq %rbx, %r15
jne 0xb679
jmp 0xb6b7
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xb6b7
movq (%rdi), %rbx
movl $0x28, %esi
callq 0x4270
movq %rbx, %rdi
cmpq %r13, %rbx
jne 0xb69d
jmp 0xb6b7
movq %rax, %r14
movq %r14, %rdi
callq 0x43e0
nop