LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/netif.c
// Function: netif_get_ip6_addr_match
s8_t
netif_get_ip6_addr_match(struct netif *netif, const ip6_addr_t *ip6addr)
{
  s8_t i;

  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ASSERT("netif_get_ip6_addr_match: invalid netif", netif != NULL);
  LWIP_ASSERT("netif_get_ip6_addr_match: invalid ip6addr", ip6addr != NULL);

#if LWIP_IPV6_SCOPES
  if (ip6_addr_has_zone(ip6addr) && !ip6_addr_test_zone(ip6addr, netif)) {
    return -1; /* wrong zone, no match */
  }
#endif /* LWIP_IPV6_SCOPES */

  for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
    if (!ip6_addr_isinvalid(netif_ip6_addr_state(netif, i)) &&
        ip6_addr_cmp_zoneless(netif_ip6_addr(netif, i), ip6addr)) {
      return i;
    }
  }
  return -1;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x4a0d
testq %rsi, %rsi
je 0x4a29
movb 0x10(%rsi), %cl
testb %cl, %cl
je 0x49ce
movb 0xee(%rdi), %dl
incb %dl
movb $-0x1, %al
cmpb %dl, %cl
jne 0x4a0b
leaq 0x5c(%rdi), %rcx
xorl %eax, %eax
cmpb $0x0, 0x98(%rdi,%rax)
je 0x49fc
movl -0xc(%rcx), %edx
cmpl (%rsi), %edx
jne 0x49fc
movl -0x8(%rcx), %edx
cmpl 0x4(%rsi), %edx
jne 0x49fc
movl -0x4(%rcx), %edx
cmpl 0x8(%rsi), %edx
jne 0x49fc
movl (%rcx), %edx
cmpl 0xc(%rsi), %edx
je 0x4a0b
incq %rax
addq $0x18, %rcx
cmpq $0x3, %rax
jne 0x49d4
movb $-0x1, %al
popq %rcx
retq
leaq 0xf8b8(%rip), %rdi      # 0x142cc
leaq 0xfcea(%rip), %rsi      # 0x14705
leaq 0xfa18(%rip), %rcx      # 0x1443a
movl $0x5be, %edx            # imm = 0x5BE
jmp 0x4a43
leaq 0xf89c(%rip), %rdi      # 0x142cc
leaq 0xfcf6(%rip), %rsi      # 0x1472d
leaq 0xf9fc(%rip), %rcx      # 0x1443a
movl $0x5bf, %edx            # imm = 0x5BF
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/netif.c
// Function: netif_add_ip6_address
err_t
netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t *chosen_idx)
{
  s8_t i;

  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ASSERT("netif_add_ip6_address: invalid netif", netif != NULL);
  LWIP_ASSERT("netif_add_ip6_address: invalid ip6addr", ip6addr != NULL);

  i = netif_get_ip6_addr_match(netif, ip6addr);
  if (i >= 0) {
    /* Address already added */
    if (chosen_idx != NULL) {
      *chosen_idx = i;
    }
    return ERR_OK;
  }

  /* Find a free slot. The first one is reserved for link-local addresses. */
  for (i = ip6_addr_islinklocal(ip6addr) ? 0 : 1; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
    if (ip6_addr_isinvalid(netif_ip6_addr_state(netif, i))) {
      ip_addr_copy_from_ip6(netif->ip6_addr[i], *ip6addr);
      ip6_addr_assign_zone(ip_2_ip6(&netif->ip6_addr[i]), IP6_UNICAST, netif);
      netif_ip6_addr_set_state(netif, i, IP6_ADDR_TENTATIVE);
      if (chosen_idx != NULL) {
        *chosen_idx = i;
      }
      return ERR_OK;
    }
  }

  if (chosen_idx != NULL) {
    *chosen_idx = -1;
  }
  return ERR_VAL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4c91
movq %rsi, %r12
testq %rsi, %rsi
je 0x4cad
movq %rdx, %rbx
movq %rdi, %r15
movq %r12, %rsi
callq 0x49ae
testb %al, %al
js 0x4bf0
movl %eax, %r14d
jmp 0x4c7b
movl (%r12), %edx
movl %edx, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
xorl %r14d, %r14d
cmpl $0x80fe, %ecx           # imm = 0x80FE
setne %r14b
leaq (%r14,%r14,2), %rax
leaq (%r15,%rax,8), %rax
addq $0x64, %rax
cmpb $0x0, 0x98(%r15,%r14)
je 0x4c34
incq %r14
addq $0x18, %rax
cmpq $0x3, %r14
jne 0x4c15
movb $-0x1, %r14b
movb $-0x6, %al
jmp 0x4c7d
movl %edx, -0x14(%rax)
movl 0x4(%r12), %edx
movl %edx, -0x10(%rax)
movl 0x8(%r12), %edx
movl %edx, -0xc(%rax)
movl 0xc(%r12), %edx
movl %edx, -0x8(%rax)
movb $0x6, (%rax)
cmpl $0x80fe, %ecx           # imm = 0x80FE
jne 0x4c65
movb 0xee(%r15), %cl
incb %cl
jmp 0x4c67
xorl %ecx, %ecx
movb %cl, -0x4(%rax)
movsbl %r14b, %esi
movq %r15, %rdi
movl $0x8, %edx
callq 0x490e
xorl %eax, %eax
testq %rbx, %rbx
je 0x4c85
movb %r14b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xf634(%rip), %rdi      # 0x142cc
leaq 0xfaea(%rip), %rsi      # 0x14789
leaq 0xf794(%rip), %rcx      # 0x1443a
movl $0x623, %edx            # imm = 0x623
jmp 0x4cc7
leaq 0xf618(%rip), %rdi      # 0x142cc
leaq 0xfaf3(%rip), %rsi      # 0x147ae
leaq 0xf778(%rip), %rcx      # 0x1443a
movl $0x624, %edx            # imm = 0x624
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/netif.c
// Function: netif_find
struct netif *
netif_find(const char *name)
{
  struct netif *netif;
  u8_t num;

  LWIP_ASSERT_CORE_LOCKED();

  if (name == NULL) {
    return NULL;
  }

  num = (u8_t)atoi(&name[2]);

  NETIF_FOREACH(netif) {
    if (num == netif->num &&
        name[0] == netif->name[0] &&
        name[1] == netif->name[1]) {
      LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: found %c%c\n", name[0], name[1]));
      return netif;
    }
  }
  LWIP_DEBUGF(NETIF_DEBUG, ("netif_find: didn't find %c%c\n", name[0], name[1]));
  return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4d3b
movq 0x17bd5(%rip), %rbx     # 0x1c8d8
testq %rbx, %rbx
je 0x4d3b
movq %rdi, %r14
addq $0x2, %rdi
callq 0x21f0
cmpb %al, 0xee(%rbx)
jne 0x4d33
movb (%r14), %cl
cmpb 0xec(%rbx), %cl
jne 0x4d33
movb 0x1(%r14), %cl
cmpb 0xed(%rbx), %cl
je 0x4d3d
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x4d14
xorl %ebx, %ebx
movq %rbx, %rax
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/netif.c
// Function: netif_index_to_name
char *
netif_index_to_name(u8_t idx, char *name)
{
  struct netif *netif = netif_get_by_index(idx);

  if (netif != NULL) {
    name[0] = netif->name[0];
    name[1] = netif->name[1];
    lwip_itoa(&name[2], NETIF_NAMESIZE - 2, netif_index_to_num(idx));
    return name;
  }
  return NULL;
}

// Assembly:
pushq %rbx
testl %edi, %edi
je 0x4d96
movq %rsi, %rbx
leaq 0x17b81(%rip), %rax     # 0x1c8d8
movq (%rax), %rax
testq %rax, %rax
je 0x4d96
movb 0xee(%rax), %cl
incb %cl
cmpb %dil, %cl
jne 0x4d57
movb 0xec(%rax), %cl
movb %cl, (%rbx)
movb 0xed(%rax), %al
movb %al, 0x1(%rbx)
leaq 0x2(%rbx), %rax
movzbl %dil, %edx
decl %edx
movl $0x4, %esi
movq %rax, %rdi
callq 0x136d4
jmp 0x4d98
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_alloc_reference
struct pbuf *
pbuf_alloc_reference(void *payload, u16_t length, pbuf_type type)
{
  struct pbuf *p;
  LWIP_ASSERT("invalid pbuf_type", (type == PBUF_REF) || (type == PBUF_ROM));
  /* only allocate memory for the pbuf structure */
  p = (struct pbuf *)memp_malloc(MEMP_PBUF);
  if (p == NULL) {
    LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_LEVEL_SERIOUS,
                ("pbuf_alloc_reference: Could not allocate MEMP_PBUF for PBUF_%s.\n",
                 (type == PBUF_ROM) ? "ROM" : "REF"));
    return NULL;
  }
  pbuf_init_alloced_pbuf(p, payload, length, length, type, 0);
  return p;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %eax
andl $-0x41, %eax
cmpl $0x1, %eax
jne 0x4fb2
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl $0xa, %edi
callq 0x3c6e
testq %rax, %rax
je 0x4fad
movq $0x0, (%rax)
movq %r14, 0x8(%rax)
movw %bp, 0x10(%rax)
movw %bp, 0x12(%rax)
movb %bl, 0x14(%rax)
movw $0x100, 0x15(%rax)      # imm = 0x100
movb $0x0, 0x17(%rax)
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xf313(%rip), %rdi      # 0x142cc
leaq 0xf8d3(%rip), %rsi      # 0x14893
leaq 0xf862(%rip), %rcx      # 0x14829
movl $0x14a, %edx            # imm = 0x14A
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/pbuf.c
// Function: pbuf_remove_header
u8_t
pbuf_remove_header(struct pbuf *p, size_t header_size_decrement)
{
  void *payload;
  u16_t increment_magnitude;

  LWIP_ASSERT("p != NULL", p != NULL);
  if ((p == NULL) || (header_size_decrement > 0xFFFF)) {
    return 1;
  }
  if (header_size_decrement == 0) {
    return 0;
  }

  increment_magnitude = (u16_t)header_size_decrement;
  /* Check that we aren't going to move off the end of the pbuf */
  LWIP_ERROR("increment_magnitude <= p->len", (increment_magnitude <= p->len), return 1;);

  /* remember current payload pointer */
  payload = p->payload;
  LWIP_UNUSED_ARG(payload); /* only used in LWIP_DEBUGF below */

  /* increase payload pointer (guarded by length check above) */
  p->payload = (u8_t *)p->payload + header_size_decrement;
  /* modify pbuf length fields */
  p->len = (u16_t)(p->len - increment_magnitude);
  p->tot_len = (u16_t)(p->tot_len - increment_magnitude);

  LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_remove_header: old %p new %p (%"U16_F")\n",
              (void *)payload, (void *)p->payload, increment_magnitude));

  return 0;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x52cc
movb $0x1, %al
cmpq $0xffff, %rsi           # imm = 0xFFFF
ja 0x52ca
testq %rsi, %rsi
je 0x52c8
movzwl 0x12(%rdi), %eax
cmpq %rsi, %rax
jb 0x52e8
addq %rsi, 0x8(%rdi)
subl %esi, %eax
movw %ax, 0x12(%rdi)
subw %si, 0x10(%rdi)
xorl %eax, %eax
popq %rcx
retq
leaq 0xeff9(%rip), %rdi      # 0x142cc
leaq 0xf5d9(%rip), %rsi      # 0x148b3
leaq 0xf548(%rip), %rcx      # 0x14829
movl $0x24b, %edx            # imm = 0x24B
jmp 0x5302
leaq 0xefdd(%rip), %rdi      # 0x142cc
leaq 0xf5fb(%rip), %rsi      # 0x148f1
leaq 0xf52c(%rip), %rcx      # 0x14829
movl $0x255, %edx            # imm = 0x255
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/pbuf.c
// Function: pbuf_header_impl
static u8_t
pbuf_header_impl(struct pbuf *p, s16_t header_size_increment, u8_t force)
{
  if (header_size_increment < 0) {
    return pbuf_remove_header(p, (size_t) - header_size_increment);
  } else {
    return pbuf_add_header_impl(p, (size_t)header_size_increment, force);
  }
}

// Assembly:
testw %si, %si
js 0x5329
movzwl %si, %esi
movzbl %dl, %edx
jmp 0x520c
movswq %si, %rsi
negq %rsi
jmp 0x529b
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_free_header
struct pbuf *
pbuf_free_header(struct pbuf *q, u16_t size)
{
  struct pbuf *p = q;
  u16_t free_left = size;
  while (free_left && p) {
    if (free_left >= p->len) {
      struct pbuf *f = p;
      free_left = (u16_t)(free_left - p->len);
      p = p->next;
      f->next = 0;
      pbuf_free(f);
    } else {
      pbuf_remove_header(p, free_left);
      free_left = 0;
    }
  }
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
testl %esi, %esi
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x538d
movl %esi, %ebx
movzwl 0x12(%r14), %ebp
cmpw %bp, %bx
jb 0x5382
movq (%r14), %r15
movq $0x0, (%r14)
movq %r14, %rdi
callq 0x4fdf
subw %bp, %bx
je 0x5390
movq %r15, %r14
testq %r15, %r15
jne 0x5357
jmp 0x5390
movzwl %bx, %esi
movq %r14, %rdi
callq 0x529b
movq %r14, %r15
movq %r15, %rax
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/pbuf.c
// Function: pbuf_ref
void
pbuf_ref(struct pbuf *p)
{
  /* pbuf given? */
  if (p != NULL) {
    SYS_ARCH_SET(p->ref, (LWIP_PBUF_REF_T)(p->ref + 1));
    LWIP_ASSERT("pbuf ref overflow", p->ref > 0);
  }
}

// Assembly:
testq %rdi, %rdi
je 0x53b7
incb 0x16(%rdi)
je 0x53b8
retq
pushq %rax
leaq 0xef0c(%rip), %rdi      # 0x142cc
leaq 0xf591(%rip), %rsi      # 0x14958
leaq 0xf45b(%rip), %rcx      # 0x14829
movl $0x342, %edx            # imm = 0x342
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/pbuf.c
// Function: pbuf_cat
void
pbuf_cat(struct pbuf *h, struct pbuf *t)
{
  struct pbuf *p;

  LWIP_ERROR("(h != NULL) && (t != NULL) (programmer violates API)",
             ((h != NULL) && (t != NULL)), return;);

  /* proceed to last pbuf of chain */
  for (p = h; p->next != NULL; p = p->next) {
    /* add total length of second chain to all totals of first chain */
    p->tot_len = (u16_t)(p->tot_len + t->tot_len);
  }
  /* { p is last pbuf of first h chain, p->next == NULL } */
  LWIP_ASSERT("p->tot_len == p->len (of last pbuf in chain)", p->tot_len == p->len);
  LWIP_ASSERT("p->next == NULL", p->next == NULL);
  /* add total length of second chain to last pbuf total of first chain */
  p->tot_len = (u16_t)(p->tot_len + t->tot_len);
  /* chain last pbuf of head (p) with first of tail (t) */
  p->next = t;
  /* p->next now references t, but the caller will drop its reference to t,
   * so netto there is no change to the reference count of t.
   */
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x542b
testq %rsi, %rsi
je 0x542b
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x5411
movzwl 0x10(%rsi), %eax
addw %ax, 0x10(%rdi)
movq %rcx, %rax
movq (%rcx), %rcx
movq %rax, %rdi
testq %rcx, %rcx
jne 0x53f9
jmp 0x5414
movq %rdi, %rax
movzwl 0x10(%rax), %ecx
cmpw 0x12(%rax), %cx
jne 0x5447
addw 0x10(%rsi), %cx
movw %cx, 0x10(%rax)
movq %rsi, (%rax)
popq %rax
retq
leaq 0xee9a(%rip), %rdi      # 0x142cc
leaq 0xf531(%rip), %rsi      # 0x1496a
leaq 0xf3e9(%rip), %rcx      # 0x14829
movl $0x35a, %edx            # imm = 0x35A
jmp 0x5461
leaq 0xee7e(%rip), %rdi      # 0x142cc
leaq 0xf54a(%rip), %rsi      # 0x1499f
leaq 0xf3cd(%rip), %rcx      # 0x14829
movl $0x362, %edx            # imm = 0x362
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/pbuf.c
// Function: pbuf_dechain
struct pbuf *
pbuf_dechain(struct pbuf *p)
{
  struct pbuf *q;
  u8_t tail_gone = 1;
  /* tail */
  q = p->next;
  /* pbuf has successor in chain? */
  if (q != NULL) {
    /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
    LWIP_ASSERT("p->tot_len == p->len + q->tot_len", q->tot_len == p->tot_len - p->len);
    /* enforce invariant if assertion is disabled */
    q->tot_len = (u16_t)(p->tot_len - p->len);
    /* decouple pbuf from remainder */
    p->next = NULL;
    /* total length of pbuf p is its own length only */
    p->tot_len = p->len;
    /* q is no longer referenced by p, free it */
    LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_dechain: unreferencing %p\n", (void *)q));
    tail_gone = pbuf_free(q);
    if (tail_gone > 0) {
      LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE,
                  ("pbuf_dechain: deallocated %p (as it is no longer referenced)\n", (void *)q));
    }
    /* return remaining tail or NULL if deallocated */
  }
  /* assert tot_len invariant: (p->tot_len == p->len + (p->next? p->next->tot_len: 0) */
  LWIP_ASSERT("p->tot_len == p->len", p->tot_len == p->len);
  return ((tail_gone > 0) ? NULL : q);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x54c4
movzwl 0x10(%rbx), %ecx
movzwl 0x10(%r14), %edx
movzwl 0x12(%r14), %eax
subl %eax, %edx
cmpl %ecx, %edx
jne 0x54fe
movq $0x0, (%r14)
movw %ax, 0x10(%r14)
movq %rbx, %rdi
callq 0x4fdf
testb %al, %al
sete %cl
jmp 0x54c6
xorl %ecx, %ecx
movzwl 0x10(%r14), %eax
cmpw 0x12(%r14), %ax
jne 0x54e2
xorl %eax, %eax
testb %cl, %cl
cmovneq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xede3(%rip), %rdi      # 0x142cc
leaq 0xf4fe(%rip), %rsi      # 0x149ee
leaq 0xf332(%rip), %rcx      # 0x14829
movl $0x3aa, %edx            # imm = 0x3AA
jmp 0x5518
leaq 0xedc7(%rip), %rdi      # 0x142cc
leaq 0xf4c0(%rip), %rsi      # 0x149cc
leaq 0xf316(%rip), %rcx      # 0x14829
movl $0x399, %edx            # imm = 0x399
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/pbuf.c
// Function: pbuf_copy_partial
u16_t
pbuf_copy_partial(const struct pbuf *buf, void *dataptr, u16_t len, u16_t offset)
{
  const struct pbuf *p;
  u16_t left = 0;
  u16_t buf_copy_len;
  u16_t copied_total = 0;

  LWIP_ERROR("pbuf_copy_partial: invalid buf", (buf != NULL), return 0;);
  LWIP_ERROR("pbuf_copy_partial: invalid dataptr", (dataptr != NULL), return 0;);

  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  for (p = buf; len != 0 && p != NULL; p = p->next) {
    if ((offset != 0) && (offset >= p->len)) {
      /* don't copy from this buffer -> on to the next */
      offset = (u16_t)(offset - p->len);
    } else {
      /* copy from this buffer. maybe only partially. */
      buf_copy_len = (u16_t)(p->len - offset);
      if (buf_copy_len > len) {
        buf_copy_len = len;
      }
      /* copy the necessary parts of the buffer */
      MEMCPY(&((char *)dataptr)[left], &((char *)p->payload)[offset], buf_copy_len);
      copied_total = (u16_t)(copied_total + buf_copy_len);
      left = (u16_t)(left + buf_copy_len);
      len = (u16_t)(len - buf_copy_len);
      offset = 0;
    }
  }
  return copied_total;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5768
movq %rsi, %r14
testq %rsi, %rsi
je 0x5784
movl %edx, %ebx
testw %bx, %bx
je 0x5755
movq %rdi, %r15
xorl %ebp, %ebp
xorl %r12d, %r12d
testw %cx, %cx
sete %al
movzwl 0x12(%r15), %r13d
cmpw %r13w, %cx
setb %dl
orb %al, %dl
je 0x5743
subl %ecx, %r13d
cmpw %bx, %r13w
cmovael %ebx, %r13d
movzwl %r12w, %edi
addq %r14, %rdi
movzwl %cx, %esi
addq 0x8(%r15), %rsi
movzwl %r13w, %edx
callq 0x2180
addl %r13d, %ebp
addl %r13d, %r12d
subl %r13d, %ebx
xorl %ecx, %ecx
jmp 0x5746
subl %r13d, %ecx
testw %bx, %bx
je 0x5757
movq (%r15), %r15
testq %r15, %r15
jne 0x56fe
jmp 0x5757
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeb5d(%rip), %rdi      # 0x142cc
leaq 0xf326(%rip), %rsi      # 0x14a9c
leaq 0xf0ac(%rip), %rcx      # 0x14829
movl $0x40a, %edx            # imm = 0x40A
jmp 0x579e
leaq 0xeb41(%rip), %rdi      # 0x142cc
leaq 0xf329(%rip), %rsi      # 0x14abb
leaq 0xf090(%rip), %rcx      # 0x14829
movl $0x40b, %edx            # imm = 0x40B
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/pbuf.c
// Function: pbuf_get_contiguous
void *
pbuf_get_contiguous(const struct pbuf *p, void *buffer, size_t bufsize, u16_t len, u16_t offset)
{
  const struct pbuf *q;
  u16_t out_offset;

  LWIP_ERROR("pbuf_get_contiguous: invalid buf", (p != NULL), return NULL;);
  LWIP_ERROR("pbuf_get_contiguous: invalid dataptr", (buffer != NULL), return NULL;);
  LWIP_ERROR("pbuf_get_contiguous: invalid dataptr", (bufsize >= len), return NULL;);

  q = pbuf_skip_const(p, offset, &out_offset);
  if (q != NULL) {
    if (q->len >= (out_offset + len)) {
      /* all data in this pbuf, return zero-copy */
      return (u8_t *)q->payload + out_offset;
    }
    /* need to copy */
    if (pbuf_copy_partial(q, buffer, len, out_offset) != len) {
      /* copying failed: pbuf is too short */
      return NULL;
    }
    return buffer;
  }
  /* pbuf is too short (offset does not fit in) */
  return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x581b
movq %rsi, %rbx
testq %rsi, %rsi
je 0x5837
movzwl %cx, %r14d
cmpq %rdx, %r14
ja 0x5853
xorl %eax, %eax
movzwl 0x12(%rdi), %ecx
cmpw %cx, %r8w
jb 0x57e8
subl %ecx, %r8d
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x57d1
jmp 0x5813
movzwl %r8w, %eax
leal (%rax,%r14), %edx
cmpl %ecx, %edx
jbe 0x580f
movq %rbx, %rsi
movl %r14d, %edx
movl %eax, %ecx
callq 0x56cf
movl %eax, %ecx
xorl %eax, %eax
cmpw %r14w, %cx
cmoveq %rbx, %rax
jmp 0x5813
addq 0x8(%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xeaaa(%rip), %rdi      # 0x142cc
leaq 0xf2b5(%rip), %rsi      # 0x14ade
leaq 0xeff9(%rip), %rcx      # 0x14829
movl $0x437, %edx            # imm = 0x437
jmp 0x586d
leaq 0xea8e(%rip), %rdi      # 0x142cc
leaq 0xf2ba(%rip), %rsi      # 0x14aff
leaq 0xefdd(%rip), %rcx      # 0x14829
movl $0x438, %edx            # imm = 0x438
jmp 0x586d
leaq 0xea72(%rip), %rdi      # 0x142cc
leaq 0xf29e(%rip), %rsi      # 0x14aff
leaq 0xefc1(%rip), %rcx      # 0x14829
movl $0x439, %edx            # imm = 0x439
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/pbuf.c
// Function: pbuf_skip
static const struct pbuf *
pbuf_skip_const(const struct pbuf *in, u16_t in_offset, u16_t *out_offset)
{
  u16_t offset_left = in_offset;
  const struct pbuf *q = in;

  /* get the correct pbuf */
  while ((q != NULL) && (q->len <= offset_left)) {
    offset_left = (u16_t)(offset_left - q->len);
    q = q->next;
  }
  if (out_offset != NULL) {
    *out_offset = offset_left;
  }
  return q;
}

// Assembly:
testq %rdi, %rdi
je 0x589b
movq %rdi, %rax
movzwl 0x12(%rax), %ecx
cmpw %cx, %si
jb 0x589d
subl %ecx, %esi
movq (%rax), %rax
testq %rax, %rax
jne 0x5888
xorl %eax, %eax
testq %rdx, %rdx
je 0x58a5
movw %si, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_take
err_t
pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len)
{
  struct pbuf *p;
  size_t buf_copy_len;
  size_t total_copy_len = len;
  size_t copied_total = 0;

  LWIP_ERROR("pbuf_take: invalid buf", (buf != NULL), return ERR_ARG;);
  LWIP_ERROR("pbuf_take: invalid dataptr", (dataptr != NULL), return ERR_ARG;);
  LWIP_ERROR("pbuf_take: buf not large enough", (buf->tot_len >= len), return ERR_MEM;);

  if ((buf == NULL) || (dataptr == NULL) || (buf->tot_len < len)) {
    return ERR_ARG;
  }

  /* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
  for (p = buf; total_copy_len != 0; p = p->next) {
    LWIP_ASSERT("pbuf_take: invalid pbuf", p != NULL);
    buf_copy_len = total_copy_len;
    if (buf_copy_len > p->len) {
      /* this pbuf cannot hold all remaining data */
      buf_copy_len = p->len;
    }
    /* copy the necessary parts of the buffer */
    MEMCPY(p->payload, &((const char *)dataptr)[copied_total], buf_copy_len);
    total_copy_len -= buf_copy_len;
    copied_total += buf_copy_len;
  }
  LWIP_ASSERT("did not copy all data", total_copy_len == 0 && copied_total == len);
  return ERR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5954
movq %rsi, %rbx
testq %rsi, %rsi
je 0x5970
movq %rdi, %r14
cmpw %dx, 0x10(%rdi)
jb 0x598c
movl %edx, %r12d
xorl %r13d, %r13d
testw %dx, %dx
je 0x590d
movq %r12, %rbp
testq %r14, %r14
je 0x5927
movzwl 0x12(%r14), %r15d
cmpq %r15, %rbp
cmovbq %rbp, %r15
movq 0x8(%r14), %rdi
leaq (%rbx,%r13), %rsi
movq %r15, %rdx
callq 0x2180
addq %r15, %r13
movq (%r14), %r14
subq %r15, %rbp
jne 0x58e1
cmpq %r12, %r13
jne 0x59a8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xe99e(%rip), %rdi      # 0x142cc
leaq 0xf241(%rip), %rsi      # 0x14b76
leaq 0xeeed(%rip), %rcx      # 0x14829
movl $0x4bd, %edx            # imm = 0x4BD
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xe971(%rip), %rdi      # 0x142cc
leaq 0xf1c2(%rip), %rsi      # 0x14b24
leaq 0xeec0(%rip), %rcx      # 0x14829
movl $0x4b3, %edx            # imm = 0x4B3
jmp 0x5941
leaq 0xe955(%rip), %rdi      # 0x142cc
leaq 0xf1bd(%rip), %rsi      # 0x14b3b
leaq 0xeea4(%rip), %rcx      # 0x14829
movl $0x4b4, %edx            # imm = 0x4B4
jmp 0x5941
leaq 0xe939(%rip), %rdi      # 0x142cc
leaq 0xf1bc(%rip), %rsi      # 0x14b56
leaq 0xee88(%rip), %rcx      # 0x14829
movl $0x4b5, %edx            # imm = 0x4B5
jmp 0x5941
leaq 0xe91d(%rip), %rdi      # 0x142cc
leaq 0xf1d8(%rip), %rsi      # 0x14b8e
leaq 0xee6c(%rip), %rcx      # 0x14829
movl $0x4c8, %edx            # imm = 0x4C8
jmp 0x5941
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_take_at
err_t
pbuf_take_at(struct pbuf *buf, const void *dataptr, u16_t len, u16_t offset)
{
  u16_t target_offset;
  struct pbuf *q = pbuf_skip(buf, offset, &target_offset);

  /* return requested data if pbuf is OK */
  if ((q != NULL) && (q->tot_len >= target_offset + len)) {
    u16_t remaining_len = len;
    const u8_t *src_ptr = (const u8_t *)dataptr;
    /* copy the part that goes into the first pbuf */
    u16_t first_copy_len;
    LWIP_ASSERT("check pbuf_skip result", target_offset < q->len);
    first_copy_len = (u16_t)LWIP_MIN(q->len - target_offset, len);
    MEMCPY(((u8_t *)q->payload) + target_offset, dataptr, first_copy_len);
    remaining_len = (u16_t)(remaining_len - first_copy_len);
    src_ptr += first_copy_len;
    if (remaining_len > 0) {
      return pbuf_take(q->next, src_ptr, remaining_len);
    }
    return ERR_OK;
  }
  return ERR_MEM;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movb $-0x1, %al
testq %rdi, %rdi
je 0x5a2c
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x12(%r14), %edx
cmpw %dx, %cx
jb 0x59f4
subl %edx, %ecx
movq (%r14), %r14
testq %r14, %r14
jne 0x59de
jmp 0x5a2c
movzwl 0x10(%r14), %esi
movzwl %cx, %edi
movzwl %bp, %r12d
leal (%rdi,%r12), %ecx
cmpl %esi, %ecx
ja 0x5a2c
subl %edi, %edx
cmpl %r12d, %edx
cmovgel %r12d, %edx
addq 0x8(%r14), %rdi
movzwl %dx, %r15d
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2180
cmpw %r12w, %r15w
jne 0x5a35
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
subl %r15d, %ebp
addq %r15, %rbx
movq (%r14), %rdi
movzwl %bp, %edx
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x58a6
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_coalesce
struct pbuf *
pbuf_coalesce(struct pbuf *p, pbuf_layer layer)
{
  struct pbuf *q;
  if (p->next == NULL) {
    return p;
  }
  q = pbuf_clone(layer, PBUF_RAM, p);
  if (q == NULL) {
    /* @todo: what do we do now? */
    return p;
  }
  pbuf_free(p);
  return q;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x5a80
movl %esi, %edi
movl $0x280, %esi            # imm = 0x280
movq %rbx, %rdx
callq 0x5a8b
testq %rax, %rax
je 0x5a80
movq %rax, %r14
movq %rbx, %rdi
callq 0x4fdf
movq %r14, %rbx
movq %rbx, %rax
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/pbuf.c
// Function: pbuf_fill_chksum
err_t
pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr,
                 u16_t len, u16_t *chksum)
{
  u32_t acc;
  u16_t copy_chksum;
  char *dst_ptr;
  LWIP_ASSERT("p != NULL", p != NULL);
  LWIP_ASSERT("dataptr != NULL", dataptr != NULL);
  LWIP_ASSERT("chksum != NULL", chksum != NULL);
  LWIP_ASSERT("len != 0", len != 0);

  if ((start_offset >= p->len) || (start_offset + len > p->len)) {
    return ERR_ARG;
  }

  dst_ptr = ((char *)p->payload) + start_offset;
  copy_chksum = LWIP_CHKSUM_COPY(dst_ptr, dataptr, len);
  if ((start_offset & 1) != 0) {
    copy_chksum = SWAP_BYTES_IN_WORD(copy_chksum);
  }
  acc = *chksum;
  acc += copy_chksum;
  *chksum = FOLD_U32T(acc);
  return ERR_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x5b39
testq %rdx, %rdx
je 0x5b55
movq %r8, %rbx
testq %r8, %r8
je 0x5b71
testw %cx, %cx
je 0x5b8d
movzwl 0x12(%rdi), %r8d
movb $-0x10, %al
cmpw %si, %r8w
jbe 0x5b31
movzwl %cx, %ecx
movzwl %si, %r14d
leal (%rcx,%r14), %esi
cmpl %r8d, %esi
ja 0x5b31
movq 0x8(%rdi), %rdi
addq %r14, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x13c65
movl %eax, %ecx
rolw $0x8, %cx
testb $0x1, %r14b
cmovel %eax, %ecx
movzwl (%rbx), %eax
movzwl %cx, %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
addl %ecx, %eax
movw %ax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xe78c(%rip), %rdi      # 0x142cc
leaq 0xed6c(%rip), %rsi      # 0x148b3
leaq 0xecdb(%rip), %rcx      # 0x14829
movl $0x53c, %edx            # imm = 0x53C
jmp 0x5ba7
leaq 0xe770(%rip), %rdi      # 0x142cc
leaq 0xf041(%rip), %rsi      # 0x14ba4
leaq 0xecbf(%rip), %rcx      # 0x14829
movl $0x53d, %edx            # imm = 0x53D
jmp 0x5ba7
leaq 0xe754(%rip), %rdi      # 0x142cc
leaq 0xf035(%rip), %rsi      # 0x14bb4
leaq 0xeca3(%rip), %rcx      # 0x14829
movl $0x53e, %edx            # imm = 0x53E
jmp 0x5ba7
leaq 0xe738(%rip), %rdi      # 0x142cc
leaq 0xf028(%rip), %rsi      # 0x14bc3
leaq 0xec87(%rip), %rcx      # 0x14829
movl $0x53f, %edx            # imm = 0x53F
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/pbuf.c
// Function: pbuf_try_get_at
int
pbuf_try_get_at(const struct pbuf *p, u16_t offset)
{
  u16_t q_idx;
  const struct pbuf *q = pbuf_skip_const(p, offset, &q_idx);

  /* return requested data if pbuf is OK */
  if ((q != NULL) && (q->len > q_idx)) {
    return ((u8_t *)q->payload)[q_idx];
  }
  return -1;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x5c02
movzwl 0x12(%rdi), %ecx
cmpw %cx, %si
jb 0x5bf7
subl %ecx, %esi
movq (%rdi), %rdi
jmp 0x5be2
movq 0x8(%rdi), %rax
movzwl %si, %ecx
movzbl (%rax,%rcx), %eax
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_memcmp
u16_t
pbuf_memcmp(const struct pbuf *p, u16_t offset, const void *s2, u16_t n)
{
  u16_t start = offset;
  const struct pbuf *q = p;
  u16_t i;

  /* pbuf long enough to perform check? */
  if (p->tot_len < (offset + n)) {
    return 0xffff;
  }

  /* get the correct pbuf from chain. We know it succeeds because of p->tot_len check above. */
  while ((q != NULL) && (q->len <= start)) {
    start = (u16_t)(start - q->len);
    q = q->next;
  }

  /* return requested data if pbuf is OK */
  for (i = 0; i < n; i++) {
    /* We know pbuf_get_at() succeeds because of p->tot_len check above. */
    u8_t a = pbuf_get_at(q, (u16_t)(start + i));
    u8_t b = ((const u8_t *)s2)[i];
    if (a != b) {
      return (u16_t)LWIP_MIN(i + 1, 0xFFFF);
    }
  }
  return 0;
}

// Assembly:
movzwl 0x10(%rdi), %r8d
leal (%rcx,%rsi), %r9d
movw $0xffff, %ax            # imm = 0xFFFF
cmpl %r8d, %r9d
ja 0x5cbb
pushq %rbx
movl %esi, %eax
movzwl 0x12(%rdi), %r8d
cmpw %r8w, %si
jb 0x5c58
movl %eax, %esi
subl %r8d, %esi
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x5c3a
xorl %edi, %edi
jmp 0x5c5a
movl %eax, %esi
testw %cx, %cx
je 0x5ca9
xorl %r9d, %r9d
cmpw %r8w, %ax
jae 0x5c85
leal (%r9,%rsi), %r10d
movq %rdi, %r11
movzwl 0x12(%r11), %ebx
cmpw %bx, %r10w
jb 0x5c8a
subl %ebx, %r10d
movq (%r11), %r11
testq %r11, %r11
jne 0x5c6f
xorl %r10d, %r10d
jmp 0x5c96
movq 0x8(%r11), %r11
movzwl %r10w, %r10d
movb (%r11,%r10), %r10b
movzwl %r9w, %r11d
cmpb (%rdx,%r11), %r10b
jne 0x5cad
incl %r9d
cmpw %cx, %r9w
jne 0x5c62
xorl %eax, %eax
jmp 0x5cba
incw %r9w
movl $0xffff, %eax           # imm = 0xFFFF
cmovnel %r9d, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/pbuf.c
// Function: pbuf_memfind
u16_t
pbuf_memfind(const struct pbuf *p, const void *mem, u16_t mem_len, u16_t start_offset)
{
  u16_t i;
  u16_t max_cmp_start = (u16_t)(p->tot_len - mem_len);
  if (p->tot_len >= mem_len + start_offset) {
    for (i = start_offset; i <= max_cmp_start; i++) {
      u16_t plus = pbuf_memcmp(p, i, mem, mem_len);
      if (plus == 0) {
        return i;
      }
    }
  }
  return 0xFFFF;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movzwl 0x10(%rdi), %eax
movl %eax, %r13d
subl %edx, %r13d
addl %edx, %ecx
cmpl %eax, %ecx
seta %al
cmpw %bx, %r13w
setb %cl
orb %al, %cl
movw $0xffff, %bp            # imm = 0xFFFF
jne 0x5d15
movq %rsi, %r14
movq %rdi, %r15
movzwl %dx, %r12d
movzwl %bx, %esi
movq %r15, %rdi
movq %r14, %rdx
movl %r12d, %ecx
callq 0x5c23
testw %ax, %ax
je 0x5d13
incl %ebx
cmpw %r13w, %bx
jbe 0x5cf3
jmp 0x5d15
movl %ebx, %ebp
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/pbuf.c
// Function: pbuf_strstr
u16_t
pbuf_strstr(const struct pbuf *p, const char *substr)
{
  size_t substr_len;
  if ((substr == NULL) || (substr[0] == 0) || (p->tot_len == 0xFFFF)) {
    return 0xFFFF;
  }
  substr_len = strlen(substr);
  if (substr_len >= 0xFFFF) {
    return 0xFFFF;
  }
  return pbuf_memfind(p, substr, (u16_t)substr_len, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x5d51
movq %rsi, %rbx
cmpb $0x0, (%rsi)
je 0x5d51
movq %rdi, %r14
cmpw $-0x1, 0x10(%rdi)
je 0x5d51
movq %rbx, %rdi
callq 0x20c0
cmpq $0xfffe, %rax           # imm = 0xFFFE
jbe 0x5d5d
movw $0xffff, %ax            # imm = 0xFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movzwl %ax, %edx
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5cbc
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/raw.c
// Function: raw_bind
err_t
raw_bind(struct raw_pcb *pcb, const ip_addr_t *ipaddr)
{
  LWIP_ASSERT_CORE_LOCKED();
  if ((pcb == NULL) || (ipaddr == NULL)) {
    return ERR_VAL;
  }
  ip_addr_set_ipaddr(&pcb->local_ip, ipaddr);
#if LWIP_IPV6 && LWIP_IPV6_SCOPES
  /* If the given IP address should have a zone but doesn't, assign one now.
   * This is legacy support: scope-aware callers should always provide properly
   * zoned source addresses. */
  if (IP_IS_V6(&pcb->local_ip) &&
      ip6_addr_lacks_zone(ip_2_ip6(&pcb->local_ip), IP6_UNKNOWN)) {
    ip6_addr_select_zone(ip_2_ip6(&pcb->local_ip), ip_2_ip6(&pcb->local_ip));
  }
#endif /* LWIP_IPV6 && LWIP_IPV6_SCOPES */
  return ERR_OK;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movb $-0x6, %al
jne 0x609d
pushq %rbx
movq %rdi, %rbx
movb 0x14(%rsi), %cl
movb %cl, 0x14(%rdi)
movl (%rsi), %eax
movl %eax, (%rdi)
cmpb $0x6, %cl
jne 0x608f
movl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rbx)
movl 0x8(%rsi), %ecx
movl %ecx, 0x8(%rbx)
movl 0xc(%rsi), %ecx
movl %ecx, 0xc(%rbx)
movb 0x10(%rsi), %cl
movb %cl, 0x10(%rbx)
testb %cl, %cl
jne 0x608b
movl %eax, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
cmpl $0x80fe, %ecx           # imm = 0x80FE
je 0x6048
andl $0x8fff, %eax           # imm = 0x8FFF
cmpl $0x2ff, %eax            # imm = 0x2FF
je 0x6048
cmpl $0x1ff, %eax            # imm = 0x1FF
jne 0x608b
movq %rbx, %rdi
movq %rbx, %rsi
callq 0xf744
testq %rax, %rax
je 0x608b
movl (%rbx), %ecx
movl %ecx, %edx
andl $0xc0ff, %edx           # imm = 0xC0FF
cmpl $0x80fe, %edx           # imm = 0x80FE
je 0x6080
andl $0x8fff, %ecx           # imm = 0x8FFF
cmpl $0x2ff, %ecx            # imm = 0x2FF
je 0x6080
cmpl $0x1ff, %ecx            # imm = 0x1FF
jne 0x609e
movb 0xee(%rax), %al
incb %al
movb %al, 0x10(%rbx)
xorl %eax, %eax
jmp 0x609c
addq $0x4, %rbx
xorl %eax, %eax
movq %rax, 0x5(%rbx)
movq %rax, (%rbx)
popq %rbx
retq
xorl %eax, %eax
jmp 0x6088
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/raw.c
// Function: raw_connect
err_t
raw_connect(struct raw_pcb *pcb, const ip_addr_t *ipaddr)
{
  LWIP_ASSERT_CORE_LOCKED();
  if ((pcb == NULL) || (ipaddr == NULL)) {
    return ERR_VAL;
  }
  ip_addr_set_ipaddr(&pcb->remote_ip, ipaddr);
#if LWIP_IPV6 && LWIP_IPV6_SCOPES
  /* If the given IP address should have a zone but doesn't, assign one now,
   * using the bound address to make a more informed decision when possible. */
  if (IP_IS_V6(&pcb->remote_ip) &&
      ip6_addr_lacks_zone(ip_2_ip6(&pcb->remote_ip), IP6_UNKNOWN)) {
    ip6_addr_select_zone(ip_2_ip6(&pcb->remote_ip), ip_2_ip6(&pcb->local_ip));
  }
#endif /* LWIP_IPV6 && LWIP_IPV6_SCOPES */
  raw_set_flags(pcb, RAW_FLAGS_CONNECTED);
  return ERR_OK;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movb $-0x6, %al
jne 0x618b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x14(%rsi), %cl
movb %cl, 0x2c(%rdi)
movl (%rsi), %eax
movl %eax, 0x18(%rdi)
cmpb $0x6, %cl
jne 0x6171
movl 0x4(%rsi), %ecx
movl %ecx, 0x1c(%rbx)
movl 0x8(%rsi), %ecx
movl %ecx, 0x20(%rbx)
movl 0xc(%rsi), %ecx
movl %ecx, 0x24(%rbx)
movb 0x10(%rsi), %cl
movb %cl, 0x28(%rbx)
testb %cl, %cl
jne 0x617e
movl %eax, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
cmpl $0x80fe, %ecx           # imm = 0x80FE
je 0x6127
andl $0x8fff, %eax           # imm = 0x8FFF
cmpl $0x2ff, %eax            # imm = 0x2FF
je 0x6127
cmpl $0x1ff, %eax            # imm = 0x1FF
jne 0x617e
leaq 0x18(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf744
testq %rax, %rax
je 0x617e
movl (%r14), %ecx
movl %ecx, %edx
andl $0xc0ff, %edx           # imm = 0xC0FF
cmpl $0x80fe, %edx           # imm = 0x80FE
je 0x6164
andl $0x8fff, %ecx           # imm = 0x8FFF
cmpl $0x2ff, %ecx            # imm = 0x2FF
je 0x6164
cmpl $0x1ff, %ecx            # imm = 0x1FF
jne 0x618c
movb 0xee(%rax), %al
incb %al
movb %al, 0x28(%rbx)
jmp 0x617e
leaq 0x1c(%rbx), %rax
xorl %ecx, %ecx
movq %rcx, 0x5(%rax)
movq %rcx, (%rax)
orb $0x1, 0x41(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x616c
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/raw.c
// Function: raw_sendto
err_t
raw_sendto(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr)
{
  struct netif *netif;
  const ip_addr_t *src_ip;

  if ((pcb == NULL) || (ipaddr == NULL) || !IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr)) {
    return ERR_VAL;
  }

  LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_sendto\n"));

  if (pcb->netif_idx != NETIF_NO_INDEX) {
    netif = netif_get_by_index(pcb->netif_idx);
  } else {
#if LWIP_MULTICAST_TX_OPTIONS
    netif = NULL;
    if (ip_addr_ismulticast(ipaddr)) {
      /* For multicast-destined packets, use the user-provided interface index to
       * determine the outgoing interface, if an interface index is set and a
       * matching netif can be found. Otherwise, fall back to regular routing. */
      netif = netif_get_by_index(pcb->mcast_ifindex);
    }

    if (netif == NULL)
#endif /* LWIP_MULTICAST_TX_OPTIONS */
    {
      netif = ip_route(&pcb->local_ip, ipaddr);
    }
  }

  if (netif == NULL) {
    LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: No route to "));
    ip_addr_debug_print(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ipaddr);
    return ERR_RTE;
  }

  if (ip_addr_isany(&pcb->local_ip) || ip_addr_ismulticast(&pcb->local_ip)) {
    /* use outgoing network interface IP address as source address */
    src_ip = ip_netif_get_local_ip(netif, ipaddr);
#if LWIP_IPV6
    if (src_ip == NULL) {
      return ERR_RTE;
    }
#endif /* LWIP_IPV6 */
  } else {
    /* use RAW PCB local IP address as source address */
    src_ip = &pcb->local_ip;
  }

  return raw_sendto_if_src(pcb, p, ipaddr, netif, src_ip);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rdx, %rdx
sete %cl
orb %al, %cl
movb $-0x6, %bpl
jne 0x62be
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movb 0x14(%rdi), %al
cmpb $0x2e, %al
je 0x623d
cmpb 0x14(%rbx), %al
jne 0x62be
movb 0x30(%r15), %al
testb %al, %al
je 0x624f
movzbl %al, %edi
callq 0x4d9d
jmp 0x626a
cmpb $0x6, 0x14(%rbx)
jne 0x6262
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf744
jmp 0x626a
movq %rbx, %rdi
callq 0xe120
movq %rax, %r12
movb $-0x4, %bpl
testq %rax, %rax
je 0x62be
cmpb $0x6, 0x14(%r15)
movl (%r15), %eax
jne 0x628c
testl %eax, %eax
je 0x62d0
movq %r15, %r8
cmpb $-0x1, %al
je 0x62a5
jmp 0x62ee
testl %eax, %eax
sete %cl
andl $0xf0, %eax
cmpl $0xe0, %eax
sete %al
orb %cl, %al
movq %r15, %r8
je 0x62ee
cmpb $0x6, 0x14(%rbx)
jne 0x62c9
movq %r12, %rdi
movq %rbx, %rsi
callq 0xf74f
movq %rax, %r8
testq %rax, %rax
jne 0x62ee
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%r12), %r8
jmp 0x62ee
cmpl $0x0, 0x4(%r15)
movq %r15, %r8
jne 0x62ee
cmpl $0x0, 0x8(%r15)
movq %r15, %r8
jne 0x62ee
cmpl $0x0, 0xc(%r15)
movq %r15, %r8
je 0x62a5
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6307
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/raw.c
// Function: raw_remove
void
raw_remove(struct raw_pcb *pcb)
{
  struct raw_pcb *pcb2;
  LWIP_ASSERT_CORE_LOCKED();
  /* pcb to be removed is first in list? */
  if (raw_pcbs == pcb) {
    /* make list start at 2nd pcb */
    raw_pcbs = raw_pcbs->next;
    /* pcb not 1st in list */
  } else {
    for (pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
      /* find pcb in raw_pcbs list */
      if (pcb2->next != NULL && pcb2->next == pcb) {
        /* remove pcb from list */
        pcb2->next = pcb->next;
        break;
      }
    }
  }
  memp_free(MEMP_RAW_PCB, pcb);
}

// Assembly:
movq %rdi, %rsi
movq 0x16367(%rip), %rcx     # 0x1c8f0
cmpq %rdi, %rcx
je 0x65b5
testq %rcx, %rcx
je 0x65c3
movq %rcx, %rax
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
sete %dl
cmpq %rsi, %rcx
setne %dil
orb %dl, %dil
jne 0x658e
addq $0x38, %rax
movq %rsi, %rcx
jmp 0x65bc
leaq 0x16334(%rip), %rax     # 0x1c8f0
movq 0x38(%rcx), %rcx
movq %rcx, (%rax)
xorl %edi, %edi
jmp 0x3cf8
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/raw.c
// Function: raw_new_ip_type
struct raw_pcb *
raw_new_ip_type(u8_t type, u8_t proto)
{
  struct raw_pcb *pcb;
  LWIP_ASSERT_CORE_LOCKED();
  pcb = raw_new(proto);
#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_IPV4 && LWIP_IPV6 */
  LWIP_UNUSED_ARG(type);
#endif /* LWIP_IPV4 && LWIP_IPV6 */
  return pcb;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
xorl %edi, %edi
callq 0x3c6e
testq %rax, %rax
je 0x665b
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movb %bpl, 0x40(%rax)
movb $0x40, 0x33(%rax)
movq 0x162a6(%rip), %rcx     # 0x1c8f0
movq %rcx, 0x38(%rax)
movq %rax, 0x1629b(%rip)     # 0x1c8f0
movb %bl, 0x14(%rax)
movb %bl, 0x2c(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/raw.c
// Function: raw_netif_ip_addr_changed
void raw_netif_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr)
{
  struct raw_pcb *rpcb;

  if (!ip_addr_isany(old_addr) && !ip_addr_isany(new_addr)) {
    for (rpcb = raw_pcbs; rpcb != NULL; rpcb = rpcb->next) {
      /* PCB bound to current local interface address? */
      if (ip_addr_cmp(&rpcb->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(rpcb->local_ip, *new_addr);
      }
    }
  }
}

// Assembly:
testq %rdi, %rdi
je 0x6758
cmpb $0x6, 0x14(%rdi)
movl (%rdi), %eax
jne 0x6691
testl %eax, %eax
jne 0x6687
cmpl $0x0, 0x4(%rdi)
jne 0x6687
cmpl $0x0, 0x8(%rdi)
je 0x6759
testq %rsi, %rsi
jne 0x66a4
jmp 0x6758
testl %eax, %eax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6758
cmpb $0x6, 0x14(%rsi)
movl (%rsi), %eax
jne 0x66c7
testl %eax, %eax
jne 0x66cf
cmpl $0x0, 0x4(%rsi)
jne 0x66cf
cmpl $0x0, 0x8(%rsi)
jne 0x66cf
cmpl $0x0, 0xc(%rsi)
jne 0x66cf
jmp 0x6758
testl %eax, %eax
je 0x6758
movq 0x1621a(%rip), %rax     # 0x1c8f0
testq %rax, %rax
je 0x6758
xorl %ecx, %ecx
movb 0x14(%rax), %dl
cmpb 0x14(%rdi), %dl
jne 0x674f
movl (%rax), %r8d
movl (%rdi), %r9d
cmpb $0x6, %dl
jne 0x6717
cmpl %r9d, %r8d
jne 0x674f
movl 0x4(%rax), %edx
cmpl 0x4(%rdi), %edx
jne 0x674f
movl 0x8(%rax), %edx
cmpl 0x8(%rdi), %edx
jne 0x674f
movl 0xc(%rax), %edx
cmpl 0xc(%rdi), %edx
jne 0x674f
movb 0x10(%rax), %dl
cmpb 0x10(%rdi), %dl
je 0x671c
jmp 0x674f
cmpl %r9d, %r8d
jne 0x674f
movb 0x14(%rsi), %dl
movb %dl, 0x14(%rax)
movl (%rsi), %r8d
movl %r8d, (%rax)
cmpb $0x6, %dl
jne 0x6747
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 0x674f
movq %rcx, 0x9(%rax)
movq %rcx, 0x4(%rax)
movq 0x38(%rax), %rax
testq %rax, %rax
jne 0x66dd
retq
testq %rsi, %rsi
je 0x6758
cmpl $0x0, 0xc(%rdi)
jne 0x66a4
jmp 0x6758
nop
// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_fasttmr
void
tcp_fasttmr(void)
{
  struct tcp_pcb *pcb;

  ++tcp_timer_ctr;

tcp_fasttmr_start:
  pcb = tcp_active_pcbs;

  while (pcb != NULL) {
    if (pcb->last_timer != tcp_timer_ctr) {
      struct tcp_pcb *next;
      pcb->last_timer = tcp_timer_ctr;
      /* send delayed ACKs */
      if (pcb->flags & TF_ACK_DELAY) {
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
        tcp_ack_now(pcb);
        tcp_output(pcb);
        tcp_clear_flags(pcb, TF_ACK_DELAY | TF_ACK_NOW);
      }
      /* send pending FIN */
      if (pcb->flags & TF_CLOSEPEND) {
        LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: pending FIN\n"));
        tcp_clear_flags(pcb, TF_CLOSEPEND);
        tcp_close_shutdown_fin(pcb);
      }

      next = pcb->next;

      /* If there is data which was previously "refused" by upper layer */
      if (pcb->refused_data != NULL) {
        tcp_active_pcbs_changed = 0;
        tcp_process_refused_data(pcb);
        if (tcp_active_pcbs_changed) {
          /* application callback has changed the pcb list: restart the loop */
          goto tcp_fasttmr_start;
        }
      }
      pcb = next;
    } else {
      pcb = pcb->next;
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
incb 0x16134(%rip)           # 0x1c920
movq 0x16115(%rip), %rbx     # 0x1c908
testq %rbx, %rbx
je 0x6871
movb 0x16122(%rip), %al      # 0x1c920
cmpb %al, 0x56(%rbx)
jne 0x6809
movq 0x38(%rbx), %r14
jmp 0x6869
movb %al, 0x56(%rbx)
movzwl 0x52(%rbx), %eax
testb $0x1, %al
je 0x682e
orl $0x2, %eax
movw %ax, 0x52(%rbx)
movq %rbx, %rdi
callq 0xbd02
movzwl 0x52(%rbx), %eax
andl $-0x4, %eax
movw %ax, 0x52(%rbx)
testb $0x8, %al
je 0x6843
andl $0xfff7, %eax           # imm = 0xFFF7
movw %ax, 0x52(%rbx)
movq %rbx, %rdi
callq 0x7fa5
movq 0x38(%rbx), %r14
cmpq $0x0, 0xc0(%rbx)
je 0x6869
movb $0x0, 0x160c1(%rip)     # 0x1c919
movq %rbx, %rdi
callq 0x7ff8
cmpb $0x0, 0x160b2(%rip)     # 0x1c919
jne 0x67ec
movq %r14, %rbx
testq %r14, %r14
jne 0x67f8
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/tcp.c
// Function: tcp_close
err_t
tcp_close(struct tcp_pcb *pcb)
{
  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ERROR("tcp_close: invalid pcb", pcb != NULL, return ERR_ARG);
  LWIP_DEBUGF(TCP_DEBUG, ("tcp_close: closing in "));

  tcp_debug_print_state(pcb->state);

  if (pcb->state != LISTEN) {
    /* Set a flag not to receive any more data... */
    tcp_set_flags(pcb, TF_RXCLOSED);
  }
  /* ... and close */
  return tcp_close_shutdown(pcb, 1);
}

// Assembly:
testq %rdi, %rdi
je 0x6e8d
cmpl $0x1, 0x48(%rdi)
je 0x6e86
orb $0x10, 0x52(%rdi)
movl $0x1, %esi
jmp 0x6ebc
pushq %rax
leaq 0xd437(%rip), %rdi      # 0x142cc
leaq 0xde06(%rip), %rsi      # 0x14ca2
leaq 0xdde5(%rip), %rcx      # 0x14c88
movl $0x1e8, %edx            # imm = 0x1E8
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050