LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x4de9
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
pushq $0xa
popq %rdi
callq 0x3b4a
testq %rax, %rax
je 0x4de4
andq $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 0xf4dc(%rip), %rdi      # 0x142cc
leaq 0xfa9c(%rip), %rsi      # 0x14893
leaq 0xfa2b(%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_O2/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 0x510e
movb $0x1, %al
cmpq $0xffff, %rsi           # imm = 0xFFFF
ja 0x510c
testq %rsi, %rsi
je 0x510a
movzwl 0x12(%rdi), %eax
cmpq %rsi, %rax
jb 0x512a
addq %rsi, 0x8(%rdi)
subl %esi, %eax
movw %ax, 0x12(%rdi)
subw %si, 0x10(%rdi)
xorl %eax, %eax
popq %rcx
retq
leaq 0xf1b7(%rip), %rdi      # 0x142cc
leaq 0xf797(%rip), %rsi      # 0x148b3
leaq 0xf706(%rip), %rcx      # 0x14829
movl $0x24b, %edx            # imm = 0x24B
jmp 0x5144
leaq 0xf19b(%rip), %rdi      # 0x142cc
leaq 0xf7b9(%rip), %rsi      # 0x148f1
leaq 0xf6ea(%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_O2/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 0x516b
movzwl %si, %esi
movzbl %dl, %edx
jmp 0x5050
movswq %si, %rsi
negq %rsi
jmp 0x50dd
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
testw %bp, %bp
je 0x51bd
testq %rbx, %rbx
je 0x51bd
movzwl 0x12(%rbx), %eax
cmpw %ax, %bp
jae 0x51a7
movzwl %bp, %esi
movq %rbx, %rdi
callq 0x50dd
xorl %ebp, %ebp
jmp 0x5185
subl %eax, %ebp
movq (%rbx), %r14
andq $0x0, (%rbx)
movq %rbx, %rdi
callq 0x4e16
movq %r14, %rbx
jmp 0x5185
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x51de
incb 0x16(%rdi)
je 0x51df
retq
pushq %rax
leaq 0xf0e5(%rip), %rdi      # 0x142cc
leaq 0xf76a(%rip), %rsi      # 0x14958
leaq 0xf634(%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_O2/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 0x5218
testq %rsi, %rsi
jne 0x523f
leaq 0xf0ad(%rip), %rdi      # 0x142cc
leaq 0xf744(%rip), %rsi      # 0x1496a
leaq 0xf5fc(%rip), %rcx      # 0x14829
movl $0x35a, %edx            # imm = 0x35A
jmp 0x5278
addw 0x10(%rsi), %ax
movw %ax, 0x10(%rdi)
movq %rcx, %rdi
movq (%rdi), %rcx
movzwl 0x10(%rdi), %eax
testq %rcx, %rcx
jne 0x5234
cmpw 0x12(%rdi), %ax
jne 0x525e
addw 0x10(%rsi), %ax
movw %ax, 0x10(%rdi)
movq %rsi, (%rdi)
popq %rax
retq
leaq 0xf067(%rip), %rdi      # 0x142cc
leaq 0xf733(%rip), %rsi      # 0x1499f
leaq 0xf5b6(%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_O2/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 0x52d8
movzwl 0x10(%rbx), %ecx
movzwl 0x10(%r14), %edx
movzwl 0x12(%r14), %eax
subl %eax, %edx
cmpl %ecx, %edx
jne 0x5312
andq $0x0, (%r14)
movw %ax, 0x10(%r14)
movq %rbx, %rdi
callq 0x4e16
testb %al, %al
sete %cl
jmp 0x52da
xorl %ecx, %ecx
movzwl 0x10(%r14), %eax
cmpw 0x12(%r14), %ax
jne 0x52f6
xorl %eax, %eax
testb %cl, %cl
cmovneq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xefcf(%rip), %rdi      # 0x142cc
leaq 0xf6ea(%rip), %rsi      # 0x149ee
leaq 0xf51e(%rip), %rcx      # 0x14829
movl $0x3aa, %edx            # imm = 0x3AA
jmp 0x532c
leaq 0xefb3(%rip), %rdi      # 0x142cc
leaq 0xf6ac(%rip), %rsi      # 0x149cc
leaq 0xf502(%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_O2/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 0x5571
movq %rsi, %r14
testq %rsi, %rsi
je 0x558d
movl %edx, %ebx
movq %rdi, %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
testw %bx, %bx
je 0x5560
testq %r15, %r15
je 0x5560
testw %cx, %cx
sete %al
movzwl 0x12(%r15), %r13d
cmpw %r13w, %cx
setb %dl
orb %al, %dl
je 0x5558
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 0x555b
subl %r13d, %ecx
movq (%r15), %r15
jmp 0x5509
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xed54(%rip), %rdi      # 0x142cc
leaq 0xf51d(%rip), %rsi      # 0x14a9c
leaq 0xf2a3(%rip), %rcx      # 0x14829
movl $0x40a, %edx            # imm = 0x40A
jmp 0x55a7
leaq 0xed38(%rip), %rdi      # 0x142cc
leaq 0xf520(%rip), %rsi      # 0x14abb
leaq 0xf287(%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_O2/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 0x562c
movq %rsi, %rbx
testq %rsi, %rsi
je 0x5648
movzwl %cx, %r14d
cmpq %rdx, %r14
ja 0x5664
movzwl %r8w, %esi
leaq 0x6(%rsp), %rdx
callq 0x5691
testq %rax, %rax
je 0x5619
movzwl 0x12(%rax), %edx
movzwl 0x6(%rsp), %ecx
movl %ecx, %esi
addl %r14d, %esi
cmpl %edx, %esi
jbe 0x561d
movq %rax, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x54e3
movl %eax, %ecx
xorl %eax, %eax
cmpw %r14w, %cx
cmoveq %rbx, %rax
jmp 0x5624
xorl %eax, %eax
jmp 0x5624
movq 0x8(%rax), %rax
addq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xec99(%rip), %rdi      # 0x142cc
leaq 0xf4a4(%rip), %rsi      # 0x14ade
leaq 0xf1e8(%rip), %rcx      # 0x14829
movl $0x437, %edx            # imm = 0x437
jmp 0x567e
leaq 0xec7d(%rip), %rdi      # 0x142cc
leaq 0xf4a9(%rip), %rsi      # 0x14aff
leaq 0xf1cc(%rip), %rcx      # 0x14829
movl $0x438, %edx            # imm = 0x438
jmp 0x567e
leaq 0xec61(%rip), %rdi      # 0x142cc
leaq 0xf48d(%rip), %rsi      # 0x14aff
leaq 0xf1b0(%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_O2/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 0x5762
movq %rsi, %rbx
testq %rsi, %rsi
je 0x577e
movq %rdi, %r14
cmpw %dx, 0x10(%rdi)
jb 0x579a
movl %edx, %r12d
xorl %r13d, %r13d
movq %r12, %rbp
testq %rbp, %rbp
je 0x571b
testq %r14, %r14
je 0x5735
movzwl 0x12(%r14), %r15d
cmpq %r15, %rbp
cmovbq %rbp, %r15
movq 0x8(%r14), %rdi
leaq (%rbx,%r13), %rsi
movq %r15, %rdx
callq 0x2180
subq %r15, %rbp
addq %r15, %r13
movq (%r14), %r14
jmp 0x56ea
cmpq %r12, %r13
jne 0x57b6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xeb90(%rip), %rdi      # 0x142cc
leaq 0xf433(%rip), %rsi      # 0x14b76
leaq 0xf0df(%rip), %rcx      # 0x14829
movl $0x4bd, %edx            # imm = 0x4BD
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xeb63(%rip), %rdi      # 0x142cc
leaq 0xf3b4(%rip), %rsi      # 0x14b24
leaq 0xf0b2(%rip), %rcx      # 0x14829
movl $0x4b3, %edx            # imm = 0x4B3
jmp 0x574f
leaq 0xeb47(%rip), %rdi      # 0x142cc
leaq 0xf3af(%rip), %rsi      # 0x14b3b
leaq 0xf096(%rip), %rcx      # 0x14829
movl $0x4b4, %edx            # imm = 0x4B4
jmp 0x574f
leaq 0xeb2b(%rip), %rdi      # 0x142cc
leaq 0xf3ae(%rip), %rsi      # 0x14b56
leaq 0xf07a(%rip), %rcx      # 0x14829
movl $0x4b5, %edx            # imm = 0x4B5
jmp 0x574f
leaq 0xeb0f(%rip), %rdi      # 0x142cc
leaq 0xf3ca(%rip), %rsi      # 0x14b8e
leaq 0xf05e(%rip), %rcx      # 0x14829
movl $0x4c8, %edx            # imm = 0x4C8
jmp 0x574f
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %rbx
leaq 0xe(%rsp), %rdx
movl %ecx, %esi
callq 0x5691
movq %rax, %r14
movb $-0x1, %al
testq %r14, %r14
je 0x5858
movzwl 0x10(%r14), %edx
movzwl 0xe(%rsp), %ecx
movzwl %bp, %r12d
leal (%rcx,%r12), %esi
cmpl %edx, %esi
ja 0x5858
movzwl 0x12(%r14), %eax
cmpw %ax, %cx
jae 0x5865
subl %ecx, %eax
cmpl %r12d, %eax
cmovgel %r12d, %eax
movl %ecx, %edi
addq 0x8(%r14), %rdi
movzwl %ax, %r15d
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2180
cmpw %r12w, %r15w
jne 0x5844
xorl %eax, %eax
jmp 0x5858
subl %r15d, %ebp
addq %r15, %rbx
movq (%r14), %rdi
movzwl %bp, %edx
movq %rbx, %rsi
callq 0x56b4
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xea60(%rip), %rdi      # 0x142cc
leaq 0xf331(%rip), %rsi      # 0x14ba4
leaq 0xefaf(%rip), %rcx      # 0x14829
movl $0x4e3, %edx            # imm = 0x4E3
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/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 0x58c1
movl %esi, %edi
movl $0x280, %esi            # imm = 0x280
movq %rbx, %rdx
callq 0x58cc
testq %rax, %rax
je 0x58c1
movq %rax, %r14
movq %rbx, %rdi
callq 0x4e16
movq %r14, %rbx
movq %rbx, %rax
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/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 0x597a
testq %rdx, %rdx
je 0x5996
movq %r8, %rbx
testq %r8, %r8
je 0x59b2
testw %cx, %cx
je 0x59ce
movzwl 0x12(%rdi), %r8d
movb $-0x10, %al
cmpw %si, %r8w
jbe 0x5972
movzwl %cx, %ecx
movzwl %si, %r14d
leal (%rcx,%r14), %esi
cmpl %r8d, %esi
ja 0x5972
movq 0x8(%rdi), %rdi
addq %r14, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x1345e
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 0xe94b(%rip), %rdi      # 0x142cc
leaq 0xef2b(%rip), %rsi      # 0x148b3
leaq 0xee9a(%rip), %rcx      # 0x14829
movl $0x53c, %edx            # imm = 0x53C
jmp 0x59e8
leaq 0xe92f(%rip), %rdi      # 0x142cc
leaq 0xf217(%rip), %rsi      # 0x14bbb
leaq 0xee7e(%rip), %rcx      # 0x14829
movl $0x53d, %edx            # imm = 0x53D
jmp 0x59e8
leaq 0xe913(%rip), %rdi      # 0x142cc
leaq 0xf20b(%rip), %rsi      # 0x14bcb
leaq 0xee62(%rip), %rcx      # 0x14829
movl $0x53e, %edx            # imm = 0x53E
jmp 0x59e8
leaq 0xe8f7(%rip), %rdi      # 0x142cc
leaq 0xf1fe(%rip), %rsi      # 0x14bda
leaq 0xee46(%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_O2/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:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %esi, %r15d
movzwl 0x10(%rdi), %eax
leal (%rbx,%r15), %ecx
movw $0xffff, %r13w          # imm = 0xFFFF
cmpl %eax, %ecx
ja 0x5acc
movq %rdx, %r14
movq %rdi, %r12
testq %r12, %r12
je 0x5aa2
movzwl 0x12(%r12), %eax
cmpw %ax, %r15w
jb 0x5aa2
subl %eax, %r15d
movq (%r12), %r12
jmp 0x5a88
xorl %r13d, %r13d
cmpw %r13w, %bx
je 0x5ac9
leal (%r15,%r13), %eax
movzwl %ax, %esi
movq %r12, %rdi
callq 0x59fb
movzwl %r13w, %ecx
incl %r13d
cmpb (%r14,%rcx), %al
je 0x5aa5
jmp 0x5acc
xorl %r13d, %r13d
movl %r13d, %eax
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/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, %r14d
movzwl 0x10(%rdi), %r13d
leal (%r14,%rdx), %eax
movw $0xffff, %bx            # imm = 0xFFFF
cmpl %r13d, %eax
ja 0x5b29
movq %rsi, %r15
movq %rdi, %r12
subl %edx, %r13d
movzwl %dx, %ebp
cmpw %r13w, %r14w
ja 0x5b29
movzwl %r14w, %esi
movq %r12, %rdi
movq %r15, %rdx
movl %ebp, %ecx
callq 0x5a63
testw %ax, %ax
je 0x5b26
incl %r14d
jmp 0x5b05
movl %r14d, %ebx
movl %ebx, %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/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 0x5b65
movq %rsi, %rbx
cmpb $0x0, (%rsi)
je 0x5b65
movq %rdi, %r14
cmpw $-0x1, 0x10(%rdi)
je 0x5b65
movq %rbx, %rdi
callq 0x20c0
cmpq $0xfffe, %rax           # imm = 0xFFFE
jbe 0x5b71
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 0x5ad9
// File: /workspace/github_c_makefile_star2_O2/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 0x5e96
pushq %rbx
movq %rdi, %rbx
movb 0x14(%rsi), %cl
movb %cl, 0x14(%rdi)
movl (%rsi), %eax
movl %eax, (%rdi)
cmpb $0x6, %cl
jne 0x5e86
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 0x5e93
movl %eax, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
cmpl $0x80fe, %ecx           # imm = 0x80FE
je 0x5e42
andl $0x8fff, %eax           # imm = 0x8FFF
cmpw $0x2ff, %ax             # imm = 0x2FF
je 0x5e42
cmpl $0x1ff, %eax            # imm = 0x1FF
jne 0x5e93
movq %rbx, %rdi
movq %rbx, %rsi
callq 0xf144
testq %rax, %rax
je 0x5e93
movl (%rbx), %ecx
movl %ecx, %edx
andl $0xc0ff, %edx           # imm = 0xC0FF
cmpl $0x80fe, %edx           # imm = 0x80FE
je 0x5e79
andl $0x8fff, %ecx           # imm = 0x8FFF
cmpw $0x2ff, %cx             # imm = 0x2FF
je 0x5e79
cmpl $0x1ff, %ecx            # imm = 0x1FF
jne 0x5e97
movb 0xee(%rax), %al
incb %al
movb %al, 0x10(%rbx)
jmp 0x5e93
addq $0x4, %rbx
andq $0x0, 0x5(%rbx)
andq $0x0, (%rbx)
xorl %eax, %eax
popq %rbx
retq
xorl %eax, %eax
jmp 0x5e81
// File: /workspace/github_c_makefile_star2_O2/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 0x5f82
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 0x5f68
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 0x5f75
movl %eax, %ecx
andl $0xc0ff, %ecx           # imm = 0xC0FF
cmpl $0x80fe, %ecx           # imm = 0x80FE
je 0x5f1f
andl $0x8fff, %eax           # imm = 0x8FFF
cmpw $0x2ff, %ax             # imm = 0x2FF
je 0x5f1f
cmpl $0x1ff, %eax            # imm = 0x1FF
jne 0x5f75
leaq 0x18(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf144
testq %rax, %rax
je 0x5f75
movl (%r14), %ecx
movl %ecx, %edx
andl $0xc0ff, %edx           # imm = 0xC0FF
cmpl $0x80fe, %edx           # imm = 0x80FE
je 0x5f5b
andl $0x8fff, %ecx           # imm = 0x8FFF
cmpw $0x2ff, %cx             # imm = 0x2FF
je 0x5f5b
cmpl $0x1ff, %ecx            # imm = 0x1FF
jne 0x5f83
movb 0xee(%rax), %al
incb %al
movb %al, 0x28(%rbx)
jmp 0x5f75
leaq 0x1c(%rbx), %rax
andq $0x0, 0x5(%rax)
andq $0x0, (%rax)
orb $0x1, 0x41(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0x5f63
// File: /workspace/github_c_makefile_star2_O2/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 0x60b5
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movb 0x14(%rdi), %al
cmpb $0x2e, %al
je 0x6034
cmpb 0x14(%rbx), %al
jne 0x60b5
movb 0x30(%r15), %al
testb %al, %al
je 0x6046
movzbl %al, %edi
callq 0x4bee
jmp 0x6061
cmpb $0x6, 0x14(%rbx)
jne 0x6059
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf144
jmp 0x6061
movq %rbx, %rdi
callq 0xdb18
movq %rax, %r12
movb $-0x4, %bpl
testq %rax, %rax
je 0x60b5
cmpb $0x6, 0x14(%r15)
movl (%r15), %eax
jne 0x6083
testl %eax, %eax
je 0x60c7
movq %r15, %r8
cmpb $-0x1, %al
je 0x609c
jmp 0x60e5
testl %eax, %eax
sete %cl
andl $0xf0, %eax
cmpl $0xe0, %eax
sete %al
orb %cl, %al
movq %r15, %r8
je 0x60e5
cmpb $0x6, 0x14(%rbx)
jne 0x60c0
movq %r12, %rdi
movq %rbx, %rsi
callq 0xf14f
movq %rax, %r8
testq %rax, %rax
jne 0x60e5
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%r12), %r8
jmp 0x60e5
cmpl $0x0, 0x4(%r15)
movq %r15, %r8
jne 0x60e5
cmpl $0x0, 0x8(%r15)
movq %r15, %r8
jne 0x60e5
cmpl $0x0, 0xc(%r15)
movq %r15, %r8
je 0x609c
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x60fe
// File: /workspace/github_c_makefile_star2_O2/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 0x1757d(%rip), %rcx     # 0x1d8f0
cmpq %rdi, %rcx
je 0x639f
testq %rcx, %rcx
je 0x63ad
movq %rcx, %rax
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
sete %dl
cmpq %rsi, %rcx
setne %dil
orb %dl, %dil
jne 0x6378
addq $0x38, %rax
movq %rsi, %rcx
jmp 0x63a6
leaq 0x1754a(%rip), %rax     # 0x1d8f0
movq 0x38(%rcx), %rcx
movq %rcx, (%rax)
xorl %edi, %edi
jmp 0x3bcd
// File: /workspace/github_c_makefile_star2_O2/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 0x6518
cmpb $0x6, 0x14(%rdi)
movl (%rdi), %eax
jne 0x643e
testl %eax, %eax
jne 0x6434
cmpl $0x0, 0x4(%rdi)
jne 0x6434
cmpl $0x0, 0x8(%rdi)
je 0x6509
testq %rsi, %rsi
jne 0x6451
jmp 0x6518
testl %eax, %eax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x6518
cmpb $0x6, 0x14(%rsi)
movl (%rsi), %eax
jne 0x6474
testl %eax, %eax
jne 0x647c
cmpl $0x0, 0x4(%rsi)
jne 0x647c
cmpl $0x0, 0x8(%rsi)
jne 0x647c
cmpl $0x0, 0xc(%rsi)
jne 0x647c
jmp 0x6518
testl %eax, %eax
je 0x6518
leaq 0x1746d(%rip), %rax     # 0x1d8f0
movq (%rax), %rax
testq %rax, %rax
je 0x6518
movb 0x14(%rax), %cl
cmpb 0x14(%rdi), %cl
jne 0x6500
movl (%rax), %edx
movl (%rdi), %r8d
cmpb $0x6, %cl
jne 0x64c8
cmpl %r8d, %edx
jne 0x6500
movl 0x4(%rax), %ecx
cmpl 0x4(%rdi), %ecx
jne 0x6500
movl 0x8(%rax), %ecx
cmpl 0x8(%rdi), %ecx
jne 0x6500
movl 0xc(%rax), %ecx
cmpl 0xc(%rdi), %ecx
jne 0x6500
movb 0x10(%rax), %cl
cmpb 0x10(%rdi), %cl
je 0x64cd
jmp 0x6500
cmpl %r8d, %edx
jne 0x6500
movb 0x14(%rsi), %cl
movb %cl, 0x14(%rax)
movl (%rsi), %edx
movl %edx, (%rax)
cmpb $0x6, %cl
jne 0x64f6
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 0x6500
andq $0x0, 0x9(%rax)
andq $0x0, 0x4(%rax)
addq $0x38, %rax
jmp 0x6483
testq %rsi, %rsi
je 0x6518
cmpl $0x0, 0xc(%rdi)
jne 0x6451
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
incb 0x17385(%rip)           # 0x1d920
leaq 0x17366(%rip), %r14     # 0x1d908
movq %r14, %rbx
movq (%rbx), %r15
testq %r15, %r15
je 0x6624
movq %r15, %rbx
movb 0x1736a(%rip), %al      # 0x1d920
cmpb %al, 0x56(%r15)
je 0x661e
movb %al, 0x56(%rbx)
movzwl 0x52(%rbx), %eax
testb $0x1, %al
je 0x65e1
orl $0x2, %eax
movw %ax, 0x52(%rbx)
movq %rbx, %rdi
callq 0xb804
movzwl 0x52(%rbx), %eax
andl $-0x4, %eax
movw %ax, 0x52(%rbx)
testb $0x8, %al
je 0x65f6
andl $0xfff7, %eax           # imm = 0xFFF7
movw %ax, 0x52(%rbx)
movq %rbx, %rdi
callq 0x7c71
movq 0x38(%rbx), %r15
cmpq $0x0, 0xc0(%rbx)
je 0x65a8
movb $0x0, 0x1730e(%rip)     # 0x1d919
movq %rbx, %rdi
callq 0x7cbf
cmpb $0x0, 0x172ff(%rip)     # 0x1d919
je 0x65a8
jmp 0x65a2
addq $0x38, %rbx
jmp 0x65a5
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6c2f
cmpl $0x1, 0x48(%rdi)
je 0x6c2a
orb $0x10, 0x52(%rdi)
pushq $0x1
popq %rsi
jmp 0x6c5e
pushq %rax
leaq 0xd695(%rip), %rdi      # 0x142cc
leaq 0xe07b(%rip), %rsi      # 0x14cb9
leaq 0xe05a(%rip), %rcx      # 0x14c9f
movl $0x1e8, %edx            # imm = 0x1E8
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/tcp.c
// Function: tcp_shutdown
err_t
tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx)
{
  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ERROR("tcp_shutdown: invalid pcb", pcb != NULL, return ERR_ARG);

  if (pcb->state == LISTEN) {
    return ERR_CONN;
  }
  if (shut_rx) {
    /* shut down the receive side: set a flag not to receive any more data... */
    tcp_set_flags(pcb, TF_RXCLOSED);
    if (shut_tx) {
      /* shutting down the tx AND rx side is the same as closing for the raw API */
      return tcp_close_shutdown(pcb, 1);
    }
    /* ... and free buffered data */
    if (pcb->refused_data != NULL) {
      pbuf_free(pcb->refused_data);
      pcb->refused_data = NULL;
    }
  }
  if (shut_tx) {
    /* This can't happen twice since if it succeeds, the pcb's state is changed.
       Only close in these states as the others directly deallocate the PCB */
    switch (pcb->state) {
      case SYN_RCVD:
      case ESTABLISHED:
      case CLOSE_WAIT:
        return tcp_close_shutdown(pcb, (u8_t)shut_rx);
      default:
        /* Not (yet?) connected, cannot shutdown the TX side as that would bring us
          into CLOSED state, where the PCB is deallocated. */
        return ERR_CONN;
    }
  }
  return ERR_OK;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x6ebc
movq %rdi, %rbx
movl 0x48(%rdi), %ecx
movb $-0xb, %al
cmpl $0x1, %ecx
je 0x6eba
testl %esi, %esi
je 0x6e81
orb $0x10, 0x52(%rbx)
testl %edx, %edx
je 0x6e9f
pushq $0x1
popq %rsi
movq %rbx, %rdi
jmp 0x6e99
testl %edx, %edx
je 0x6eb8
cmpl $0x7, %ecx
ja 0x6eba
movl $0x98, %edx
btl %ecx, %edx
jae 0x6eba
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
jmp 0x6c5e
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x6eb8
callq 0x4e16
andq $0x0, 0xc0(%rbx)
xorl %eax, %eax
popq %rbx
retq
leaq 0xd409(%rip), %rdi      # 0x142cc
leaq 0xde06(%rip), %rsi      # 0x14cd0
leaq 0xddce(%rip), %rcx      # 0x14c9f
movl $0x207, %edx            # imm = 0x207
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/tcp.c
// Function: tcp_pcb_remove
void
tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_pcb_remove: invalid pcb", pcb != NULL);
  LWIP_ASSERT("tcp_pcb_remove: invalid pcblist", pcblist != NULL);

  TCP_RMV(pcblist, pcb);

  tcp_pcb_purge(pcb);

  /* if there is an outstanding delayed ACKs, send it */
  if ((pcb->state != TIME_WAIT) &&
      (pcb->state != LISTEN) &&
      (pcb->flags & TF_ACK_DELAY)) {
    tcp_ack_now(pcb);
    tcp_output(pcb);
  }

  if (pcb->state != LISTEN) {
    LWIP_ASSERT("unsent segments leaking", pcb->unsent == NULL);
    LWIP_ASSERT("unacked segments leaking", pcb->unacked == NULL);
#if TCP_QUEUE_OOSEQ
    LWIP_ASSERT("ooseq segments leaking", pcb->ooseq == NULL);
#endif /* TCP_QUEUE_OOSEQ */
  }

  pcb->state = CLOSED;
  /* reset the local port to prevent the pcb from being 'bound' */
  pcb->local_port = 0;

  LWIP_ASSERT("tcp_pcb_remove: tcp_pcbs_sane()", tcp_pcbs_sane());
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x713a
testq %rdi, %rdi
je 0x7156
movq %rsi, %rbx
movq (%rdi), %rax
cmpq %rsi, %rax
je 0x70cd
testq %rax, %rax
je 0x70d4
movq %rax, %rdi
movq 0x38(%rax), %rax
cmpq %rbx, %rax
jne 0x70b5
addq $0x38, %rdi
movq %rbx, %rax
movq 0x38(%rax), %rax
movq %rax, (%rdi)
andq $0x0, 0x38(%rbx)
movq %rbx, %rdi
callq 0x7bc0
movl 0x48(%rbx), %eax
cmpl $0x1, %eax
je 0x7108
cmpl $0xa, %eax
je 0x7108
movzwl 0x52(%rbx), %eax
testb $0x1, %al
je 0x710d
orl $0x2, %eax
movw %ax, 0x52(%rbx)
movq %rbx, %rdi
callq 0xb804
movl 0x48(%rbx), %eax
cmpl $0x1, %eax
je 0x712b
cmpq $0x0, 0xa8(%rbx)
jne 0x7172
cmpq $0x0, 0xb0(%rbx)
jne 0x718e
cmpq $0x0, 0xb8(%rbx)
jne 0x71aa
andl $0x0, 0x48(%rbx)
andw $0x0, 0x4e(%rbx)
popq %rbx
jmp 0x829f
leaq 0xd18b(%rip), %rdi      # 0x142cc
leaq 0xe05f(%rip), %rsi      # 0x151a7
leaq 0xdb50(%rip), %rcx      # 0x14c9f
movl $0x883, %edx            # imm = 0x883
jmp 0x71c4
leaq 0xd16f(%rip), %rdi      # 0x142cc
leaq 0xe05f(%rip), %rsi      # 0x151c3
leaq 0xdb34(%rip), %rcx      # 0x14c9f
movl $0x884, %edx            # imm = 0x884
jmp 0x71c4
leaq 0xd153(%rip), %rdi      # 0x142cc
leaq 0xe063(%rip), %rsi      # 0x151e3
leaq 0xdb18(%rip), %rcx      # 0x14c9f
movl $0x893, %edx            # imm = 0x893
jmp 0x71c4
leaq 0xd137(%rip), %rdi      # 0x142cc
leaq 0xe05f(%rip), %rsi      # 0x151fb
leaq 0xdafc(%rip), %rcx      # 0x14c9f
movl $0x894, %edx            # imm = 0x894
jmp 0x71c4
leaq 0xd11b(%rip), %rdi      # 0x142cc
leaq 0xe05c(%rip), %rsi      # 0x15214
leaq 0xdae0(%rip), %rcx      # 0x14c9f
movl $0x896, %edx            # imm = 0x896
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/tcp.c
// Function: tcp_segs_free
void
tcp_segs_free(struct tcp_seg *seg)
{
  while (seg != NULL) {
    struct tcp_seg *next = seg->next;
    tcp_seg_free(seg);
    seg = next;
  }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x71ea
movq (%rdi), %rbx
callq 0x7e33
movq %rbx, %rdi
jmp 0x71d8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_new_port
static u16_t
tcp_new_port(void)
{
  u8_t i;
  u16_t n = 0;
  struct tcp_pcb *pcb;

again:
  tcp_port++;
  if (tcp_port == TCP_LOCAL_PORT_RANGE_END) {
    tcp_port = TCP_LOCAL_PORT_RANGE_START;
  }
  /* Check all PCB lists. */
  for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
    for (pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
      if (pcb->local_port == tcp_port) {
        n++;
        if (n > (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) {
          return 0;
        }
        goto again;
      }
    }
  }
  return tcp_port;
}

// Assembly:
movzwl 0x15c9f(%rip), %ecx     # 0x1d148
xorl %eax, %eax
movl $0xc000, %edx           # imm = 0xC000
leaq 0x158a9(%rip), %rsi     # 0x1cd60
incl %ecx
cmpw $-0x1, %cx
cmovel %edx, %ecx
xorl %edi, %edi
cmpq $0x4, %rdi
je 0x74f2
movq (%rsi,%rdi,8), %r8
movq (%r8), %r9
testq %r9, %r9
je 0x74e1
leaq 0x38(%r9), %r8
cmpw %cx, 0x4e(%r9)
jne 0x74cc
jmp 0x74e6
incq %rdi
jmp 0x74c2
incl %eax
cmpw $0x4000, %ax            # imm = 0x4000
jne 0x74b7
xorl %eax, %eax
jmp 0x74f4
movl %ecx, %eax
movw %cx, 0x15c4d(%rip)      # 0x1d148
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_accept_null
static err_t
tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err)
{
  LWIP_UNUSED_ARG(arg);
  LWIP_UNUSED_ARG(err);

  LWIP_ASSERT("tcp_accept_null: invalid pcb", pcb != NULL);

  tcp_abort(pcb);

  return ERR_ABRT;
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0x76a7
movq %rsi, %rdi
callq 0x71ec
movb $-0xd, %al
popq %rcx
retq
leaq 0xcc1e(%rip), %rdi      # 0x142cc
leaq 0xdc97(%rip), %rsi      # 0x1534c
leaq 0xd5e3(%rip), %rcx      # 0x14c9f
movl $0x30f, %edx            # imm = 0x30F
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/tcp.c
// Function: tcp_update_rcv_ann_wnd
u32_t
tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)
{
  u32_t new_right_edge;

  LWIP_ASSERT("tcp_update_rcv_ann_wnd: invalid pcb", pcb != NULL);
  new_right_edge = pcb->rcv_nxt + pcb->rcv_wnd;

  if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge + LWIP_MIN((TCP_WND / 2), pcb->mss))) {
    /* we can advertise more window */
    pcb->rcv_ann_wnd = pcb->rcv_wnd;
    return new_right_edge - pcb->rcv_ann_right_edge;
  } else {
    if (TCP_SEQ_GT(pcb->rcv_nxt, pcb->rcv_ann_right_edge)) {
      /* Can happen due to other end sending out of advertised window,
       * but within actual available (but not yet advertised) window */
      pcb->rcv_ann_wnd = 0;
    } else {
      /* keep the right edge of window constant */
      u32_t new_rcv_ann_wnd = pcb->rcv_ann_right_edge - pcb->rcv_nxt;
#if !LWIP_WND_SCALE
      LWIP_ASSERT("new_rcv_ann_wnd <= 0xffff", new_rcv_ann_wnd <= 0xffff);
#endif
      pcb->rcv_ann_wnd = (tcpwnd_size_t)new_rcv_ann_wnd;
    }
    return 0;
  }
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x772e
movl 0x5c(%rdi), %edx
movl 0x64(%rdi), %ecx
movzwl 0x60(%rdi), %esi
movzwl 0x6a(%rdi), %eax
cmpw $0x4000, %ax            # imm = 0x4000
movl $0x4000, %r8d           # imm = 0x4000
cmovbl %eax, %r8d
leal (%rdx,%rsi), %eax
movzwl %r8w, %r8d
addl %ecx, %r8d
cmpl %r8d, %eax
js 0x770d
movw %si, 0x62(%rdi)
subl %ecx, %eax
jmp 0x772c
movl %edx, %eax
subl %ecx, %eax
testl %eax, %eax
jle 0x771c
andw $0x0, 0x62(%rdi)
jmp 0x772a
subl %edx, %ecx
cmpl $0x10000, %ecx          # imm = 0x10000
jae 0x775b
movw %cx, 0x62(%rdi)
xorl %eax, %eax
popq %rcx
retq
leaq 0xcb97(%rip), %rdi      # 0x142cc
leaq 0xd69a(%rip), %rsi      # 0x14dd6
leaq 0xd55c(%rip), %rcx      # 0x14c9f
movl $0x3a6, %edx            # imm = 0x3A6
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xcb6a(%rip), %rdi      # 0x142cc
leaq 0xd691(%rip), %rsi      # 0x14dfa
leaq 0xd52f(%rip), %rcx      # 0x14c9f
movl $0x3b6, %edx            # imm = 0x3B6
jmp 0x7748