// File: /workspace/github_cpp_makefile_star2_O3/dguglielmi[P]dlan-linux-software/common/dlanmonitor.cpp
// Function: CDlanMonitor::OnTurboChannelCapacitiesResponse(CMACAddress const&, HomePlugMMEs::TurboChannelCapacities::CResponse const&)
void CDlanMonitor::OnTurboChannelCapacitiesResponse(
  const CMACAddress& adapter, 
  const HomePlugMMEs::TurboChannelCapacities::CResponse& mme)
{
  std::map<CMACAddress,NetwAdapter>::iterator itNIC;
  std::map<CMACAddress,LocalDevice>::iterator itDevice; 
  
  if(((itNIC = m_mapNICs.find(adapter)) != m_mapNICs.end()) &&
    ((itDevice = itNIC->second.mapLocalDevices.find(mme.GetAddress())) != itNIC->second.mapLocalDevices.end()))
  {
    bool bUpdate = false;

    std::list<HomePlugMMEs::TurboChannelCapacities::TxCap> listCaps = mme.GetTxCapacities();
    for(std::list<HomePlugMMEs::TurboChannelCapacities::TxCap>::iterator itCap = listCaps.begin(); 
      (itCap != listCaps.end()); itCap++)
    {
      bool bUnknown =
        itNIC->second.setParamsAndStatsResponses.find(itCap->GetAddress()) != itNIC->second.setParamsAndStatsResponses.end();

      bool bTurbo =
        itNIC->second.setRemoteTurboResponses.find(itCap->GetAddress()) != itNIC->second.setRemoteTurboResponses.end();

      if(bUnknown || bTurbo)
      {
        UpdateRemoteDevice(itDevice->second, itCap->GetAddress(), true,
          bTurbo ? CDlanDevice::eTurbo : CDlanDevice::eHP1, !bTurbo, "", false, UserDataResponse(), true, 
          itCap->GetTxRate(), 0.0, false, 
          std::map<CMACAddress, CDlanDataRates>(), true, CMACAddress(), true, bUpdate);
      }
      else
      {
        itNIC->second.setDevicesToTrigger.insert(itCap->GetAddress());
      }
    }
    
    if(bUpdate)
      OnUpdate();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %rbx
movq %rdi, %r14
addq $0xa8, %rdi
callq 0xdc9e
movq %rax, %r13
leaq 0xb0(%r14), %rax
cmpq %rax, %r13
je 0xa67d
leaq 0x188(%r13), %rdi
movzwl 0xa(%rbx), %eax
leaq 0x48(%rsp), %rsi
movw %ax, 0x4(%rsi)
movl 0x6(%rbx), %eax
movl %eax, (%rsi)
callq 0xe6ee
leaq 0x190(%r13), %rcx
movq %rax, 0x20(%rsp)
cmpq %rcx, %rax
je 0xa67d
movq %r14, 0xc8(%rsp)
movb $0x0, 0xe(%rsp)
leaq 0x15(%rbx), %rsi
movzbl 0x10(%rbx), %eax
addq $-0x4, %rax
andq $-0x8, %rax
leaq (%rbx,%rax), %rdx
addq $0x15, %rdx
leaq 0xf8(%rsp), %r12
leaq 0x48(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rcx
callq 0xd3d2
movq (%r12), %r14
cmpq %r12, %r14
je 0xa65b
leaq 0x38(%r13), %rax
movq %rax, 0xf0(%rsp)
leaq 0x68(%r13), %rax
movq %rax, 0xe8(%rsp)
leaq 0x40(%r13), %rax
movq %rax, 0xe0(%rsp)
leaq 0x70(%r13), %rax
addq $0x98, %r13
addq $0x28, 0x20(%rsp)
movq %r13, 0xd0(%rsp)
movq %rax, 0xd8(%rsp)
movzwl 0x14(%r14), %eax
movw %ax, 0x4c(%rsp)
movl 0x10(%r14), %eax
movl %eax, 0x48(%rsp)
movq 0xf0(%rsp), %rdi
movq %rbx, %rsi
callq 0xf3a4
movq %rax, %r15
leaq 0x10(%r14), %rbp
movzwl 0x4(%rbp), %eax
movw %ax, 0x4c(%rsp)
movl (%rbp), %eax
movl %eax, 0x48(%rsp)
movq 0xe8(%rsp), %rdi
movq %rbx, %rsi
callq 0xf3a4
xorq 0xe0(%rsp), %r15
movq %rax, %rcx
movq 0xd8(%rsp), %rdx
xorq %rdx, %rcx
orq %r15, %rcx
je 0xa617
xorl %r12d, %r12d
xorl %r15d, %r15d
cmpq %rdx, %rax
sete 0xf(%rsp)
setne %bl
movzwl 0x4(%rbp), %eax
movw %ax, 0x1c(%rsp)
movl (%rbp), %eax
movl %eax, 0x18(%rsp)
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0xbe00(%rip), %rdx      # 0x16249
movq %rdx, %rsi
callq 0x642c
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
xorl %r13d, %r13d
movq %r13, 0x50(%rsp)
movb %r13b, 0x58(%rsp)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq %r13, 0x70(%rsp)
movb %r13b, 0x78(%rsp)
leaq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
movq %r13, 0x90(%rsp)
movb %r13b, 0x98(%rsp)
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq %r13, 0xb0(%rsp)
movb %r13b, 0xb8(%rsp)
movq %rbp, %rdi
callq 0xc396
movb %bl, %r15b
xorps %xmm1, %xmm1
movaps %xmm1, 0x110(%rsp)
movq %r13, 0x120(%rsp)
leaq 0x118(%rsp), %rax
movq %rax, 0x128(%rsp)
movq %rax, 0x130(%rsp)
movq %r13, 0x138(%rsp)
movl %r13d, 0x10(%rsp)
movw $0x0, 0x14(%rsp)
movb 0xf(%rsp), %al
movb %al, %r12b
xorps %xmm1, %xmm1
movq 0x20(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movl $0x1, %ecx
movl %r15d, %r8d
movl %r12d, %r9d
leaq 0xe(%rsp), %rax
pushq %rax
movl $0x1, %eax
pushq %rax
leaq 0x20(%rsp), %rdi
pushq %rdi
pushq %rax
leaq 0x130(%rsp), %r15
pushq %r15
pushq %r13
pushq %rax
leaq 0x80(%rsp), %rbx
pushq %rbx
pushq %r13
leaq 0x70(%rsp), %rax
pushq %rax
callq 0x85ba
addq $0x50, %rsp
movq %r15, %rdi
callq 0x60e0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
leaq 0xf8(%rsp), %r12
movq 0xd0(%rsp), %r13
je 0xa59c
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0xa5c1
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xa5dd
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xa5f9
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x4270
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xa632
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4270
jmp 0xa632
movzwl 0x4(%rbp), %eax
movw %ax, 0x4c(%rsp)
movl (%rbp), %eax
movl %eax, 0x48(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0xf2c0
movq (%r14), %r14
cmpq %r12, %r14
jne 0xa3aa
testb $0x1, 0xe(%rsp)
je 0xa65b
movq 0xc8(%rsp), %rax
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0xa65b
movq (%rdi), %rax
callq *(%rax)
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0xa67d
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x4270
movq %rbx, %rdi
cmpq %r12, %rbx
jne 0xa668
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa6d4
jmp 0xa6d4
movq %rax, %r14
jmp 0xa6aa
jmp 0xa6d4
movq %rax, %r14
leaq 0x110(%rsp), %rdi
callq 0x60e0
leaq 0x48(%rsp), %rdi
callq 0xbf00
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xa6d7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x4270
jmp 0xa6d7
jmp 0xa6d4
movq %rax, %r14
movq 0xf8(%rsp), %rdi
leaq 0xf8(%rsp), %r15
cmpq %r15, %rdi
je 0xa701
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x4270
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0xa6ec
movq %r14, %rdi
callq 0x43e0
nop