// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/icmp6.c
// Function: icmp6_send_response_with_addrs_and_netif
static void
icmp6_send_response_with_addrs_and_netif(struct pbuf *p, u8_t code, u32_t data, u8_t type,
    const ip6_addr_t *reply_src, const ip6_addr_t *reply_dest, struct netif *netif)
{
  struct pbuf *q;
  struct icmp6_hdr *icmp6hdr;

  /* ICMPv6 header + IPv6 header + data */
  q = pbuf_alloc(PBUF_IP, sizeof(struct icmp6_hdr) + IP6_HLEN + LWIP_ICMP6_DATASIZE,
                 PBUF_RAM);
  if (q == NULL) {
    LWIP_DEBUGF(ICMP_DEBUG, ("icmp_time_exceeded: failed to allocate pbuf for ICMPv6 packet.\n"));
    ICMP6_STATS_INC(icmp6.memerr);
    return;
  }
  LWIP_ASSERT("check that first pbuf can hold icmp 6message",
             (q->len >= (sizeof(struct icmp6_hdr) + IP6_HLEN + LWIP_ICMP6_DATASIZE)));

  icmp6hdr = (struct icmp6_hdr *)q->payload;
  icmp6hdr->type = type;
  icmp6hdr->code = code;
  icmp6hdr->data = lwip_htonl(data);

  /* copy fields from original packet */
  SMEMCPY((u8_t *)q->payload + sizeof(struct icmp6_hdr), (u8_t *)p->payload,
          IP6_HLEN + LWIP_ICMP6_DATASIZE);

  /* calculate checksum */
  icmp6hdr->chksum = 0;
#if CHECKSUM_GEN_ICMP6
  IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_ICMP6) {
    icmp6hdr->chksum = ip6_chksum_pseudo(q, IP6_NEXTH_ICMP6, q->tot_len,
      reply_src, reply_dest);
  }
#endif /* CHECKSUM_GEN_ICMP6 */

  ICMP6_STATS_INC(icmp6.xmit);
  ip6_output_if(q, reply_src, reply_dest, LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, netif);
  pbuf_free(q);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movb %sil, %cl
movq 0x10(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movl $0x36, %edi
movl $0x38, %esi
movl $0x280, %edx            # imm = 0x280
callq 0x6e20
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1c16e
jmp 0x1c167
jmp 0x1c169
jmp 0x1c265
jmp 0x1c170
movq -0x30(%rbp), %rax
movzwl 0x12(%rax), %eax
cmpq $0x38, %rax
jae 0x1c1af
jmp 0x1c180
leaq 0xb145(%rip), %rdi      # 0x272cc
leaq 0xd825(%rip), %rsi      # 0x299b3
movl $0x190, %edx            # imm = 0x190
leaq 0xd7f8(%rip), %rcx      # 0x29992
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0x1c1b1
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movb -0x11(%rbp), %cl
movq -0x38(%rbp), %rax
movb %cl, (%rax)
movb -0x9(%rbp), %cl
movq -0x38(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x10(%rbp), %edi
callq 0x251f0
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x30, %edx
callq 0x2180
movq -0x38(%rbp), %rax
movw $0x0, 0x2(%rax)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movw 0x10(%rax), %ax
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movl $0x3a, %esi
movzwl %ax, %edx
callq 0x25900
movw %ax, %cx
movq -0x38(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq 0x10(%rbp), %rax
movl $0xff, %ecx
xorl %r8d, %r8d
movl $0x3a, %r9d
movq %rax, (%rsp)
callq 0x1d560
movq -0x30(%rbp), %rdi
callq 0x7260
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)