LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_rexmit
err_t
tcp_rexmit(struct tcp_pcb *pcb)
{
  struct tcp_seg *seg;
  struct tcp_seg **cur_seg;

  LWIP_ASSERT("tcp_rexmit: invalid pcb", pcb != NULL);

  if (pcb->unacked == NULL) {
    return ERR_VAL;
  }

  seg = pcb->unacked;

  /* Give up if the segment is still referenced by the netif driver
     due to deferred transmission. */
  if (tcp_output_segment_busy(seg)) {
    LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit busy\n"));
    return ERR_VAL;
  }

  /* Move the first unacked segment to the unsent queue */
  /* Keep the unsent queue sorted. */
  pcb->unacked = seg->next;

  cur_seg = &(pcb->unsent);
  while (*cur_seg &&
         TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) {
    cur_seg = &((*cur_seg)->next );
  }
  seg->next = *cur_seg;
  *cur_seg = seg;
#if TCP_OVERSIZE
  if (seg->next == NULL) {
    /* the retransmitted segment is last in unsent, so reset unsent_oversize */
    pcb->unsent_oversize = 0;
  }
#endif /* TCP_OVERSIZE */

  if (pcb->nrtx < 0xFF) {
    ++pcb->nrtx;
  }

  /* Don't take any rtt measurements after retransmitting. */
  pcb->rttest = 0;

  /* Do the actual retransmission. */
  MIB2_STATS_INC(mib2.tcpretranssegs);
  /* No need to call tcp_output: we are always called from tcp_input()
     and thus tcp_output directly returns. */
  return ERR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xc68d
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
movb $-0x6, %al
testq %r14, %r14
je 0xc684
movq 0x8(%r14), %rcx
cmpb $0x1, 0x16(%rcx)
jne 0xc684
movq (%r14), %rax
movq %rax, 0xb0(%rbx)
leaq 0xa8(%rbx), %r15
movq 0xa8(%rbx), %rax
xorl %r12d, %r12d
testq %rax, %rax
je 0xc65a
movq 0x18(%rax), %rax
movl 0x4(%rax), %edi
callq 0x135bb
movl %eax, %ebp
movq 0x18(%r14), %rax
movl 0x4(%rax), %edi
callq 0x135bb
cmpl %eax, %ebp
movq (%r15), %rcx
jns 0xc657
movq (%rcx), %rax
movq %rcx, %r15
testq %rax, %rax
jne 0xc626
movq %rcx, %r15
jmp 0xc65a
movq %rcx, %r12
movq %r12, (%r14)
movq %r14, (%r15)
cmpq $0x0, (%r14)
jne 0xc66f
movw $0x0, 0xa0(%rbx)
movb 0x7a(%rbx), %al
cmpb $-0x1, %al
je 0xc67b
incb %al
movb %al, 0x7a(%rbx)
movl $0x0, 0x6c(%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7c38(%rip), %rdi      # 0x142cc
leaq 0x9576(%rip), %rsi      # 0x15c11
leaq 0x90dd(%rip), %rcx      # 0x1577f
movl $0x6c1, %edx            # imm = 0x6C1
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_rexmit_fast
void
tcp_rexmit_fast(struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_rexmit_fast: invalid pcb", pcb != NULL);

  if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) {
    /* This is fast retransmit. Retransmit the first unacked segment. */
    LWIP_DEBUGF(TCP_FR_DEBUG,
                ("tcp_receive: dupacks %"U16_F" (%"U32_F
                 "), fast retransmit %"U32_F"\n",
                 (u16_t)pcb->dupacks, pcb->lastack,
                 lwip_ntohl(pcb->unacked->tcphdr->seqno)));
    if (tcp_rexmit(pcb) == ERR_OK) {
      /* Set ssthresh to half of the minimum of the current
       * cwnd and the advertised window */
      pcb->ssthresh = LWIP_MIN(pcb->cwnd, pcb->snd_wnd) / 2;

      /* The minimum value for ssthresh should be 2 MSS */
      if (pcb->ssthresh < (2U * pcb->mss)) {
        LWIP_DEBUGF(TCP_FR_DEBUG,
                    ("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F
                     " should be min 2 mss %"U16_F"...\n",
                     pcb->ssthresh, (u16_t)(2 * pcb->mss)));
        pcb->ssthresh = 2 * pcb->mss;
      }

      pcb->cwnd = pcb->ssthresh + 3 * pcb->mss;
      tcp_set_flags(pcb, TF_INFR);

      /* Reset the retransmission timer to prevent immediate rto retransmissions */
      pcb->rtime = 0;
    }
  }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xc72a
movq %rdi, %rbx
cmpq $0x0, 0xb0(%rdi)
je 0xc728
testb $0x4, 0x52(%rbx)
jne 0xc728
movq %rbx, %rdi
callq 0xc5d6
testb %al, %al
jne 0xc728
movl 0x80(%rbx), %eax
movl 0x98(%rbx), %ecx
cmpw %cx, %ax
cmovbl %eax, %ecx
movzwl %cx, %eax
shrl %eax
movw %ax, 0x82(%rbx)
movzwl 0x6a(%rbx), %ecx
movl %ecx, %edx
addl %ecx, %edx
cmpl %eax, %edx
jbe 0xc712
movw %dx, 0x82(%rbx)
movl %edx, %eax
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
movw %ax, 0x80(%rbx)
orb $0x4, 0x52(%rbx)
movw $0x0, 0x68(%rbx)
popq %rbx
retq
leaq 0x7b9b(%rip), %rdi      # 0x142cc
leaq 0x94f1(%rip), %rsi      # 0x15c29
leaq 0x9040(%rip), %rcx      # 0x1577f
movl $0x6f9, %edx            # imm = 0x6F9
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_rst
void
tcp_rst(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno,
        const ip_addr_t *local_ip, const ip_addr_t *remote_ip,
        u16_t local_port, u16_t remote_port)
{
  struct pbuf *p;
  u16_t wnd;
  u8_t optlen;

  LWIP_ASSERT("tcp_rst: invalid local_ip", local_ip != NULL);
  LWIP_ASSERT("tcp_rst: invalid remote_ip", remote_ip != NULL);

  optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb);

#if LWIP_WND_SCALE
  wnd = PP_HTONS(((TCP_WND >> TCP_RCV_SCALE) & 0xFFFF));
#else
  wnd = PP_HTONS(TCP_WND);
#endif

  p = tcp_output_alloc_header_common(ackno, optlen, 0, lwip_htonl(seqno), local_port,
    remote_port, TCP_RST | TCP_ACK, wnd);
  if (p == NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_rst: could not allocate memory for pbuf\n"));
    return;
  }
  tcp_output_fill_options(pcb, p, 0, optlen);

  MIB2_STATS_INC(mib2.tcpoutrsts);

  tcp_output_control_segment(pcb, p, local_ip, remote_ip);
  LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0xc7df
movq %r8, %rbx
testq %r8, %r8
je 0xc7fb
movl %r9d, %ebp
movq %rcx, %r14
movl %edx, %r12d
movq %rdi, %r15
movzwl 0x40(%rsp), %r13d
movl %esi, %edi
callq 0x135bb
movl $0x80, (%rsp)
movzwl %bp, %ecx
movzwl %r13w, %r8d
movl %r12d, %edi
xorl %esi, %esi
movl %eax, %edx
movl $0x14, %r9d
callq 0xc828
testq %rax, %rax
je 0xc7d0
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc8ff
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7ae6(%rip), %rdi      # 0x142cc
leaq 0x9459(%rip), %rsi      # 0x15c46
leaq 0x8f8b(%rip), %rcx      # 0x1577f
movl $0x7c4, %edx            # imm = 0x7C4
jmp 0xc815
leaq 0x7aca(%rip), %rdi      # 0x142cc
leaq 0x9457(%rip), %rsi      # 0x15c60
leaq 0x8f6f(%rip), %rcx      # 0x1577f
movl $0x7c5, %edx            # imm = 0x7C5
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_output_alloc_header_common
static struct pbuf *
tcp_output_alloc_header_common(u32_t ackno, u16_t optlen, u16_t datalen,
                        u32_t seqno_be /* already in network byte order */,
                        u16_t src_port, u16_t dst_port, u8_t flags, u16_t wnd)
{
  struct tcp_hdr *tcphdr;
  struct pbuf *p;

  p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
  if (p != NULL) {
    LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
                (p->len >= TCP_HLEN + optlen));
    tcphdr = (struct tcp_hdr *)p->payload;
    tcphdr->src = lwip_htons(src_port);
    tcphdr->dest = lwip_htons(dst_port);
    tcphdr->seqno = seqno_be;
    tcphdr->ackno = lwip_htonl(ackno);
    TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), flags);
    tcphdr->wnd = lwip_htons(wnd);
    tcphdr->chksum = 0;
    tcphdr->urgp = 0;
  }
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, %r15d
movl %edi, %r14d
addl $0x14, %esi
movzwl %si, %esi
movl $0x36, %edi
movl $0x280, %edx            # imm = 0x280
callq 0x4df7
movq %rax, %rbx
testq %rax, %rax
je 0xc8c0
movl %ebp, 0x4(%rsp)
cmpw $0x13, 0x12(%rbx)
jbe 0xc8d2
movq 0x8(%rbx), %rbp
movzwl %r13w, %edi
callq 0x135b4
movw %ax, (%rbp)
movzwl %r12w, %edi
callq 0x135b4
movw %ax, 0x2(%rbp)
movl %r15d, 0x4(%rbp)
movl %r14d, %edi
callq 0x135bb
movl %eax, 0x8(%rbp)
movzbl 0x4(%rsp), %edi
orl $0x5000, %edi           # imm = 0x5000
callq 0x135b4
movw %ax, 0xc(%rbp)
movzwl 0x40(%rsp), %edi
callq 0x135b4
movw %ax, 0xe(%rbp)
movl $0x0, 0x10(%rbp)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x79f3(%rip), %rdi      # 0x142cc
leaq 0x955e(%rip), %rsi      # 0x15e3e
leaq 0x8e98(%rip), %rcx      # 0x1577f
movl $0x724, %edx            # imm = 0x724
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_output_control_segment
static err_t
tcp_output_control_segment(const struct tcp_pcb *pcb, struct pbuf *p,
                           const ip_addr_t *src, const ip_addr_t *dst)
{
  err_t err;
  struct netif *netif;

  LWIP_ASSERT("tcp_output_control_segment: invalid pbuf", p != NULL);

  netif = tcp_route(pcb, src, dst);
  if (netif == NULL) {
    err = ERR_RTE;
  } else {
    u8_t ttl, tos;
#if CHECKSUM_GEN_TCP
    IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) {
      struct tcp_hdr *tcphdr = (struct tcp_hdr *)p->payload;
      tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len,
                                        src, dst);
    }
#endif
    if (pcb != NULL) {
      NETIF_SET_HINTS(netif, LWIP_CONST_CAST(struct netif_hint*, &(pcb->netif_hints)));
      ttl = pcb->ttl;
      tos = pcb->tos;
    } else {
      /* Send output with hardcoded TTL/HL since we have no access to the pcb */
      ttl = TCP_TTL;
      tos = 0;
    }
    TCP_STATS_INC(tcp.xmit);
    err = ip_output_if(p, src, dst, ttl, tos, IP_PROTO_TCP, netif);
    NETIF_RESET_HINTS(netif);
  }
  pbuf_free(p);
  return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r13
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xc3d5
testq %rax, %rax
je 0xc957
movq %rax, %r12
movq 0x8(%rbx), %rbp
movzwl 0x10(%rbx), %edx
movq %rbx, %rdi
movl $0x6, %esi
movq %r15, %rcx
movq %r14, %r8
callq 0x1394f
movw %ax, 0x10(%rbp)
testq %r13, %r13
je 0xc95c
movb 0x32(%r13), %al
movb 0x33(%r13), %cl
jmp 0xc960
movb $-0x4, %bpl
jmp 0xc9ae
movb $0x40, %cl
xorl %eax, %eax
testq %r14, %r14
je 0xc98d
cmpb $0x6, 0x14(%r14)
jne 0xc98d
movq %r12, (%rsp)
movzbl %cl, %ecx
movzbl %al, %r8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x6, %r9d
callq 0xff25
jmp 0xc9ac
movq %r12, (%rsp)
movzbl %cl, %ecx
movzbl %al, %r8d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl $0x6, %r9d
callq 0xe33b
movl %eax, %ebp
movq %rbx, %rdi
callq 0x4fdf
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_output_alloc_header
static struct pbuf *
tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
                        u32_t seqno_be /* already in network byte order */)
{
  struct pbuf *p;

  LWIP_ASSERT("tcp_output_alloc_header: invalid pcb", pcb != NULL);

  p = tcp_output_alloc_header_common(pcb->rcv_nxt, optlen, datalen,
    seqno_be, pcb->local_port, pcb->remote_port, TCP_ACK,
    TCPWND_MIN16(RCV_WND_SCALE(pcb, pcb->rcv_ann_wnd)));
  if (p != NULL) {
    /* If we're sending a packet, update the announced right window edge */
    pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
  }
  return p;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x5c(%rdi), %edi
movzwl 0x4e(%rbx), %ecx
movzwl 0x50(%rbx), %r8d
movzwl 0x62(%rbx), %eax
movl %eax, (%rsp)
movl $0x10, %r9d
callq 0xc828
testq %rax, %rax
je 0xc9fc
movzwl 0x62(%rbx), %ecx
addl 0x5c(%rbx), %ecx
movl %ecx, 0x64(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_keepalive
err_t
tcp_keepalive(struct tcp_pcb *pcb)
{
  err_t err;
  struct pbuf *p;
  u8_t optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb);

  LWIP_ASSERT("tcp_keepalive: invalid pcb", pcb != NULL);

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: sending KEEPALIVE probe to "));
  ip_addr_debug_print_val(TCP_DEBUG, pcb->remote_ip);
  LWIP_DEBUGF(TCP_DEBUG, ("\n"));

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: tcp_ticks %"U32_F"   pcb->tmr %"U32_F" pcb->keep_cnt_sent %"U16_F"\n",
                          tcp_ticks, pcb->tmr, (u16_t)pcb->keep_cnt_sent));

  p = tcp_output_alloc_header(pcb, optlen, 0, lwip_htonl(pcb->snd_nxt - 1));
  if (p == NULL) {
    LWIP_DEBUGF(TCP_DEBUG,
                ("tcp_keepalive: could not allocate memory for pbuf\n"));
    return ERR_MEM;
  }
  tcp_output_fill_options(pcb, p, 0, optlen);
  err = tcp_output_control_segment(pcb, p, &pcb->local_ip, &pcb->remote_ip);

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_keepalive: seqno %"U32_F" ackno %"U32_F" err %d.\n",
                          pcb->snd_nxt - 1, pcb->rcv_nxt, (int)err));
  return err;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xca40
movq %rdi, %rbx
movl 0x88(%rdi), %edi
decl %edi
callq 0x135bb
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0xc9c7
testq %rax, %rax
je 0xca3c
leaq 0x18(%rbx), %rcx
movq %rbx, %rdi
movq %rax, %rsi
movq %rbx, %rdx
popq %rbx
jmp 0xc8ff
movb $-0x1, %al
popq %rbx
retq
leaq 0x7885(%rip), %rdi      # 0x142cc
leaq 0x924d(%rip), %rsi      # 0x15c9b
leaq 0x8d2a(%rip), %rcx      # 0x1577f
movl $0x824, %edx            # imm = 0x824
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/timeouts.c
// Function: tcp_timer_needed
void
tcp_timer_needed(void)
{
  LWIP_ASSERT_CORE_LOCKED();

  /* timer is off but needed again? */
  if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
    /* enable and start timer */
    tcpip_tcp_timer_active = 1;
    sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  }
}

// Assembly:
cmpb $0x0, 0xfde1(%rip)      # 0x1c988
jne 0xcbe8
leaq 0xfd58(%rip), %rax      # 0x1c908
leaq 0xfd59(%rip), %rcx      # 0x1c910
movq (%rcx), %rcx
orq (%rax), %rcx
je 0xcbe8
pushq %rax
movb $0x1, 0xfdc1(%rip)      # 0x1c988
callq 0x13578
leal 0xfa(%rax), %edi
leaq 0x78(%rip), %rsi        # 0xcc51
leaq 0x92b7(%rip), %rcx      # 0x15e97
xorl %edx, %edx
popq %rax
jmp 0xcd11
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/timeouts.c
// Function: tcpip_tcp_timer
static void
tcpip_tcp_timer(void *arg)
{
  LWIP_UNUSED_ARG(arg);

  /* call TCP timer handler */
  tcp_tmr();
  /* timer still needed? */
  if (tcp_active_pcbs || tcp_tw_pcbs) {
    /* restart timer */
    sys_timeout(TCP_TMR_INTERVAL, tcpip_tcp_timer, NULL);
  } else {
    /* disable timer */
    tcpip_tcp_timer_active = 0;
  }
}

// Assembly:
pushq %rax
callq 0x67c1
leaq 0xfcaa(%rip), %rax      # 0x1c908
leaq 0xfcab(%rip), %rcx      # 0x1c910
movq (%rcx), %rcx
orq (%rax), %rcx
je 0xcc8e
callq 0x13578
leal 0xfa(%rax), %edi
leaq -0x2e(%rip), %rsi       # 0xcc51
leaq 0x9211(%rip), %rcx      # 0x15e97
xorl %edx, %edx
popq %rax
jmp 0xcd11
movb $0x0, 0xfcf3(%rip)      # 0x1c988
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/udp.c
// Function: udp_send
err_t
udp_send(struct udp_pcb *pcb, struct pbuf *p)
{
  LWIP_ERROR("udp_send: invalid pcb", pcb != NULL, return ERR_ARG);
  LWIP_ERROR("udp_send: invalid pbuf", p != NULL, return ERR_ARG);

  if (IP_IS_ANY_TYPE_VAL(pcb->remote_ip)) {
    return ERR_VAL;
  }

#if TUN2SOCKS
  /* tun2socks should never use udp_send(), use udp_sendto() directly instead */
  return ERR_OK;
#else
  /* send to the packet using remote ip and port stored in the pcb */
  return udp_sendto(pcb, p, &pcb->remote_ip, pcb->remote_port);
#endif /* TUN2SOCKS */
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0xd101
testq %rsi, %rsi
je 0xd11d
xorl %ecx, %ecx
cmpb $0x2e, 0x2c(%rdi)
movl $0xfa, %eax
cmovnel %ecx, %eax
popq %rcx
retq
leaq 0x71c4(%rip), %rdi      # 0x142cc
leaq 0x8ea7(%rip), %rsi      # 0x15fb6
leaq 0x8e52(%rip), %rcx      # 0x15f68
movl $0x1e6, %edx            # imm = 0x1E6
jmp 0xd137
leaq 0x71a8(%rip), %rdi      # 0x142cc
leaq 0x8ea1(%rip), %rsi      # 0x15fcc
leaq 0x8e36(%rip), %rcx      # 0x15f68
movl $0x1e7, %edx            # imm = 0x1E7
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/udp.c
// Function: udp_send_chksum
err_t
udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p,
                u8_t have_chksum, u16_t chksum)
{
  LWIP_ERROR("udp_send_chksum: invalid pcb", pcb != NULL, return ERR_ARG);
  LWIP_ERROR("udp_send_chksum: invalid pbuf", p != NULL, return ERR_ARG);

  if (IP_IS_ANY_TYPE_VAL(pcb->remote_ip)) {
    return ERR_VAL;
  }

#if TUN2SOCKS
  /* tun2socks should never use udp_send(), use udp_sendto_chksum() directly instead */
  return ERR_OK;
#else
  /* send to the packet using remote ip and port stored in the pcb */
  return udp_sendto_chksum(pcb, p, &pcb->remote_ip, pcb->remote_port,
                           have_chksum, chksum);
#endif /* TUN2SOCKS */
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0xd165
testq %rsi, %rsi
je 0xd181
xorl %ecx, %ecx
cmpb $0x2e, 0x2c(%rdi)
movl $0xfa, %eax
cmovnel %ecx, %eax
popq %rcx
retq
leaq 0x7160(%rip), %rdi      # 0x142cc
leaq 0x8e70(%rip), %rsi      # 0x15fe3
leaq 0x8dee(%rip), %rcx      # 0x15f68
movl $0x1fe, %edx            # imm = 0x1FE
jmp 0xd19b
leaq 0x7144(%rip), %rdi      # 0x142cc
leaq 0x8e71(%rip), %rsi      # 0x16000
leaq 0x8dd2(%rip), %rcx      # 0x15f68
movl $0x1ff, %edx            # imm = 0x1FF
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/udp.c
// Function: udp_recv
void
udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg)
{
  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ERROR("udp_recv: invalid pcb", pcb != NULL, return);

  /* remember recv() callback and user data */
  pcb->recv = recv;
  pcb->recv_arg = recv_arg;
}

// Assembly:
testq %rdi, %rdi
je 0xdbd1
movq %rsi, 0x48(%rdi)
movq %rdx, 0x50(%rdi)
retq
pushq %rax
leaq 0x66f3(%rip), %rdi      # 0x142cc
leaq 0x8635(%rip), %rsi      # 0x16215
leaq 0x8381(%rip), %rcx      # 0x15f68
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/udp.c
// Function: udp_remove
void
udp_remove(struct udp_pcb *pcb)
{
  struct udp_pcb *pcb2;

  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ERROR("udp_remove: invalid pcb", pcb != NULL, return);

  mib2_udp_unbind(pcb);
  /* pcb to be removed is first in list? */
  if (udp_pcbs == pcb) {
    /* make list start at 2nd pcb */
    udp_pcbs = udp_pcbs->next;
    /* pcb not 1st in list */
  } else {
    for (pcb2 = udp_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
      /* find pcb in udp_pcbs list */
      if (pcb2->next != NULL && pcb2->next == pcb) {
        /* remove pcb from list */
        pcb2->next = pcb->next;
        break;
      }
    }
  }
  memp_free(MEMP_UDP_PCB, pcb);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0xdc47
movq %rdi, %rsi
movq 0xed91(%rip), %rcx      # 0x1c9a0
cmpq %rdi, %rcx
je 0xdc2e
testq %rcx, %rcx
je 0xdc3c
movq %rcx, %rax
movq 0x38(%rcx), %rcx
cmpq %rsi, %rcx
jne 0xdc14
addq $0x38, %rax
movq %rsi, %rcx
jmp 0xdc35
leaq 0xed6b(%rip), %rax      # 0x1c9a0
movq 0x38(%rcx), %rcx
movq %rcx, (%rax)
movl $0x1, %edi
popq %rax
jmp 0x3cf8
leaq 0x667e(%rip), %rdi      # 0x142cc
leaq 0x85d6(%rip), %rsi      # 0x1622b
leaq 0x830c(%rip), %rcx      # 0x15f68
movl $0x50f, %edx            # imm = 0x50F
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/udp.c
// Function: udp_new_ip_type
struct udp_pcb *
udp_new_ip_type(u8_t type)
{
  struct udp_pcb *pcb;

  LWIP_ASSERT_CORE_LOCKED();

  pcb = udp_new();
#if LWIP_IPV4 && LWIP_IPV6
  if (pcb != NULL) {
    IP_SET_TYPE_VAL(pcb->local_ip,  type);
    IP_SET_TYPE_VAL(pcb->remote_ip, type);
  }
#else
  LWIP_UNUSED_ARG(type);
#endif /* LWIP_IPV4 && LWIP_IPV6 */
  return pcb;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x1, %edi
callq 0x3c6e
testq %rax, %rax
je 0xdce2
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x50(%rax)
movb $0x40, 0x33(%rax)
movb %bl, 0x14(%rax)
movb %bl, 0x2c(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/udp.c
// Function: udp_netif_ip_addr_changed
void udp_netif_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr)
{
  struct udp_pcb *upcb;

  if (!ip_addr_isany(old_addr) && !ip_addr_isany(new_addr)) {
    for (upcb = udp_pcbs; upcb != NULL; upcb = upcb->next) {
      /* PCB bound to current local interface address? */
      if (ip_addr_cmp(&upcb->local_ip, old_addr)) {
        /* The PCB is bound to the old ipaddr and
         * is set to bound to the new one instead */
        ip_addr_copy(upcb->local_ip, *new_addr);
      }
    }
  }
}

// Assembly:
testq %rdi, %rdi
je 0xddda
cmpb $0x6, 0x14(%rdi)
movl (%rdi), %eax
jne 0xdd13
testl %eax, %eax
jne 0xdd09
cmpl $0x0, 0x4(%rdi)
jne 0xdd09
cmpl $0x0, 0x8(%rdi)
je 0xdddb
testq %rsi, %rsi
jne 0xdd26
jmp 0xddda
testl %eax, %eax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xddda
cmpb $0x6, 0x14(%rsi)
movl (%rsi), %eax
jne 0xdd49
testl %eax, %eax
jne 0xdd51
cmpl $0x0, 0x4(%rsi)
jne 0xdd51
cmpl $0x0, 0x8(%rsi)
jne 0xdd51
cmpl $0x0, 0xc(%rsi)
jne 0xdd51
jmp 0xddda
testl %eax, %eax
je 0xddda
movq 0xec48(%rip), %rax      # 0x1c9a0
testq %rax, %rax
je 0xddda
xorl %ecx, %ecx
movb 0x14(%rax), %dl
cmpb 0x14(%rdi), %dl
jne 0xddd1
movl (%rax), %r8d
movl (%rdi), %r9d
cmpb $0x6, %dl
jne 0xdd99
cmpl %r9d, %r8d
jne 0xddd1
movl 0x4(%rax), %edx
cmpl 0x4(%rdi), %edx
jne 0xddd1
movl 0x8(%rax), %edx
cmpl 0x8(%rdi), %edx
jne 0xddd1
movl 0xc(%rax), %edx
cmpl 0xc(%rdi), %edx
jne 0xddd1
movb 0x10(%rax), %dl
cmpb 0x10(%rdi), %dl
je 0xdd9e
jmp 0xddd1
cmpl %r9d, %r8d
jne 0xddd1
movb 0x14(%rsi), %dl
movb %dl, 0x14(%rax)
movl (%rsi), %r8d
movl %r8d, (%rax)
cmpb $0x6, %dl
jne 0xddc9
movl 0x4(%rsi), %edx
movl %edx, 0x4(%rax)
movl 0x8(%rsi), %edx
movl %edx, 0x8(%rax)
movl 0xc(%rsi), %edx
movl %edx, 0xc(%rax)
movb 0x10(%rsi), %dl
movb %dl, 0x10(%rax)
jmp 0xddd1
movq %rcx, 0x9(%rax)
movq %rcx, 0x4(%rax)
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0xdd5f
retq
testq %rsi, %rsi
je 0xddda
cmpl $0x0, 0xc(%rdi)
jne 0xdd26
jmp 0xddda
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4.c
// Function: ip4_output
err_t
ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
           u8_t ttl, u8_t tos, u8_t proto)
{
  struct netif *netif;

  LWIP_IP_CHECK_PBUF_REF_COUNT_FOR_TX(p);

  if ((netif = ip4_route_src(src, dest)) == NULL) {
    LWIP_DEBUGF(IP_DEBUG, ("ip4_output: No route to %"U16_F".%"U16_F".%"U16_F".%"U16_F"\n",
                           ip4_addr1_16(dest), ip4_addr2_16(dest), ip4_addr3_16(dest), ip4_addr4_16(dest)));
    IP_STATS_INC(ip.rterr);
    return ERR_RTE;
  }

  return ip4_output_if(p, src, dest, ttl, tos, proto, netif);
}

// Assembly:
pushq %rax
cmpb $0x1, 0x16(%rdi)
jne 0xe5b8
leaq 0xe355(%rip), %rax      # 0x1c8d8
movq (%rax), %rax
testq %rax, %rax
je 0xe5b4
testq %rdx, %rdx
je 0xe59e
testq %rsi, %rsi
je 0xe59a
cmpl $0x0, (%rsi)
jne 0xe59e
leaq 0x8(%rax), %rsi
movq %rax, (%rsp)
movzbl %cl, %ecx
movzbl %r8b, %r8d
movzbl %r9b, %r9d
callq 0xe366
jmp 0xe5b6
movb $-0x4, %al
popq %rcx
retq
leaq 0x5d0d(%rip), %rdi      # 0x142cc
leaq 0x7d30(%rip), %rsi      # 0x162f6
leaq 0x7d35(%rip), %rcx      # 0x16302
movl $0x416, %edx            # imm = 0x416
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4_addr.c
// Function: ip4_addr_netmask_valid
u8_t
ip4_addr_netmask_valid(u32_t netmask)
{
  u32_t mask;
  u32_t nm_hostorder = lwip_htonl(netmask);

  /* first, check for the first zero */
  for (mask = 1UL << 31 ; mask != 0; mask >>= 1) {
    if ((nm_hostorder & mask) == 0) {
      break;
    }
  }
  /* then check that there is no one */
  for (; mask != 0; mask >>= 1) {
    if ((nm_hostorder & mask) != 0) {
      /* there is a one after the first zero -> invalid */
      return 0;
    }
  }
  /* no one after the first zero -> valid */
  return 1;
}

// Assembly:
pushq %rax
callq 0x135bb
movl $0x80000000, %ecx       # imm = 0x80000000
movl %ecx, %edx
testl %ecx, %ecx
je 0xe633
movl %edx, %esi
andl %eax, %esi
movl %edx, %ecx
shrl %ecx
testl %esi, %esi
jne 0xe621
movb $0x1, %cl
testl %edx, %edx
je 0xe64c
testl %eax, %edx
jne 0xe64a
movl %edx, %esi
shrl %esi
cmpl $0x2, %edx
movl %esi, %edx
jae 0xe639
jmp 0xe64c
xorl %ecx, %ecx
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4_addr.c
// Function: ip4addr_ntoa_r
char *
ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen)
{
  u32_t s_addr;
  char inv[3];
  char *rp;
  u8_t *ap;
  u8_t rem;
  u8_t n;
  u8_t i;
  int len = 0;

  s_addr = ip4_addr_get_u32(addr);

  rp = buf;
  ap = (u8_t *)&s_addr;
  for (n = 0; n < 4; n++) {
    i = 0;
    do {
      rem = *ap % (u8_t)10;
      *ap /= (u8_t)10;
      inv[i++] = (char)('0' + rem);
    } while (*ap);
    while (i--) {
      if (len++ >= buflen) {
        return NULL;
      }
      *rp++ = inv[i];
    }
    if (len++ >= buflen) {
      return NULL;
    }
    *rp++ = '.';
    ap++;
  }
  *--rp = 0;
  return buf;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movl (%rdi), %ecx
movl %ecx, -0x8(%rsp)
xorl %ecx, %ecx
xorl %esi, %esi
movq %rax, %rdi
movb -0x8(%rsp,%rcx), %r10b
xorl %r8d, %r8d
movzbl %r10b, %r11d
imull $0xcd, %r11d, %r10d
shrl $0xb, %r10d
leal (%r10,%r10), %r9d
leal (%r9,%r9,4), %r9d
movl %r11d, %ebx
subb %r9b, %bl
orb $0x30, %bl
movzbl %r8b, %r9d
incb %r8b
movb %bl, -0x3(%rsp,%r9)
cmpb $0x9, %r11b
ja 0xe8a9
movb %r10b, -0x8(%rsp,%rcx)
testb %r8b, %r8b
je 0xe90b
cmpl %edx, %esi
movl %edx, %r10d
cmovgl %esi, %r10d
movq %rdi, %r8
cmpl %esi, %r10d
je 0xe933
incl %esi
movb -0x3(%rsp,%r9), %dil
movb %dil, (%r8)
incq %r8
addq $-0x1, %r9
jb 0xe8f1
jmp 0xe90e
movq %rdi, %r8
cmpl %edx, %esi
jge 0xe933
incl %esi
leaq 0x1(%r8), %rdi
movb $0x2e, (%r8)
leaq 0x1(%rcx), %r9
cmpq $0x3, %rcx
movq %r9, %rcx
jne 0xe8a1
movb $0x0, (%r8)
jmp 0xe935
xorl %eax, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4_frag.c
// Function: ip_reass_tmr
void
ip_reass_tmr(void)
{
  struct ip_reassdata *r, *prev = NULL;

  r = reassdatagrams;
  while (r != NULL) {
    /* Decrement the timer. Once it reaches 0,
     * clean up the incomplete fragment assembly */
    if (r->timer > 0) {
      r->timer--;
      LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer dec %"U16_F"\n", (u16_t)r->timer));
      prev = r;
      r = r->next;
    } else {
      /* reassembly timed out */
      struct ip_reassdata *tmp;
      LWIP_DEBUGF(IP_REASS_DEBUG, ("ip_reass_tmr: timer timed out\n"));
      tmp = r;
      /* get the next pointer before freeing */
      r = r->next;
      /* free the helper struct and all enqueued pbufs */
      ip_reass_free_complete_datagram(tmp, prev);
    }
  }
}

// Assembly:
movq 0xe081(%rip), %rdi      # 0x1c9c0
testq %rdi, %rdi
je 0xe978
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movb 0x27(%rdi), %al
testb %al, %al
je 0xe95e
decb %al
movb %al, 0x27(%rdi)
movq (%rdi), %r14
movq %rdi, %rbx
jmp 0xe969
movq (%rdi), %r14
movq %rbx, %rsi
callq 0xe979
movq %r14, %rdi
testq %r14, %r14
jne 0xe94a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4_frag.c
// Function: ip_reass_remove_oldest_datagram
static int
ip_reass_remove_oldest_datagram(struct ip_hdr *fraghdr, int pbufs_needed)
{
  /* @todo Can't we simply remove the last datagram in the
   *       linked list behind reassdatagrams?
   */
  struct ip_reassdata *r, *oldest, *prev, *oldest_prev;
  int pbufs_freed = 0, pbufs_freed_current;
  int other_datagrams;

  /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
   * but don't free the datagram that 'fraghdr' belongs to! */
  do {
    oldest = NULL;
    prev = NULL;
    oldest_prev = NULL;
    other_datagrams = 0;
    r = reassdatagrams;
    while (r != NULL) {
      if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
        /* Not the same datagram as fraghdr */
        other_datagrams++;
        if (oldest == NULL) {
          oldest = r;
          oldest_prev = prev;
        } else if (r->timer <= oldest->timer) {
          /* older than the previous oldest */
          oldest = r;
          oldest_prev = prev;
        }
      }
      if (r->next != NULL) {
        prev = r;
      }
      r = r->next;
    }
    if (oldest != NULL) {
      pbufs_freed_current = ip_reass_free_complete_datagram(oldest, oldest_prev);
      pbufs_freed += pbufs_freed_current;
    }
  } while ((pbufs_freed < pbufs_needed) && (other_datagrams > 1));
  return pbufs_freed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
xorl %ebx, %ebx
movq 0xda4f(%rip), %rax      # 0x1c9c0
testq %rax, %rax
je 0xefed
movl 0xc(%r14), %ecx
xorl %r15d, %r15d
xorl %esi, %esi
xorl %r8d, %r8d
xorl %edi, %edi
movq %rax, %rdx
cmpl %ecx, 0x1c(%rdx)
jne 0xefa2
movl 0x20(%rdx), %r9d
cmpl 0x10(%r14), %r9d
jne 0xefa2
movzwl 0x14(%rdx), %r9d
cmpw 0x4(%r14), %r9w
je 0xefc2
incl %r15d
testq %rdi, %rdi
je 0xefbc
movb 0x27(%rdx), %r9b
cmpb 0x27(%rdi), %r9b
cmovbeq %rdx, %rdi
cmovbeq %r8, %rsi
jmp 0xefc2
movq %rdx, %rdi
movq %r8, %rsi
movq %rdx, %r8
movq (%rdx), %r9
movq %r9, %rdx
testq %r9, %r9
jne 0xef87
testq %rdi, %rdi
je 0xefe3
callq 0xe979
addl %eax, %ebx
movq 0xd9dd(%rip), %rax      # 0x1c9c0
cmpl %ebp, %ebx
jge 0xefed
cmpl $0x1, %r15d
jg 0xef71
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4_frag.c
// Function: ip_reass_dequeue_datagram
static void
ip_reass_dequeue_datagram(struct ip_reassdata *ipr, struct ip_reassdata *prev)
{
  /* dequeue the reass struct  */
  if (reassdatagrams == ipr) {
    /* it was the first in the list */
    reassdatagrams = ipr->next;
  } else {
    /* it wasn't the first, so it must have a valid 'prev' */
    LWIP_ASSERT("sanity check linked list", prev != NULL);
    prev->next = ipr->next;
  }

  /* now we can free the ip_reassdata struct */
  memp_free(MEMP_REASSDATA, ipr);
}

// Assembly:
movq %rdi, %rax
cmpq %rdi, 0xd9bc(%rip)      # 0x1c9c0
je 0xf039
testq %rsi, %rsi
jne 0xf040
pushq %rax
leaq 0x52b9(%rip), %rdi      # 0x142cc
leaq 0x74b7(%rip), %rsi      # 0x164d1
leaq 0x73b8(%rip), %rcx      # 0x163d9
movl $0x145, %edx            # imm = 0x145
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xd980(%rip), %rsi      # 0x1c9c0
movq (%rax), %rcx
movq %rcx, (%rsi)
movl $0x5, %edi
movq %rax, %rsi
jmp 0x3cf8
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv4/ip4_frag.c
// Function: ipfrag_free_pbuf_custom
static void
ipfrag_free_pbuf_custom(struct pbuf *p)
{
  struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref *)p;
  LWIP_ASSERT("pcr != NULL", pcr != NULL);
  LWIP_ASSERT("pcr == p", (void *)pcr == (void *)p);
  if (pcr->original != NULL) {
    pbuf_free(pcr->original);
  }
  ip_frag_free_pbuf_custom_ref(pcr);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xf35d
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0xf34f
callq 0x4fdf
movl $0x6, %edi
movq %rbx, %rsi
popq %rbx
jmp 0x3cf8
leaq 0x4f68(%rip), %rdi      # 0x142cc
leaq 0x717f(%rip), %rsi      # 0x164ea
leaq 0x7067(%rip), %rcx      # 0x163d9
movl $0x2ce, %edx            # imm = 0x2CE
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
nop
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/icmp6.c
// Function: icmp6_send_response
static void
icmp6_send_response(struct pbuf *p, u8_t code, u32_t data, u8_t type)
{
  const struct ip6_addr *reply_src, *reply_dest;
  struct netif *netif = ip_current_netif();

  LWIP_ASSERT("icmpv6 packet not a direct response", netif != NULL);
  reply_dest = ip6_current_src_addr();

  /* Select an address to use as source. */
  reply_src = ip_2_ip6(ip6_select_source_address(netif, reply_dest));
  if (reply_src == NULL) {
    ICMP6_STATS_INC(icmp6.rterr);
    return;
  }
  icmp6_send_response_with_addrs_and_netif(p, code, data, type, reply_src, reply_dest, netif);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xd2b2(%rip), %r14      # 0x1c770
movq (%r14), %r13
testq %r13, %r13
je 0xf50f
movl %ecx, %ebp
movl %edx, %ebx
movl %esi, %r12d
movq %rdi, %r15
addq $0x24, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0xf74f
testq %rax, %rax
je 0xf500
movq %r13, (%rsp)
movzbl %r12b, %esi
movzbl %bpl, %ecx
movq %r15, %rdi
movl %ebx, %edx
movq %rax, %r8
movq %r14, %r9
callq 0xf60f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4db6(%rip), %rdi      # 0x142cc
leaq 0x6fd9(%rip), %rsi      # 0x164f6
leaq 0x6ff6(%rip), %rcx      # 0x1651a
movl $0x13a, %edx            # imm = 0x13A
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/icmp6.c
// Function: icmp6_time_exceeded_with_addrs
static void
icmp6_send_response_with_addrs(struct pbuf *p, u8_t code, u32_t data, u8_t type,
    const ip6_addr_t *src_addr, const ip6_addr_t *dest_addr)
{
  const struct ip6_addr *reply_src, *reply_dest;
  struct netif *netif;

  /* Get the destination address and netif for this ICMP message. */
  LWIP_ASSERT("must provide both source and destination", src_addr != NULL);
  LWIP_ASSERT("must provide both source and destination", dest_addr != NULL);

  /* Special case, as ip6_current_xxx is either NULL, or points
     to a different packet than the one that expired. */
  IP6_ADDR_ZONECHECK(src_addr);
  IP6_ADDR_ZONECHECK(dest_addr);
  /* Swap source and destination for the reply. */
  reply_dest = src_addr;
  reply_src = dest_addr;
  netif = ip6_route(reply_src, reply_dest);
  if (netif == NULL) {
    ICMP6_STATS_INC(icmp6.rterr);
    return;
  }
  icmp6_send_response_with_addrs_and_netif(p, code, data, type, reply_src,
    reply_dest, netif);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0xf5ae
movq %rcx, %r14
testq %rcx, %rcx
je 0xf5ca
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movq %r14, %rdi
movq %rdx, %rsi
callq 0xf744
testq %rax, %rax
je 0xf5a3
movq %rax, (%rsp)
movzbl %bpl, %esi
movq %r15, %rdi
xorl %edx, %edx
movl $0x3, %ecx
movq %r14, %r8
movq %rbx, %r9
callq 0xf60f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4d17(%rip), %rdi      # 0x142cc
leaq 0x6fac(%rip), %rsi      # 0x16568
leaq 0x6f57(%rip), %rcx      # 0x1651a
movl $0x161, %edx            # imm = 0x161
jmp 0xf5e4
leaq 0x4cfb(%rip), %rdi      # 0x142cc
leaq 0x6f90(%rip), %rsi      # 0x16568
leaq 0x6f3b(%rip), %rcx      # 0x1651a
movl $0x162, %edx            # imm = 0x162
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %r8, 0x20(%rsp)
movl %ecx, %r13d
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r12
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
movl $0x36, %edi
movl $0x38, %esi
movl $0x280, %edx            # imm = 0x280
callq 0x4df7
testq %rax, %rax
je 0xf708
movq %rax, %r15
movq %r14, 0x10(%rsp)
cmpw $0x37, 0x12(%rax)
jbe 0xf717
movq 0x8(%r15), %r14
movb %r13b, (%r14)
movb %bl, 0x1(%r14)
movl %ebp, %edi
callq 0x135bb
movl %eax, 0x4(%r14)
movq 0x8(%r15), %rax
movq 0x8(%r12), %rcx
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x28(%rax)
movups %xmm1, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movw $0x0, 0x2(%r14)
movzwl 0x10(%r15), %edx
movq %r15, %rdi
movl $0x3a, %esi
movq 0x20(%rsp), %r12
movq %r12, %rcx
movq 0x10(%rsp), %rbx
movq %rbx, %r8
callq 0x138e7
movw %ax, 0x2(%r14)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movl $0xff, %ecx
xorl %r8d, %r8d
movl $0x3a, %r9d
callq 0xff25
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4fdf
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4bae(%rip), %rdi      # 0x142cc
leaq 0x6e16(%rip), %rsi      # 0x1653b
leaq 0x6dee(%rip), %rcx      # 0x1651a
movl $0x190, %edx            # imm = 0x190
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/ip6.c
// Function: ip6_output_if
err_t
ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest,
             u8_t hl, u8_t tc,
             u8_t nexth, struct netif *netif)
{
  const ip6_addr_t *src_used = src;
  if (dest != LWIP_IP_HDRINCL) {
    if (src != NULL && ip6_addr_isany(src)) {
      src_used = ip_2_ip6(ip6_select_source_address(netif, dest));
      if ((src_used == NULL) || ip6_addr_isany(src_used)) {
        /* No appropriate source address was found for this packet. */
        LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_output: No suitable source address for packet.\n"));
        IP6_STATS_INC(ip6.rterr);
        return ERR_RTE;
      }
    }
  }
  return ip6_output_if_src(p, src_used, dest, hl, tc, nexth, netif);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r9d, %ebp
movl %r8d, %r14d
movl %ecx, %r12d
movq %rdx, %rbx
movq %rdi, %r15
testq %rdx, %rdx
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xff63
cmpl $0x0, (%rsi)
jne 0xff63
cmpl $0x0, 0x4(%rsi)
jne 0xff63
cmpl $0x0, 0x8(%rsi)
jne 0xff63
cmpl $0x0, 0xc(%rsi)
je 0xff82
movzbl %r12b, %ecx
movzbl %r14b, %r8d
movzbl %bpl, %r9d
movq %r15, %rdi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xffb9
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0xf74f
testq %rax, %rax
je 0xffae
movq %rax, %rsi
cmpl $0x0, (%rax)
jne 0xff63
cmpl $0x0, 0x4(%rsi)
jne 0xff63
cmpl $0x0, 0x8(%rsi)
jne 0xff63
cmpl $0x0, 0xc(%rsi)
jne 0xff63
movb $-0x4, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/ip6_frag.c
// Function: ip6_reass_remove_oldest_datagram
static void
ip6_reass_remove_oldest_datagram(struct ip6_reassdata *ipr, int pbufs_needed)
{
  struct ip6_reassdata *r, *oldest;

  /* Free datagrams until being allowed to enqueue 'pbufs_needed' pbufs,
   * but don't free the current datagram! */
  do {
    r = oldest = reassdatagrams;
    while (r != NULL) {
      if (r != ipr) {
        if (r->timer <= oldest->timer) {
          /* older than the previous oldest */
          oldest = r;
        }
      }
      r = r->next;
    }
    if (oldest == ipr) {
      /* nothing to free, ipr is the only element on the list */
      return;
    }
    if (oldest != NULL) {
      ip6_reass_free_complete_datagram(oldest);
    }
  } while (((ip6_reass_pbufcount + pbufs_needed) > IP_REASS_MAX_PBUFS) && (reassdatagrams != NULL));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0xba63(%rip), %rax      # 0x1c9f8
testq %rax, %rax
je 0x10fe0
movq %rax, %rdi
movq %rax, %rcx
cmpq %r14, %rcx
je 0x10faf
movb 0x4f(%rcx), %dl
cmpb 0x4f(%rdi), %dl
cmovbeq %rcx, %rdi
movq (%rcx), %rcx
testq %rcx, %rcx
jne 0x10fa0
cmpq %r14, %rdi
je 0x10fe0
testq %rdi, %rdi
je 0x10fcd
callq 0x107b4
movq 0xba2b(%rip), %rax      # 0x1c9f8
movzwl 0xba2c(%rip), %ecx      # 0x1ca00
addl %ebx, %ecx
cmpl $0xb, %ecx
jl 0x10fe0
testq %rax, %rax
jne 0x10f95
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/ip6_frag.c
// Function: ip6_frag_free_pbuf_custom
static void
ip6_frag_free_pbuf_custom(struct pbuf *p)
{
  struct pbuf_custom_ref *pcr = (struct pbuf_custom_ref*)p;
  LWIP_ASSERT("pcr != NULL", pcr != NULL);
  LWIP_ASSERT("pcr == p", (void*)pcr == (void*)p);
  if (pcr->original != NULL) {
    pbuf_free(pcr->original);
  }
  ip6_frag_free_pbuf_custom_ref(pcr);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x112a4
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x11296
callq 0x4fdf
movl $0x6, %edi
movq %rbx, %rsi
popq %rbx
jmp 0x3cf8
leaq 0x3021(%rip), %rdi      # 0x142cc
leaq 0x5238(%rip), %rsi      # 0x164ea
leaq 0x536f(%rip), %rcx      # 0x16628
movl $0x2ba, %edx            # imm = 0x2BA
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_duplicate_addr_detected
static void
nd6_duplicate_addr_detected(struct netif *netif, s8_t addr_idx)
{

  /* Mark the address as duplicate, but leave its lifetimes alone. If this was
   * a manually assigned address, it will remain in existence as duplicate, and
   * as such be unusable for any practical purposes until manual intervention.
   * If this was an autogenerated address, the address will follow normal
   * expiration rules, and thus disappear once its valid lifetime expires. */
  netif_ip6_addr_set_state(netif, addr_idx, IP6_ADDR_DUPLICATED);

#if LWIP_IPV6_AUTOCONFIG
  /* If the affected address was the link-local address that we use to generate
   * all other addresses, then we should not continue to use those derived
   * addresses either, so mark them as duplicate as well. For autoconfig-only
   * setups, this will make the interface effectively unusable, approaching the
   * intention of RFC 4862 Sec. 5.4.5. @todo implement the full requirements */
  if (addr_idx == 0) {
    s8_t i;
    for (i = 1; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
      if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) &&
          !netif_ip6_addr_isstatic(netif, i)) {
        netif_ip6_addr_set_state(netif, i, IP6_ADDR_DUPLICATED);
      }
    }
  }
#endif /* LWIP_IPV6_AUTOCONFIG */
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl $0x40, %edx
callq 0x490e
testb %bpl, %bpl
jne 0x11e37
movq $-0x2, %r14
testq %rbx, %rbx
je 0x11e32
cmpb $0x0, 0x9b(%rbx,%r14)
je 0x11e32
cmpl $0x0, 0xa8(%rbx,%r14,4)
je 0x11e32
leal 0x3(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
movl $0x40, %edx
callq 0x490e
incq %r14
jne 0x11e03
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_send_q
static void
nd6_send_q(s8_t i)
{
  struct ip6_hdr *ip6hdr;
  ip6_addr_t dest;
#if LWIP_ND6_QUEUEING
  struct nd6_q_entry *q;
#endif /* LWIP_ND6_QUEUEING */

  if ((i < 0) || (i >= LWIP_ND6_NUM_NEIGHBORS)) {
    return;
  }

#if LWIP_ND6_QUEUEING
  while (neighbor_cache[i].q != NULL) {
    /* remember first in queue */
    q = neighbor_cache[i].q;
    /* pop first item off the queue */
    neighbor_cache[i].q = q->next;
    /* Get ipv6 header. */
    ip6hdr = (struct ip6_hdr *)(q->p->payload);
    /* Create an aligned copy. */
    ip6_addr_copy_from_packed(dest, ip6hdr->dest);
    /* Restore the zone, if applicable. */
    ip6_addr_assign_zone(&dest, IP6_UNKNOWN, neighbor_cache[i].netif);
    /* send the queued IPv6 packet */
    (neighbor_cache[i].netif)->output_ip6(neighbor_cache[i].netif, q->p, &dest);
    /* free the queued IP packet */
    pbuf_free(q->p);
    /* now queue entry can be freed */
    memp_free(MEMP_ND6_QUEUE, q);
  }
#else /* LWIP_ND6_QUEUEING */
  if (neighbor_cache[i].q != NULL) {
    /* Get ipv6 header. */
    ip6hdr = (struct ip6_hdr *)(neighbor_cache[i].q->payload);
    /* Create an aligned copy. */
    ip6_addr_copy_from_packed(dest, ip6hdr->dest);
    /* Restore the zone, if applicable. */
    ip6_addr_assign_zone(&dest, IP6_UNKNOWN, neighbor_cache[i].netif);
    /* send the queued IPv6 packet */
    (neighbor_cache[i].netif)->output_ip6(neighbor_cache[i].netif, neighbor_cache[i].q, &dest);
    /* free the queued IP packet */
    pbuf_free(neighbor_cache[i].q);
    neighbor_cache[i].q = NULL;
  }
#endif /* LWIP_ND6_QUEUEING */
}

// Assembly:
cmpb $0x9, %dil
ja 0x11f3b
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movzbl %dil, %eax
imulq $0x38, %rax, %rax
leaq 0xab71(%rip), %r15      # 0x1ca10
movq 0x28(%rax,%r15), %rbx
testq %rbx, %rbx
je 0x11f32
addq %rax, %r15
movq %rsp, %r14
movq (%rbx), %rax
movq %rax, 0x28(%r15)
movq 0x8(%rbx), %rsi
movq 0x8(%rsi), %rcx
movl 0x18(%rcx), %eax
movups 0x18(%rcx), %xmm0
movaps %xmm0, (%rsp)
movl %eax, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
cmpl $0x80fe, %ecx           # imm = 0x80FE
je 0x11ef0
andl $0x8fff, %eax           # imm = 0x8FFF
cmpl $0x1ff, %eax            # imm = 0x1FF
je 0x11ef0
cmpl $0x2ff, %eax            # imm = 0x2FF
jne 0x11f2a
movq 0x18(%r15), %rdi
movb 0xee(%rdi), %al
incb %al
movb %al, 0x10(%rsp)
movq %r14, %rdx
callq *0xd0(%rdi)
movq 0x8(%rbx), %rdi
callq 0x4fdf
movl $0x8, %edi
movq %rbx, %rsi
callq 0x3cf8
movq 0x28(%r15), %rbx
testq %rbx, %rbx
jne 0x11eb3
jmp 0x11f32
movq 0x18(%r15), %rdi
xorl %eax, %eax
jmp 0x11efc
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq