LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xc4d9
movq %rdi, %rbx
movl 0x88(%rdi), %edi
decl %edi
callq 0x12ed7
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq 0xc462
testq %rax, %rax
je 0xc4d5
leaq 0x18(%rbx), %rcx
movq %rbx, %rdi
movq %rax, %rsi
movq %rbx, %rdx
popq %rbx
jmp 0xc3a0
movb $-0x1, %al
popq %rbx
retq
leaq 0x7dec(%rip), %rdi      # 0x142cc
leaq 0x97cc(%rip), %rsi      # 0x15cb3
leaq 0x92a9(%rip), %rcx      # 0x15797
movl $0x824, %edx            # imm = 0x824
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0x656f
leaq 0x1121e(%rip), %rax     # 0x1d908
leaq 0x1121f(%rip), %rcx     # 0x1d910
movq (%rcx), %rcx
orq (%rax), %rcx
je 0xc714
leaq -0x23(%rip), %rsi       # 0xc6dd
leaq 0x97a8(%rip), %rcx      # 0x15eaf
movl $0xfa, %edi
xorl %edx, %edx
popq %rax
jmp 0xc675
movb $0x0, 0x11275(%rip)     # 0x1d990
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcb65
testq %rsi, %rsi
je 0xcb81
xorl %ecx, %ecx
cmpb $0x2e, 0x2c(%rdi)
movl $0xfa, %eax
cmovnel %ecx, %eax
popq %rcx
retq
leaq 0x7760(%rip), %rdi      # 0x142cc
leaq 0x945b(%rip), %rsi      # 0x15fce
leaq 0x9406(%rip), %rcx      # 0x15f80
movl $0x1e6, %edx            # imm = 0x1E6
jmp 0xcb9b
leaq 0x7744(%rip), %rdi      # 0x142cc
leaq 0x9455(%rip), %rsi      # 0x15fe4
leaq 0x93ea(%rip), %rcx      # 0x15f80
movl $0x1e7, %edx            # imm = 0x1E7
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0xcbc9
testq %rsi, %rsi
je 0xcbe5
xorl %ecx, %ecx
cmpb $0x2e, 0x2c(%rdi)
movl $0xfa, %eax
cmovnel %ecx, %eax
popq %rcx
retq
leaq 0x76fc(%rip), %rdi      # 0x142cc
leaq 0x9424(%rip), %rsi      # 0x15ffb
leaq 0x93a2(%rip), %rcx      # 0x15f80
movl $0x1fe, %edx            # imm = 0x1FE
jmp 0xcbff
leaq 0x76e0(%rip), %rdi      # 0x142cc
leaq 0x9425(%rip), %rsi      # 0x16018
leaq 0x9386(%rip), %rcx      # 0x15f80
movl $0x1ff, %edx            # imm = 0x1FF
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0xd60d
movq %rsi, 0x48(%rdi)
movq %rdx, 0x50(%rdi)
retq
pushq %rax
leaq 0x6cb7(%rip), %rdi      # 0x142cc
leaq 0x8c11(%rip), %rsi      # 0x1622d
leaq 0x895d(%rip), %rcx      # 0x15f80
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0xd681
movq %rdi, %rsi
movq 0x1035d(%rip), %rcx     # 0x1d9a8
cmpq %rdi, %rcx
je 0xd66a
testq %rcx, %rcx
je 0xd678
movq %rcx, %rax
movq 0x38(%rcx), %rcx
cmpq %rsi, %rcx
jne 0xd650
addq $0x38, %rax
movq %rsi, %rcx
jmp 0xd671
leaq 0x10337(%rip), %rax     # 0x1d9a8
movq 0x38(%rcx), %rcx
movq %rcx, (%rax)
pushq $0x1
popq %rdi
popq %rax
jmp 0x3bcd
leaq 0x6c44(%rip), %rdi      # 0x142cc
leaq 0x8bb4(%rip), %rsi      # 0x16243
leaq 0x88ea(%rip), %rcx      # 0x15f80
movl $0x50f, %edx            # imm = 0x50F
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0xd7fb
cmpb $0x6, 0x14(%rdi)
movl (%rdi), %eax
jne 0xd721
testl %eax, %eax
jne 0xd717
cmpl $0x0, 0x4(%rdi)
jne 0xd717
cmpl $0x0, 0x8(%rdi)
je 0xd7ec
testq %rsi, %rsi
jne 0xd734
jmp 0xd7fb
testl %eax, %eax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0xd7fb
cmpb $0x6, 0x14(%rsi)
movl (%rsi), %eax
jne 0xd757
testl %eax, %eax
jne 0xd75f
cmpl $0x0, 0x4(%rsi)
jne 0xd75f
cmpl $0x0, 0x8(%rsi)
jne 0xd75f
cmpl $0x0, 0xc(%rsi)
jne 0xd75f
jmp 0xd7fb
testl %eax, %eax
je 0xd7fb
leaq 0x10242(%rip), %rax     # 0x1d9a8
movq (%rax), %rax
testq %rax, %rax
je 0xd7fb
movb 0x14(%rax), %cl
cmpb 0x14(%rdi), %cl
jne 0xd7e3
movl (%rax), %edx
movl (%rdi), %r8d
cmpb $0x6, %cl
jne 0xd7ab
cmpl %r8d, %edx
jne 0xd7e3
movl 0x4(%rax), %ecx
cmpl 0x4(%rdi), %ecx
jne 0xd7e3
movl 0x8(%rax), %ecx
cmpl 0x8(%rdi), %ecx
jne 0xd7e3
movl 0xc(%rax), %ecx
cmpl 0xc(%rdi), %ecx
jne 0xd7e3
movb 0x10(%rax), %cl
cmpb 0x10(%rdi), %cl
je 0xd7b0
jmp 0xd7e3
cmpl %r8d, %edx
jne 0xd7e3
movb 0x14(%rsi), %cl
movb %cl, 0x14(%rax)
movl (%rsi), %edx
movl %edx, (%rax)
cmpb $0x6, %cl
jne 0xd7d9
movl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rax)
movl 0x8(%rsi), %ecx
movl %ecx, 0x8(%rax)
movl 0xc(%rsi), %ecx
movl %ecx, 0xc(%rax)
movb 0x10(%rsi), %cl
movb %cl, 0x10(%rax)
jmp 0xd7e3
andq $0x0, 0x9(%rax)
andq $0x0, 0x4(%rax)
addq $0x38, %rax
jmp 0xd766
testq %rsi, %rsi
je 0xd7fb
cmpl $0x0, 0xc(%rdi)
jne 0xd734
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xdf97
leaq 0xf963(%rip), %rax      # 0x1d8d8
movq (%rax), %rax
testq %rax, %rax
je 0xdf93
movq %rax, (%rsp)
movzbl %cl, %ecx
movzbl %r8b, %r8d
movzbl %r9b, %r9d
callq 0xdd30
jmp 0xdf95
movb $-0x4, %al
popq %rcx
retq
leaq 0x632e(%rip), %rdi      # 0x142cc
leaq 0x8369(%rip), %rsi      # 0x1630e
leaq 0x836e(%rip), %rcx      # 0x1631a
movl $0x416, %edx            # imm = 0x416
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0x12ed7
movl $0x80000000, %edx       # imm = 0x80000000
movl %edx, %ecx
testl %edx, %edx
je 0xe01b
movl %ecx, %esi
andl %eax, %esi
movl %ecx, %edx
shrl %edx
testl %esi, %esi
jne 0xdffd
jmp 0xe01b
movl %ecx, %edx
shrl %edx
testl %eax, %ecx
movl %edx, %ecx
jne 0xe023
testl %ecx, %ecx
jne 0xe011
movb $0x1, %al
jmp 0xe025
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r14
pushq %rbx
movl (%rdi), %eax
leaq -0x4(%rsp), %rdi
movl %eax, (%rdi)
xorl %r8d, %r8d
movb $0xa, %r10b
movq %rsi, %r9
xorl %r11d, %r11d
cmpb $0x4, %r8b
je 0xe2f0
movb (%rdi), %al
xorl %ebx, %ebx
movzbl %al, %ecx
movl %ecx, %eax
divb %r10b
movzbl %ah, %ebp
orb $0x30, %bpl
movzbl %bl, %r14d
incb %bl
movb %bpl, -0x7(%rsp,%r14)
cmpb $0x9, %cl
ja 0xe289
movb %al, (%rdi)
movzbl %bl, %eax
incq %r9
movq %rax, %rcx
subq $0x1, %rcx
jb 0xe2d1
cmpl %edx, %r11d
jge 0xe2e6
incl %r11d
movb -0x8(%rsp,%rax), %al
movb %al, -0x1(%r9)
incq %r9
movq %rcx, %rax
jmp 0xe2b3
cmpl %edx, %r11d
jge 0xe2e6
incl %r11d
movb $0x2e, -0x1(%r9)
incq %rdi
incb %r8b
jmp 0xe27f
xorl %esi, %esi
movq %rsi, %rax
popq %rbx
popq %r14
popq %rbp
retq
movb $0x0, -0x1(%r9)
jmp 0xe2e8
nop
// File: /workspace/github_c_makefile_star2_O2/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, %ebx
movq %rdi, %r15
xorl %r14d, %r14d
movq 0xf078(%rip), %rax      # 0x1d9d0
movq %rax, %rcx
xorl %edi, %edi
xorl %edx, %edx
xorl %esi, %esi
xorl %ebp, %ebp
testq %rcx, %rcx
je 0xe9b6
movl 0x1c(%rcx), %r8d
cmpl 0xc(%r15), %r8d
jne 0xe988
movl 0x20(%rcx), %r8d
cmpl 0x10(%r15), %r8d
jne 0xe988
movzwl 0x14(%rcx), %r8d
cmpw 0x4(%r15), %r8w
je 0xe9a7
incl %ebp
testq %rdi, %rdi
je 0xe9a1
movb 0x27(%rcx), %r8b
cmpb 0x27(%rdi), %r8b
cmovbeq %rcx, %rdi
cmovbeq %rdx, %rsi
jmp 0xe9a7
movq %rcx, %rdi
movq %rdx, %rsi
movq (%rcx), %r8
testq %r8, %r8
cmovneq %rcx, %rdx
movq %r8, %rcx
jmp 0xe963
testq %rdi, %rdi
je 0xe9ca
callq 0xe336
addl %eax, %r14d
movq 0xf006(%rip), %rax      # 0x1d9d0
cmpl %ebx, %r14d
jge 0xe9d4
cmpl $0x1, %ebp
jg 0xe958
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0xefe4(%rip)      # 0x1d9d0
je 0xea21
testq %rsi, %rsi
jne 0xea28
pushq %rax
leaq 0x58d1(%rip), %rdi      # 0x142cc
leaq 0x7b3c(%rip), %rsi      # 0x1653e
leaq 0x79e8(%rip), %rcx      # 0x163f1
movl $0x145, %edx            # imm = 0x145
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xefa8(%rip), %rsi      # 0x1d9d0
movq (%rax), %rcx
movq %rcx, (%rsi)
pushq $0x5
popq %rdi
movq %rax, %rsi
jmp 0x3bcd
// File: /workspace/github_c_makefile_star2_O2/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 0xed70
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0xed6a
callq 0x4e16
movq %rbx, %rdi
popq %rbx
jmp 0xed48
leaq 0x5555(%rip), %rdi      # 0x142cc
leaq 0x77d9(%rip), %rsi      # 0x16557
leaq 0x766c(%rip), %rcx      # 0x163f1
movl $0x2ce, %edx            # imm = 0x2CE
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0xe8a5(%rip), %r14      # 0x1d770
movq (%r14), %r13
testq %r13, %r13
je 0xef1c
movl %ecx, %ebp
movl %edx, %ebx
movl %esi, %r12d
movq %rdi, %r15
addq $0x24, %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0xf14f
testq %rax, %rax
je 0xef0d
movq %r13, (%rsp)
movzbl %r12b, %esi
movzbl %bpl, %ecx
movq %r15, %rdi
movl %ebx, %edx
movq %rax, %r8
movq %r14, %r9
callq 0xf014
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x53a9(%rip), %rdi      # 0x142cc
leaq 0x7639(%rip), %rsi      # 0x16563
leaq 0x7656(%rip), %rcx      # 0x16587
movl $0x13a, %edx            # imm = 0x13A
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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 0xefb5
movq %rcx, %r14
testq %rcx, %rcx
je 0xefd1
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
movq %r14, %rdi
movq %rdx, %rsi
callq 0xf144
testq %rax, %rax
je 0xefaa
movq %rax, (%rsp)
movzbl %bpl, %esi
pushq $0x3
popq %rcx
movq %r15, %rdi
xorl %edx, %edx
movq %r14, %r8
movq %rbx, %r9
callq 0xf014
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5310(%rip), %rdi      # 0x142cc
leaq 0x7612(%rip), %rsi      # 0x165d5
leaq 0x75bd(%rip), %rcx      # 0x16587
movl $0x161, %edx            # imm = 0x161
jmp 0xefeb
leaq 0x52f4(%rip), %rdi      # 0x142cc
leaq 0x75f6(%rip), %rsi      # 0x165d5
leaq 0x75a1(%rip), %rcx      # 0x16587
movl $0x162, %edx            # imm = 0x162
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/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)
pushq $0x36
popq %rdi
pushq $0x38
popq %rsi
movl $0x280, %edx            # imm = 0x280
callq 0x4c47
testq %rax, %rax
je 0xf105
movq %rax, %r15
movq %r14, 0x10(%rsp)
cmpw $0x37, 0x12(%rax)
jbe 0xf114
movq 0x8(%r15), %r14
movb %r13b, (%r14)
movb %bl, 0x1(%r14)
movl %ebp, %edi
callq 0x12ed7
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)
andw $0x0, 0x2(%r14)
movzwl 0x10(%r15), %edx
pushq $0x3a
popq %rbx
movq %r15, %rdi
movl %ebx, %esi
movq 0x20(%rsp), %r13
movq %r13, %rcx
movq 0x10(%rsp), %r12
movq %r12, %r8
callq 0x13180
movw %ax, 0x2(%r14)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
movl $0xff, %ecx
xorl %r8d, %r8d
movl %ebx, %r9d
callq 0xf908
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4e16
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x51b1(%rip), %rdi      # 0x142cc
leaq 0x7486(%rip), %rsi      # 0x165a8
leaq 0x745e(%rip), %rcx      # 0x16587
movl $0x190, %edx            # imm = 0x190
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0xf946
cmpl $0x0, (%rsi)
jne 0xf946
cmpl $0x0, 0x4(%rsi)
jne 0xf946
cmpl $0x0, 0x8(%rsi)
jne 0xf946
cmpl $0x0, 0xc(%rsi)
je 0xf965
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 0xf99c
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0xf14f
testq %rax, %rax
je 0xf991
movq %rax, %rsi
cmpl $0x0, (%rax)
jne 0xf946
cmpl $0x0, 0x4(%rsi)
jne 0xf946
cmpl $0x0, 0x8(%rsi)
jne 0xf946
cmpl $0x0, 0xc(%rsi)
jne 0xf946
movb $-0x4, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd04b(%rip), %rax      # 0x1da08
movq %rax, %rcx
movq %rax, %rdi
testq %rcx, %rcx
je 0x109dc
cmpq %r14, %rcx
je 0x109d7
movb 0x4f(%rcx), %dl
cmpb 0x4f(%rdi), %dl
cmovbeq %rcx, %rdi
movq (%rcx), %rcx
jmp 0x109c3
cmpq %r14, %rdi
je 0x10a05
testq %rdi, %rdi
je 0x109f2
callq 0x101c5
movq 0xd016(%rip), %rax      # 0x1da08
movzwl 0xd017(%rip), %ecx      # 0x1da10
addl %ebx, %ecx
cmpl $0xb, %ecx
jl 0x10a05
testq %rax, %rax
jne 0x109bd
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x10cd9
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x10cd3
callq 0x4e16
movq %rbx, %rdi
popq %rbx
jmp 0x10cb1
leaq 0x35ec(%rip), %rdi      # 0x142cc
leaq 0x5870(%rip), %rsi      # 0x16557
leaq 0x59ca(%rip), %rcx      # 0x166b8
movl $0x2ba, %edx            # imm = 0x2BA
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
nop
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x40
popq %rdx
callq 0x479d
testb %bpl, %bpl
je 0x11b17
popq %rbx
popq %r14
popq %rbp
retq
pushq $-0x2
popq %r14
pushq $0x40
popq %rbp
testq %r14, %r14
je 0x11b12
testq %rbx, %rbx
je 0x11b4f
cmpb $0x0, 0x9b(%rbx,%r14)
je 0x11b4f
cmpl $0x0, 0xa8(%rbx,%r14,4)
je 0x11b4f
leal 0x3(%r14), %eax
movsbl %al, %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x479d
incq %r14
jmp 0x11b1e
// File: /workspace/github_c_makefile_star2_O2/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 0x11c48
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movzbl %dil, %eax
imulq $0x38, %rax, %rax
leaq 0xbe66(%rip), %r15      # 0x1da20
addq %rax, %r15
movq %rsp, %rbx
pushq $0x8
popq %rbp
movq 0x28(%r15), %r14
testq %r14, %r14
je 0x11c3e
movq (%r14), %rax
movq %rax, 0x28(%r15)
movq 0x8(%r14), %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 0x11c08
andl $0x8fff, %eax           # imm = 0x8FFF
cmpw $0x1ff, %ax             # imm = 0x1FF
je 0x11c08
cmpl $0x2ff, %eax            # imm = 0x2FF
jne 0x11c36
movq 0x18(%r15), %rdi
movb 0xee(%rdi), %al
incb %al
movb %al, 0x10(%rsp)
movq %rbx, %rdx
callq *0xd0(%rdi)
movq 0x8(%r14), %rdi
callq 0x4e16
movl %ebp, %edi
movq %r14, %rsi
callq 0x3bcd
jmp 0x11bc3
movq 0x18(%r15), %rdi
xorl %eax, %eax
jmp 0x11c14
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_free_neighbor_cache_entry
static void
nd6_free_neighbor_cache_entry(s8_t i)
{
  if ((i < 0) || (i >= LWIP_ND6_NUM_NEIGHBORS)) {
    return;
  }
  if (neighbor_cache[i].isrouter) {
    /* isrouter needs to be cleared before deleting a neighbor cache entry */
    return;
  }

  /* Free any queued packets. */
  if (neighbor_cache[i].q != NULL) {
    nd6_free_q(neighbor_cache[i].q);
    neighbor_cache[i].q = NULL;
  }

  neighbor_cache[i].state = ND6_NO_ENTRY;
  neighbor_cache[i].isrouter = 0;
  neighbor_cache[i].netif = NULL;
  neighbor_cache[i].counter.reachable_time = 0;
  ip6_addr_set_zero(&(neighbor_cache[i].next_hop_address));
}

// Assembly:
pushq %rbx
cmpb $0x9, %dil
ja 0x12454
movzbl %dil, %eax
imulq $0x38, %rax, %rax
leaq 0xb601(%rip), %rbx      # 0x1da20
cmpb $0x0, 0x31(%rax,%rbx)
jne 0x12454
addq %rax, %rbx
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x1243c
callq 0x12e1a
andq $0x0, 0x28(%rbx)
andw $0x0, 0x30(%rbx)
andq $0x0, 0x18(%rbx)
andl $0x0, 0x34(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movb $0x0, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_find_route
struct netif *
nd6_find_route(const ip6_addr_t *ip6addr)
{
  struct netif *netif;
  s8_t i;

  /* @todo decide if it makes sense to check the destination cache first */

  /* Check if there is a matching on-link prefix. There may be multiple
   * matches. Pick the first one that is associated with a suitable netif. */
  for (i = 0; i < LWIP_ND6_NUM_PREFIXES; ++i) {
    netif = prefix_list[i].netif;
    if ((netif != NULL) && ip6_addr_netcmp(&prefix_list[i].prefix, ip6addr) &&
        netif_is_up(netif) && netif_is_link_up(netif)) {
      return netif;
    }
  }

  /* No on-link prefix match. Find a router that can forward the packet. */
  i = nd6_select_router(ip6addr, NULL);
  if (i >= 0) {
    LWIP_ASSERT("selected router must have a neighbor entry",
      default_router_list[i].neighbor_entry != NULL);
    return default_router_list[i].neighbor_entry->netif;
  }

  return NULL;
}

// Assembly:
pushq %rbx
pushq $0x18
popq %rax
leaq 0xb66d(%rip), %rcx      # 0x1dca0
cmpq $0xe0, %rax
je 0x12671
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
je 0x1266b
movl -0x18(%rax,%rcx), %edx
cmpl (%rdi), %edx
jne 0x1266b
movl -0x14(%rax,%rcx), %edx
cmpl 0x4(%rdi), %edx
jne 0x1266b
movb -0x8(%rax,%rcx), %dl
cmpb 0x10(%rdi), %dl
jne 0x1266b
movb 0xeb(%rbx), %dl
notb %dl
testb $0x5, %dl
je 0x12698
addq $0x28, %rax
jmp 0x12633
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x126ca
testb %al, %al
js 0x12698
movzbl %al, %eax
shll $0x4, %eax
leaq 0xb5c5(%rip), %rcx      # 0x1dc50
movq (%rax,%rcx), %rax
testq %rax, %rax
je 0x1269d
movq 0x18(%rax), %rbx
movq %rbx, %rax
popq %rbx
retq
leaq 0x1c28(%rip), %rdi      # 0x142cc
leaq 0x4174(%rip), %rsi      # 0x1681f
leaq 0x414e(%rip), %rcx      # 0x16800
movl $0x6e3, %edx            # imm = 0x6E3
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_get_destination_mtu
u16_t
nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif)
{
  s16_t i;

  i = nd6_find_destination_cache_entry(ip6addr);
  if (i >= 0) {
    if (destination_cache[i].pmtu > 0) {
      return destination_cache[i].pmtu;
    }
  }

  if (netif != NULL) {
    return netif_mtu6(netif);
  }

  return 1280; /* Minimum MTU */
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x1206c
testw %ax, %ax
js 0x12caf
movzwl %ax, %eax
imulq $0x30, %rax, %rax
leaq 0xb0cb(%rip), %rcx      # 0x1dd70
movzwl 0x28(%rax,%rcx), %eax
testw %ax, %ax
jne 0x12cc1
testq %rbx, %rbx
je 0x12cbd
movzwl 0xe2(%rbx), %eax
jmp 0x12cc1
movw $0x500, %ax             # imm = 0x500
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_reachability_hint
void
nd6_reachability_hint(const ip6_addr_t *ip6addr)
{
  s8_t i;
  s16_t dst_idx;

  /* Find destination in cache. */
  if (ip6_addr_cmp(ip6addr, &(destination_cache[nd6_cached_destination_index].destination_addr))) {
    dst_idx = nd6_cached_destination_index;
    ND6_STATS_INC(nd6.cachehit);
  } else {
    dst_idx = nd6_find_destination_cache_entry(ip6addr);
  }
  if (dst_idx < 0) {
    return;
  }

  /* Find next hop neighbor in cache. */
  if (ip6_addr_cmp(&(destination_cache[dst_idx].next_hop_addr), &(neighbor_cache[nd6_cached_neighbor_index].next_hop_address))) {
    i = nd6_cached_neighbor_index;
    ND6_STATS_INC(nd6.cachehit);
  } else {
    i = nd6_find_neighbor_cache_entry(&(destination_cache[dst_idx].next_hop_addr));
  }
  if (i < 0) {
    return;
  }

  /* For safety: don't set as reachable if we don't have a LL address yet. Misuse protection. */
  if (neighbor_cache[i].state == ND6_INCOMPLETE || neighbor_cache[i].state == ND6_NO_ENTRY) {
    return;
  }

  /* Set reachability state. */
  neighbor_cache[i].state = ND6_REACHABLE;
  neighbor_cache[i].counter.reachable_time = reachable_time;
}

// Assembly:
pushq %rbx
movl (%rdi), %edx
movzbl 0xb284(%rip), %eax      # 0x1df51
imulq $0x30, %rax, %rcx
leaq 0xb098(%rip), %rbx      # 0x1dd70
cmpl (%rcx,%rbx), %edx
jne 0x12d00
addq %rbx, %rcx
movl 0x4(%rdi), %edx
cmpl 0x4(%rcx), %edx
jne 0x12d00
movl 0x8(%rdi), %edx
cmpl 0x8(%rcx), %edx
jne 0x12d00
movl 0xc(%rdi), %edx
cmpl 0xc(%rcx), %edx
jne 0x12d00
movb 0x10(%rdi), %dl
cmpb 0x10(%rcx), %dl
je 0x12d0a
callq 0x1206c
testw %ax, %ax
js 0x12d7c
movzwl %ax, %eax
imulq $0x30, %rax, %rax
leaq (%rax,%rbx), %rdi
addq $0x14, %rdi
movl (%rdi), %edx
movzbl 0xb230(%rip), %eax      # 0x1df52
imulq $0x38, %rax, %rcx
leaq 0xacf3(%rip), %rbx      # 0x1da20
cmpl (%rcx,%rbx), %edx
jne 0x12d55
addq %rbx, %rcx
movl 0x4(%rdi), %edx
cmpl 0x4(%rcx), %edx
jne 0x12d55
movl 0x8(%rdi), %edx
cmpl 0x8(%rcx), %edx
jne 0x12d55
movl 0xc(%rdi), %edx
cmpl 0xc(%rcx), %edx
jne 0x12d55
movb 0x10(%rdi), %dl
cmpb 0x10(%rcx), %dl
je 0x12d5a
callq 0x11b54
testb %al, %al
js 0x12d7c
movzbl %al, %eax
imulq $0x38, %rax, %rax
cmpb $0x2, 0x30(%rax,%rbx)
jb 0x12d7c
addq %rax, %rbx
movb $0x2, 0x30(%rbx)
movl 0xa3db(%rip), %eax      # 0x1d154
movl %eax, 0x34(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_cleanup_netif
void
nd6_cleanup_netif(struct netif *netif)
{
  u8_t i;
  s8_t router_index;
  for (i = 0; i < LWIP_ND6_NUM_PREFIXES; i++) {
    if (prefix_list[i].netif == netif) {
      prefix_list[i].netif = NULL;
    }
  }
  for (i = 0; i < LWIP_ND6_NUM_NEIGHBORS; i++) {
    if (neighbor_cache[i].netif == netif) {
      for (router_index = 0; router_index < LWIP_ND6_NUM_ROUTERS; router_index++) {
        if (default_router_list[router_index].neighbor_entry == &neighbor_cache[i]) {
          default_router_list[router_index].neighbor_entry = NULL;
          default_router_list[router_index].flags = 0;
        }
      }
      neighbor_cache[i].isrouter = 0;
      nd6_free_neighbor_cache_entry(i);
    }
  }
  /* Clear the destination cache, since many entries may now have become
   * invalid for one of several reasons. As destination cache entries have no
   * netif association, use a sledgehammer approach (this can be improved). */
  nd6_clear_destination_cache();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x18
popq %rax
leaq 0xaf0d(%rip), %rcx      # 0x1dca0
cmpq $0xe0, %rax
je 0x12dac
cmpq %rbx, (%rax,%rcx)
jne 0x12da6
andq $0x0, (%rax,%rcx)
addq $0x28, %rax
jmp 0x12d93
xorl %r14d, %r14d
leaq 0xac6a(%rip), %r15      # 0x1da20
leaq 0xae93(%rip), %r12      # 0x1dc50
cmpq $0xa, %r14
je 0x12e02
imulq $0x38, %r14, %rax
cmpq %rbx, 0x18(%rax,%r15)
jne 0x12dfd
addq %r15, %rax
xorl %ecx, %ecx
cmpq $0x30, %rcx
je 0x12df0
cmpq %rax, (%rcx,%r12)
jne 0x12dea
andq $0x0, (%rcx,%r12)
movb $0x0, 0xc(%rcx,%r12)
addq $0x10, %rcx
jmp 0x12dd3
movb $0x0, 0x31(%rax)
movsbl %r14b, %edi
callq 0x12409
incq %r14
jmp 0x12dbd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x12604
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/ipv6/nd6.c
// Function: nd6_free_q
static void
nd6_free_q(struct nd6_q_entry *q)
{
  struct nd6_q_entry *r;
  LWIP_ASSERT("q != NULL", q != NULL);
  LWIP_ASSERT("q->p != NULL", q->p != NULL);
  while (q) {
    r = q;
    q = q->next;
    LWIP_ASSERT("r->p != NULL", (r->p != NULL));
    pbuf_free(r->p);
    memp_free(MEMP_ND6_QUEUE, r);
  }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x8(%rdi)
je 0x12e82
movq %rdi, %rbx
pushq $0x8
popq %rbp
testq %rbx, %rbx
je 0x12e50
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x12e55
movq (%rbx), %r14
callq 0x4e16
movl %ebp, %edi
movq %rbx, %rsi
callq 0x3bcd
movq %r14, %rbx
jmp 0x12e2b
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1470(%rip), %rdi      # 0x142cc
leaq 0x3a0f(%rip), %rsi      # 0x16872
leaq 0x3996(%rip), %rcx      # 0x16800
movl $0x873, %edx            # imm = 0x873
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0x1443(%rip), %rdi      # 0x142cc
leaq 0x39d5(%rip), %rsi      # 0x16865
leaq 0x3969(%rip), %rcx      # 0x16800
movl $0x86f, %edx            # imm = 0x86F
jmp 0x12e6f
nop
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/def.c
// Function: lwip_strnstr
char *
lwip_strnstr(const char *buffer, const char *token, size_t n)
{
  const char *p;
  size_t tokenlen = strlen(token);
  if (tokenlen == 0) {
    return LWIP_CONST_CAST(char *, buffer);
  }
  for (p = buffer; *p && (p + tokenlen <= buffer + n); p++) {
    if ((*p == *token) && (strncmp(p, token, tokenlen) == 0)) {
      return LWIP_CONST_CAST(char *, p);
    }
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20c0
testq %rax, %rax
je 0x12f2f
movq %rax, %r13
addq %rbx, %r14
xorl %r12d, %r12d
movb (%rbx), %al
testb %al, %al
je 0x12f32
leaq (%rbx,%r13), %rcx
cmpq %r14, %rcx
ja 0x12f32
cmpb (%r15), %al
jne 0x12f2a
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x2080
testl %eax, %eax
je 0x12f2f
incq %rbx
jmp 0x12f04
movq %rbx, %r12
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/def.c
// Function: lwip_itoa
void
lwip_itoa(char *result, size_t bufsize, int number)
{
  char *res = result;
  char *tmp = result + bufsize - 1;
  int n = (number >= 0) ? number : -number;

  /* handle invalid bufsize */
  if (bufsize < 2) {
    if (bufsize == 1) {
      *result = 0;
    }
    return;
  }

  /* First, add sign */
  if (number < 0) {
    *res++ = '-';
  }
  /* Then create the string from the end and stop if buffer full,
     and ensure output string is zero terminated */
  *tmp = 0;
  while ((n != 0) && (tmp > res)) {
    char val = (char)('0' + (n % 10));
    tmp--;
    *tmp = val;
    n = n / 10;
  }
  if (n) {
    /* buffer is too small */
    *result = 0;
    return;
  }
  if (*tmp == 0) {
    /* Nothing added? */
    *res++ = '0';
    *res++ = 0;
    return;
  }
  /* move from temporary buffer to output buffer (sign is not moved) */
  memmove(res, tmp, (size_t)((result + bufsize) - tmp));
}

// Assembly:
movl %edx, %eax
negl %eax
cmovsl %edx, %eax
cmpq $0x1, %rsi
ja 0x12fc5
je 0x1300b
retq
addq %rdi, %rsi
movq %rdi, %rcx
testl %edx, %edx
jns 0x12fd6
leaq 0x1(%rdi), %rcx
movb $0x2d, (%rdi)
movb $0x0, -0x1(%rsi)
movb $0x1, %r9b
pushq $-0x1
popq %r8
pushq $0xa
popq %r10
leaq (%rsi,%r8), %rdx
testl %eax, %eax
je 0x13007
cmpq %rcx, %rdx
jbe 0x13007
xorl %edx, %edx
divl %r10d
xorl %r9d, %r9d
orb $0x30, %dl
movb %dl, -0x1(%rsi,%r8)
decq %r8
jmp 0x12fe5
testl %eax, %eax
je 0x1300f
movb $0x0, (%rdi)
retq
testb $0x1, %r9b
je 0x1301b
movw $0x30, (%rcx)
retq
negq %r8
movq %rcx, %rdi
movq %rdx, %rsi
movq %r8, %rdx
jmp 0x21d0
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: inet_cksum_pseudo_base
static u16_t
inet_cksum_pseudo_base(struct pbuf *p, u8_t proto, u16_t proto_len, u32_t acc)
{
  struct pbuf *q;
  int swapped = 0;

  /* iterate through all pbuf in chain */
  for (q = p; q != NULL; q = q->next) {
    LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): checksumming pbuf %p (has next %p) \n",
                             (void *)q, (void *)q->next));
    acc += LWIP_CHKSUM(q->payload, q->len);
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): unwrapped lwip_chksum()=%"X32_F" \n", acc));*/
    /* just executing this next line is probably faster that the if statement needed
       to check whether we really need to execute it, and does no harm */
    acc = FOLD_U32T(acc);
    if (q->len % 2 != 0) {
      swapped = !swapped;
      acc = SWAP_BYTES_IN_WORD(acc);
    }
    /*LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): wrapped lwip_chksum()=%"X32_F" \n", acc));*/
  }

  if (swapped) {
    acc = SWAP_BYTES_IN_WORD(acc);
  }

  acc += (u32_t)lwip_htons((u16_t)proto);
  acc += (u32_t)lwip_htons(proto_len);

  /* Fold 32-bit sum to 16 bits
     calling this twice is probably faster than if statements... */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);
  LWIP_DEBUGF(INET_DEBUG, ("inet_chksum_pseudo(): pbuf chain lwip_chksum()=%"X32_F"\n", acc));
  return (u16_t)~(acc & 0xffffUL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r15
xorl %r13d, %r13d
testq %r15, %r15
je 0x13132
movq 0x8(%r15), %rdi
movzwl 0x12(%r15), %r12d
movl %r12d, %esi
callq 0x1302c
movzwl %ax, %eax
addl %eax, %r14d
movl %r14d, %eax
shrl $0x10, %eax
movzwl %r14w, %r14d
addl %eax, %r14d
testb $0x1, %r12b
je 0x1312d
xorl %eax, %eax
testl %r13d, %r13d
sete %al
rolw $0x8, %r14w
movzwl %r14w, %r14d
movl %eax, %r13d
movq (%r15), %r15
jmp 0x130ea
movl %r14d, %eax
rolw $0x8, %ax
testl %r13d, %r13d
movzwl %ax, %r15d
cmovel %r14d, %r15d
movzbl %bpl, %edi
callq 0x12ed0
movzwl %ax, %ebp
movzwl %bx, %edi
callq 0x12ed0
movzwl %ax, %eax
addl %ebp, %eax
addl %r15d, %eax
movzwl %ax, %ecx
shrl $0x10, %eax
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
addl %ecx, %eax
notl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/inet_chksum.c
// Function: ip6_chksum_pseudo
u16_t
ip6_chksum_pseudo(struct pbuf *p, u8_t proto, u16_t proto_len,
                  const ip6_addr_t *src, const ip6_addr_t *dest)
{
  u32_t acc = 0;
  u32_t addr;
  u8_t addr_part;

  for (addr_part = 0; addr_part < 4; addr_part++) {
    addr = src->addr[addr_part];
    acc = (u32_t)(acc + (addr & 0xffffUL));
    acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
    addr = dest->addr[addr_part];
    acc = (u32_t)(acc + (addr & 0xffffUL));
    acc = (u32_t)(acc + ((addr >> 16) & 0xffffUL));
  }
  /* fold down to 16 bits */
  acc = FOLD_U32T(acc);
  acc = FOLD_U32T(acc);

  return inet_cksum_pseudo_base(p, proto, proto_len, acc);
}

// Assembly:
pushq %rbp
pushq %rbx
movq %rcx, %rax
xorl %r9d, %r9d
movl $0xffff, %r10d          # imm = 0xFFFF
xorl %ecx, %ecx
cmpq $0x4, %r9
je 0x131be
movl (%rax,%r9,4), %r11d
movl %r11d, %ebx
andl %r10d, %ebx
addl %ecx, %ebx
shrl $0x10, %r11d
movl (%r8,%r9,4), %ecx
movl %ecx, %ebp
andl %r10d, %ebp
addl %r11d, %ebp
addl %ebx, %ebp
shrl $0x10, %ecx
addl %ebp, %ecx
incq %r9
jmp 0x13190
movl %ecx, %eax
shrl $0x10, %eax
movl $0xffff, %r8d           # imm = 0xFFFF
andl %r8d, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
andl %r8d, %ecx
addl %eax, %ecx
movzbl %sil, %esi
movzwl %dx, %edx
popq %rbx
popq %rbp
jmp 0x130d2