LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_recved
void
tcp_recved(struct tcp_pcb *pcb, u16_t len)
{
  u32_t wnd_inflation;
  tcpwnd_size_t rcv_wnd;

  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ERROR("tcp_recved: invalid pcb", pcb != NULL, return);

  /* pcb->state LISTEN not allowed here */
  LWIP_ASSERT("don't call tcp_recved for listen-pcbs",
              pcb->state != LISTEN);

  rcv_wnd = (tcpwnd_size_t)(pcb->rcv_wnd + len);
  if ((rcv_wnd > TCP_WND_MAX(pcb)) || (rcv_wnd < pcb->rcv_wnd)) {
    /* window got too big or tcpwnd_size_t overflow */
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: window got too big or tcpwnd_size_t overflow\n"));
    pcb->rcv_wnd = TCP_WND_MAX(pcb);
  } else  {
    pcb->rcv_wnd = rcv_wnd;
  }

  wnd_inflation = tcp_update_rcv_ann_wnd(pcb);

  /* If the change in the right edge of window is significant (default
   * watermark is TCP_WND/4), then send an explicit update now.
   * Otherwise wait for a packet to be sent in the normal course of
   * events (or more window to be available later) */
  if (wnd_inflation >= TCP_WND_UPDATE_THRESHOLD) {
    tcp_ack_now(pcb);
    tcp_output(pcb);
  }

  LWIP_DEBUGF(TCP_DEBUG, ("tcp_recved: received %"U16_F" bytes, wnd %"TCPWNDSIZE_F" (%"TCPWNDSIZE_F").\n",
                          len, pcb->rcv_wnd, (u16_t)(TCP_WND_MAX(pcb) - pcb->rcv_wnd)));
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x77c7
movq %rdi, %rbx
cmpl $0x1, 0x48(%rdi)
je 0x77e3
movzwl 0x60(%rbx), %eax
leal (%rsi,%rax), %ecx
cmpw $0x8000, %cx            # imm = 0x8000
movl $0x8000, %edx           # imm = 0x8000
movl $0x8000, %edi           # imm = 0x8000
cmovbl %ecx, %edi
addw %ax, %si
cmovbl %edx, %edi
movw %di, 0x60(%rbx)
movq %rbx, %rdi
callq 0x76d4
cmpl $0x16d0, %eax           # imm = 0x16D0
jb 0x77c5
orb $0x2, 0x52(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0xb804
popq %rbx
retq
leaq 0xcafe(%rip), %rdi      # 0x142cc
leaq 0xd63f(%rip), %rsi      # 0x14e14
leaq 0xd4c3(%rip), %rcx      # 0x14c9f
movl $0x3cf, %edx            # imm = 0x3CF
jmp 0x77fd
leaq 0xcae2(%rip), %rdi      # 0x142cc
leaq 0xd63b(%rip), %rsi      # 0x14e2c
leaq 0xd4a7(%rip), %rcx      # 0x14c9f
movl $0x3d3, %edx            # imm = 0x3D3
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_next_iss
u32_t
tcp_next_iss(struct tcp_pcb *pcb)
{
#ifdef LWIP_HOOK_TCP_ISN
  LWIP_ASSERT("tcp_next_iss: invalid pcb", pcb != NULL);
  return LWIP_HOOK_TCP_ISN(&pcb->local_ip, pcb->local_port, &pcb->remote_ip, pcb->remote_port);
#else /* LWIP_HOOK_TCP_ISN */
  static u32_t iss = 6510;

  LWIP_ASSERT("tcp_next_iss: invalid pcb", pcb != NULL);
  LWIP_UNUSED_ARG(pcb);

  iss += tcp_ticks;       /* XXX */
  return iss;
#endif /* LWIP_HOOK_TCP_ISN */
}

// Assembly:
testq %rdi, %rdi
je 0x7ae8
movl 0x15671(%rip), %eax     # 0x1d14c
addl 0x15e3b(%rip), %eax     # 0x1d91c
movl %eax, 0x15665(%rip)     # 0x1d14c
retq
pushq %rax
leaq 0xc7dc(%rip), %rdi      # 0x142cc
leaq 0xd734(%rip), %rsi      # 0x1522b
leaq 0xd1a1(%rip), %rcx      # 0x14c9f
movl $0x8af, %edx            # imm = 0x8AF
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_purge
void
tcp_pcb_purge(struct tcp_pcb *pcb)
{
  LWIP_ERROR("tcp_pcb_purge: invalid pcb", pcb != NULL, return);

  if (pcb->state != CLOSED &&
      pcb->state != TIME_WAIT &&
      pcb->state != LISTEN) {

    LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge\n"));

    tcp_backlog_accepted(pcb);

    if (pcb->refused_data != NULL) {
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->refused_data\n"));
      pbuf_free(pcb->refused_data);
      pcb->refused_data = NULL;
    }
    if (pcb->unsent != NULL) {
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: not all data sent\n"));
    }
    if (pcb->unacked != NULL) {
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->unacked\n"));
    }
#if TCP_QUEUE_OOSEQ
    if (pcb->ooseq != NULL) {
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_pcb_purge: data left on ->ooseq\n"));
      tcp_free_ooseq(pcb);
    }
#endif /* TCP_QUEUE_OOSEQ */

    /* Stop the retransmission timer as it will expect data on unacked
       queue if it fires */
    pcb->rtime = -1;

    tcp_segs_free(pcb->unsent);
    tcp_segs_free(pcb->unacked);
    pcb->unacked = pcb->unsent = NULL;
#if TCP_OVERSIZE
    pcb->unsent_oversize = 0;
#endif /* TCP_OVERSIZE */
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7c44
movq %rdi, %rbx
movl 0x48(%rdi), %eax
cmpl $0xa, %eax
ja 0x7bde
movl $0x403, %ecx            # imm = 0x403
btl %eax, %ecx
jb 0x7c3c
movq 0xc0(%rbx), %rdi
testq %rdi, %rdi
je 0x7bf7
callq 0x4e16
andq $0x0, 0xc0(%rbx)
leaq 0xa8(%rbx), %r14
cmpq $0x0, 0xb8(%rbx)
je 0x7c10
movq %rbx, %rdi
callq 0x7ba1
orw $-0x1, 0x68(%rbx)
movq 0xa8(%rbx), %rdi
callq 0x71d7
movq 0xb0(%rbx), %rdi
callq 0x71d7
andw $0x0, 0xa0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xc681(%rip), %rdi      # 0x142cc
leaq 0xd53a(%rip), %rsi      # 0x1518c
leaq 0xd046(%rip), %rcx      # 0x14c9f
movl $0x851, %edx            # imm = 0x851
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_txnow
void
tcp_txnow(void)
{
  struct tcp_pcb *pcb;

  for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->flags & TF_NAGLEMEMERR) {
      tcp_output(pcb);
    }
  }
}

// Assembly:
pushq %rbx
leaq 0x15b57(%rip), %rbx     # 0x1d908
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x7dcd
testb $-0x80, 0x52(%rbx)
je 0x7dc7
movq %rbx, %rdi
callq 0xb804
addq $0x38, %rbx
jmp 0x7db1
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_recv_null
err_t
tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
  LWIP_UNUSED_ARG(arg);

  LWIP_ERROR("tcp_recv_null: invalid pcb", pcb != NULL, return ERR_ARG);

  if (p != NULL) {
    tcp_recved(pcb, p->tot_len);
    pbuf_free(p);
  } else if (err == ERR_OK) {
    return tcp_close(pcb);
  }
  return ERR_OK;
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x7e06
movq %rdx, %rbx
testq %rdx, %rdx
je 0x7df5
movzwl 0x10(%rbx), %eax
movq %rsi, %rdi
movl %eax, %esi
callq 0x7777
movq %rbx, %rdi
callq 0x4e16
jmp 0x7df9
testb %cl, %cl
je 0x7dfd
xorl %eax, %eax
popq %rbx
retq
movq %rsi, %rdi
popq %rbx
jmp 0x6c1b
leaq 0xc4bf(%rip), %rdi      # 0x142cc
leaq 0xd2b5(%rip), %rsi      # 0x150c9
leaq 0xce84(%rip), %rcx      # 0x14c9f
movl $0x698, %edx            # imm = 0x698
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_seg_free
void
tcp_seg_free(struct tcp_seg *seg)
{
  if (seg != NULL) {
    if (seg->p != NULL) {
      pbuf_free(seg->p);
#if TCP_DEBUG
      seg->p = NULL;
#endif /* TCP_DEBUG */
    }
    memp_free(MEMP_TCP_SEG, seg);
  }
}

// Assembly:
testq %rdi, %rdi
je 0x7e5b
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x7e4f
callq 0x4e16
andq $0x0, 0x8(%rbx)
pushq $0x4
popq %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x3bcd
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_seg_copy
struct tcp_seg *
tcp_seg_copy(struct tcp_seg *seg)
{
  struct tcp_seg *cseg;

  LWIP_ASSERT("tcp_seg_copy: invalid seg", seg != NULL);

  cseg = (struct tcp_seg *)memp_malloc(MEMP_TCP_SEG);
  if (cseg == NULL) {
    return NULL;
  }
  SMEMCPY((u8_t *)cseg, (const u8_t *)seg, sizeof(struct tcp_seg));
  pbuf_ref(cseg->p);
  return cseg;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x7ed4
movq %rdi, %rbx
pushq $0x4
popq %rdi
callq 0x3b4a
movq %rax, %r14
testq %rax, %rax
je 0x7ec9
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm0, (%r14)
movups %xmm1, 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0x51d4
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xc3f1(%rip), %rdi      # 0x142cc
leaq 0xd1cd(%rip), %rsi      # 0x150af
leaq 0xcdb6(%rip), %rcx      # 0x14c9f
movl $0x682, %edx            # imm = 0x682
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_kill_state
static void
tcp_kill_state(enum tcp_state state)
{
  struct tcp_pcb *pcb, *inactive;
  u32_t inactivity;

  LWIP_ASSERT("invalid state", (state == CLOSING) || (state == LAST_ACK));

  inactivity = 0;
  inactive = NULL;
  /* Go through the list of active pcbs and get the oldest pcb that is in state
     CLOSING/LAST_ACK. */
  for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    if (pcb->state == state) {
      if ((u32_t)(tcp_ticks - pcb->tmr) >= inactivity) {
        inactivity = tcp_ticks - pcb->tmr;
        inactive = pcb;
      }
    }
  }
  if (inactive != NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_kill_closing: killing oldest %s PCB %p (%"S32_F")\n",
                            tcp_state_str[state], (void *)inactive, inactivity));
    /* Don't send a RST, since no data is lost. */
    tcp_abandon(inactive, 0);
  }
}

// Assembly:
pushq %rax
movl %edi, %eax
andl $-0x2, %eax
cmpl $0x8, %eax
jne 0x8114
xorl %eax, %eax
leaq 0x15833(%rip), %rcx     # 0x1d908
movl 0x15841(%rip), %edx     # 0x1d91c
xorl %esi, %esi
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x8102
cmpl %edi, 0x48(%rcx)
jne 0x80fc
movl %edx, %r8d
subl 0x58(%rcx), %r8d
cmpl %esi, %r8d
cmovaeq %rcx, %rax
cmoval %r8d, %esi
addq $0x38, %rcx
jmp 0x80dd
testq %rax, %rax
je 0x8112
movq %rax, %rdi
xorl %esi, %esi
popq %rax
jmp 0x6ee9
popq %rax
retq
leaq 0xc1b1(%rip), %rdi      # 0x142cc
leaq 0xd247(%rip), %rsi      # 0x15369
leaq 0xcb76(%rip), %rcx      # 0x14c9f
movl $0x6dd, %edx            # imm = 0x6DD
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_recv
void
tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv)
{
  LWIP_ASSERT_CORE_LOCKED();
  if (pcb != NULL) {
    LWIP_ASSERT("invalid socket state for recv callback", pcb->state != LISTEN);
    pcb->recv = recv;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x817d
cmpl $0x1, 0x48(%rdi)
je 0x817e
movq %rsi, 0xd8(%rdi)
retq
pushq %rax
leaq 0xc146(%rip), %rdi      # 0x142cc
leaq 0xcf57(%rip), %rsi      # 0x150e4
leaq 0xcb0b(%rip), %rcx      # 0x14c9f
movl $0x7df, %edx            # imm = 0x7DF
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_sent
void
tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent)
{
  LWIP_ASSERT_CORE_LOCKED();
  if (pcb != NULL) {
    LWIP_ASSERT("invalid socket state for sent callback", pcb->state != LISTEN);
    pcb->sent = sent;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x81be
cmpl $0x1, 0x48(%rdi)
je 0x81bf
movq %rsi, 0xd0(%rdi)
retq
pushq %rax
leaq 0xc105(%rip), %rdi      # 0x142cc
leaq 0xcf3d(%rip), %rsi      # 0x1510b
leaq 0xcaca(%rip), %rcx      # 0x14c9f
movl $0x7f3, %edx            # imm = 0x7F3
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_err
void
tcp_err(struct tcp_pcb *pcb, tcp_err_fn err)
{
  LWIP_ASSERT_CORE_LOCKED();
  if (pcb != NULL) {
    LWIP_ASSERT("invalid socket state for err callback", pcb->state != LISTEN);
    pcb->errf = err;
  }
}

// Assembly:
testq %rdi, %rdi
je 0x81ff
cmpl $0x1, 0x48(%rdi)
je 0x8200
movq %rsi, 0xf0(%rdi)
retq
pushq %rax
leaq 0xc0c4(%rip), %rdi      # 0x142cc
leaq 0xcf23(%rip), %rsi      # 0x15132
leaq 0xca89(%rip), %rcx      # 0x14c9f
movl $0x80d, %edx            # imm = 0x80D
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_poll
void
tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval)
{
  LWIP_ASSERT_CORE_LOCKED();

  LWIP_ERROR("tcp_poll: invalid pcb", pcb != NULL, return);
  LWIP_ASSERT("invalid socket state for poll", pcb->state != LISTEN);

#if LWIP_CALLBACK_API
  pcb->poll = poll;
#else /* LWIP_CALLBACK_API */
  LWIP_UNUSED_ARG(poll);
#endif /* LWIP_CALLBACK_API */
  pcb->pollinterval = interval;
}

// Assembly:
pushq %rax
testq %rdi, %rdi
je 0x8256
cmpl $0x1, 0x48(%rdi)
je 0x8272
movq %rsi, 0xe8(%rdi)
movb %dl, 0x55(%rdi)
popq %rax
retq
leaq 0xc06f(%rip), %rdi      # 0x142cc
leaq 0xcef4(%rip), %rsi      # 0x15158
leaq 0xca34(%rip), %rcx      # 0x14c9f
movl $0x83d, %edx            # imm = 0x83D
jmp 0x828c
leaq 0xc053(%rip), %rdi      # 0x142cc
leaq 0xceee(%rip), %rsi      # 0x1516e
leaq 0xca18(%rip), %rcx      # 0x14c9f
movl $0x83e, %edx            # imm = 0x83E
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_pcbs_sane
s16_t
tcp_pcbs_sane(void)
{
  struct tcp_pcb *pcb;
  for (pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {
    LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != CLOSED", pcb->state != CLOSED);
    LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != LISTEN", pcb->state != LISTEN);
    LWIP_ASSERT("tcp_pcbs_sane: active pcb->state != TIME-WAIT", pcb->state != TIME_WAIT);
  }
  for (pcb = tcp_tw_pcbs; pcb != NULL; pcb = pcb->next) {
    LWIP_ASSERT("tcp_pcbs_sane: tw pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
  }
  return 1;
}

// Assembly:
pushq %rax
leaq 0x15661(%rip), %rax     # 0x1d908
movq (%rax), %rax
testq %rax, %rax
je 0x82c6
movl 0x48(%rax), %ecx
cmpl $0xa, %ecx
je 0x8301
cmpl $0x1, %ecx
je 0x831d
testl %ecx, %ecx
je 0x8339
addq $0x38, %rax
jmp 0x82a7
leaq 0x15643(%rip), %rax     # 0x1d910
movq (%rax), %rcx
testq %rcx, %rcx
je 0x82fb
leaq 0x38(%rcx), %rax
cmpl $0xa, 0x48(%rcx)
je 0x82cd
leaq 0xbfe6(%rip), %rdi      # 0x142cc
leaq 0xd003(%rip), %rsi      # 0x152f0
leaq 0xc9ab(%rip), %rcx      # 0x14c9f
movl $0x9de, %edx            # imm = 0x9DE
jmp 0x8353
movw $0x1, %ax
popq %rcx
retq
leaq 0xbfc4(%rip), %rdi      # 0x142cc
leaq 0xcfb3(%rip), %rsi      # 0x152c2
leaq 0xc989(%rip), %rcx      # 0x14c9f
movl $0x9db, %edx            # imm = 0x9DB
jmp 0x8353
leaq 0xbfa8(%rip), %rdi      # 0x142cc
leaq 0xcf6c(%rip), %rsi      # 0x15297
leaq 0xc96d(%rip), %rcx      # 0x14c9f
movl $0x9da, %edx            # imm = 0x9DA
jmp 0x8353
leaq 0xbf8c(%rip), %rdi      # 0x142cc
leaq 0xcf25(%rip), %rsi      # 0x1526c
leaq 0xc951(%rip), %rcx      # 0x14c9f
movl $0x9d9, %edx            # imm = 0x9D9
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_netif_ip_addr_changed
void
tcp_netif_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr)
{
  struct tcp_pcb_listen *lpcb;

  if (!ip_addr_isany(old_addr)) {
    tcp_netif_ip_addr_changed_pcblist(old_addr, tcp_active_pcbs);
    tcp_netif_ip_addr_changed_pcblist(old_addr, tcp_bound_pcbs);

    if (!ip_addr_isany(new_addr)) {
      /* PCB bound to current local interface address? */
      for (lpcb = tcp_listen_pcbs.listen_pcbs; lpcb != NULL; lpcb = lpcb->next) {
        /* PCB bound to current local interface address? */
        if (ip_addr_cmp(&lpcb->local_ip, old_addr)) {
          /* The PCB is listening to the old ipaddr and
            * is set to listen to the new one instead */
          ip_addr_copy(lpcb->local_ip, *new_addr);
        }
      }
    }
  }
}

// Assembly:
testq %rdi, %rdi
je 0x848c
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x6, 0x14(%rdi)
movl (%rdi), %eax
jne 0x839f
testl %eax, %eax
jne 0x83a7
cmpl $0x0, 0x4(%r14)
jne 0x83a7
cmpl $0x0, 0x8(%r14)
jne 0x83a7
cmpl $0x0, 0xc(%r14)
jne 0x83a7
jmp 0x8485
testl %eax, %eax
je 0x8485
movq 0x1555a(%rip), %rsi     # 0x1d908
movq %r14, %rdi
callq 0x848d
movq 0x15543(%rip), %rsi     # 0x1d900
movq %r14, %rdi
callq 0x848d
testq %rbx, %rbx
je 0x8485
cmpb $0x6, 0x14(%rbx)
movl (%rbx), %eax
jne 0x83f1
testl %eax, %eax
jne 0x83f9
cmpl $0x0, 0x4(%rbx)
jne 0x83f9
cmpl $0x0, 0x8(%rbx)
jne 0x83f9
cmpl $0x0, 0xc(%rbx)
jne 0x83f9
jmp 0x8485
testl %eax, %eax
je 0x8485
leaq 0x154f8(%rip), %rax     # 0x1d8f8
movq (%rax), %rax
testq %rax, %rax
je 0x8485
movb 0x14(%rax), %cl
cmpb 0x14(%r14), %cl
jne 0x847c
movl (%rax), %edx
movl (%r14), %esi
cmpb $0x6, %cl
jne 0x8445
cmpl %esi, %edx
jne 0x847c
movl 0x4(%rax), %ecx
cmpl 0x4(%r14), %ecx
jne 0x847c
movl 0x8(%rax), %ecx
cmpl 0x8(%r14), %ecx
jne 0x847c
movl 0xc(%rax), %ecx
cmpl 0xc(%r14), %ecx
jne 0x847c
movb 0x10(%rax), %cl
cmpb 0x10(%r14), %cl
je 0x8449
jmp 0x847c
cmpl %esi, %edx
jne 0x847c
movb 0x14(%rbx), %cl
movb %cl, 0x14(%rax)
movl (%rbx), %edx
movl %edx, (%rax)
cmpb $0x6, %cl
jne 0x8472
movl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
movl 0x8(%rbx), %ecx
movl %ecx, 0x8(%rax)
movl 0xc(%rbx), %ecx
movl %ecx, 0xc(%rax)
movb 0x10(%rbx), %cl
movb %cl, 0x10(%rax)
jmp 0x847c
andq $0x0, 0x9(%rax)
andq $0x0, 0x4(%rax)
addq $0x38, %rax
jmp 0x8400
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/tcp.c
// Function: tcp_netif_ip_addr_changed_pcblist
static void
tcp_netif_ip_addr_changed_pcblist(const ip_addr_t *old_addr, struct tcp_pcb *pcb_list)
{
  struct tcp_pcb *pcb;
  pcb = pcb_list;

  LWIP_ASSERT("tcp_netif_ip_addr_changed_pcblist: invalid old_addr", old_addr != NULL);

  while (pcb != NULL) {
    /* PCB bound to current local interface address? */
    if (ip_addr_cmp(&pcb->local_ip, old_addr)
#if LWIP_AUTOIP
        /* connections to link-local addresses must persist (RFC3927 ch. 1.9) */
        && (!IP_IS_V4_VAL(pcb->local_ip) || !ip4_addr_islinklocal(ip_2_ip4(&pcb->local_ip)))
#endif /* LWIP_AUTOIP */
       ) {
      /* this connection must be aborted */
      struct tcp_pcb *next = pcb->next;
      LWIP_DEBUGF(NETIF_DEBUG | LWIP_DBG_STATE, ("netif_set_ipaddr: aborting TCP pcb %p\n", (void *)pcb));
      tcp_abort(pcb);
      pcb = next;
    } else {
      pcb = pcb->next;
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0x84e8
movb 0x14(%rsi), %al
cmpb 0x14(%rbx), %al
jne 0x84cd
movl (%rsi), %ecx
movl (%rbx), %edx
cmpb $0x6, %al
jne 0x84d3
cmpl %edx, %ecx
jne 0x84cd
movl 0x4(%rsi), %eax
cmpl 0x4(%rbx), %eax
jne 0x84cd
movl 0x8(%rsi), %eax
cmpl 0x8(%rbx), %eax
jne 0x84cd
movl 0xc(%rsi), %eax
cmpl 0xc(%rbx), %eax
jne 0x84cd
movb 0x10(%rsi), %al
cmpb 0x10(%rbx), %al
je 0x84d7
movq 0x38(%rsi), %rsi
jmp 0x8494
cmpl %edx, %ecx
jne 0x84cd
movq 0x38(%rsi), %r14
movq %rsi, %rdi
callq 0x71ec
movq %r14, %rsi
jmp 0x8494
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/tcp.c
// Function: tcp_tcp_get_tcp_addrinfo
err_t
tcp_tcp_get_tcp_addrinfo(struct tcp_pcb *pcb, int local, ip_addr_t *addr, u16_t *port)
{
  if (pcb) {
    if (local) {
      if (addr) {
        *addr = pcb->local_ip;
      }
      if (port) {
        *port = pcb->local_port;
      }
    } else {
      if (addr) {
        *addr = pcb->remote_ip;
      }
      if (port) {
        *port = pcb->remote_port;
      }
    }
    return ERR_OK;
  }
  return ERR_VAL;
}

// Assembly:
testq %rdi, %rdi
je 0x8526
testl %esi, %esi
je 0x8529
testq %rdx, %rdx
je 0x851d
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rdx)
movups (%rdi), %xmm0
movups %xmm0, (%rdx)
testq %rcx, %rcx
je 0x854c
pushq $0x4e
jmp 0x8544
movb $-0x6, %al
retq
testq %rdx, %rdx
je 0x853d
movq 0x28(%rdi), %rax
movq %rax, 0x10(%rdx)
movups 0x18(%rdi), %xmm0
movups %xmm0, (%rdx)
testq %rcx, %rcx
je 0x854c
pushq $0x50
popq %rax
movzwl (%rdi,%rax), %eax
movw %ax, (%rcx)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_in.c
// Function: tcp_input_delayed_close
static int
tcp_input_delayed_close(struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_input_delayed_close: invalid pcb", pcb != NULL);

  if (recv_flags & TF_CLOSED) {
    /* The connection has been closed and we will deallocate the
        PCB. */
    if (!(pcb->flags & TF_RXCLOSED)) {
      /* Connection closed although the application has only shut down the
          tx side: call the PCB's err callback and indicate the closure to
          ensure the application doesn't continue using the PCB. */
      TCP_EVENT_ERR(pcb->state, pcb->errf, pcb->callback_arg, ERR_CLSD);
    }
    tcp_pcb_remove(&tcp_active_pcbs, pcb);
    tcp_free(pcb);
    return 1;
  }
  return 0;
}

// Assembly:
xorl %eax, %eax
testb $0x10, 0x1429a(%rip)    # 0x1d978
je 0x971a
pushq %rbx
movq %rdi, %rbx
testb $0x10, 0x52(%rdi)
jne 0x96ff
movq 0xf0(%rbx), %rax
testq %rax, %rax
je 0x96ff
movq 0x40(%rbx), %rdi
pushq $-0xf
popq %rsi
callq *%rax
leaq 0x14202(%rip), %rdi     # 0x1d908
movq %rbx, %rsi
callq 0x7097
movq %rbx, %rdi
callq 0x6530
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_in.c
// Function: tcp_get_next_optbyte
static u8_t
tcp_get_next_optbyte(void)
{
  u16_t optidx = tcp_optidx++;
  if ((tcphdr_opt2 == NULL) || (optidx < tcphdr_opt1len)) {
    u8_t *opts = (u8_t *)tcphdr + TCP_HLEN;
    return opts[optidx];
  } else {
    u8_t idx = (u8_t)(optidx - tcphdr_opt1len);
    return tcphdr_opt2[idx];
  }
}

// Assembly:
movzwl 0x1419b(%rip), %ecx     # 0x1d988
leal 0x1(%rcx), %eax
movw %ax, 0x14191(%rip)      # 0x1d988
movq 0x1413a(%rip), %rax     # 0x1d938
testq %rax, %rax
je 0x980f
movzwl 0x14136(%rip), %edx     # 0x1d940
cmpw %dx, %cx
jae 0x981f
movq 0x14112(%rip), %rax     # 0x1d928
addq %rcx, %rax
addq $0x14, %rax
jmp 0x9827
subl %edx, %ecx
movzbl %cl, %ecx
addq %rcx, %rax
movb (%rax), %al
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_in.c
// Function: tcp_free_acked_segments
static struct tcp_seg *
tcp_free_acked_segments(struct tcp_pcb *pcb, struct tcp_seg *seg_list, const char *dbg_list_name,
                        struct tcp_seg *dbg_other_seg_list)
{
  struct tcp_seg *next;
  u16_t clen;

  LWIP_UNUSED_ARG(dbg_list_name);
  LWIP_UNUSED_ARG(dbg_other_seg_list);

  while (seg_list != NULL &&
         TCP_SEQ_LEQ(lwip_ntohl(seg_list->tcphdr->seqno) +
                     TCP_TCPLEN(seg_list), ackno)) {
    LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: removing %"U32_F":%"U32_F" from pcb->%s\n",
                                  lwip_ntohl(seg_list->tcphdr->seqno),
                                  lwip_ntohl(seg_list->tcphdr->seqno) + TCP_TCPLEN(seg_list),
                                  dbg_list_name));

    next = seg_list;
    seg_list = seg_list->next;

    clen = pbuf_clen(next->p);
    LWIP_DEBUGF(TCP_QLEN_DEBUG, ("tcp_receive: queuelen %"TCPWNDSIZE_F" ... ",
                                 (tcpwnd_size_t)pcb->snd_queuelen));
    LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen >= clen));

    pcb->snd_queuelen = (u16_t)(pcb->snd_queuelen - clen);
    recv_acked = (tcpwnd_size_t)(recv_acked + next->len);
    tcp_seg_free(next);

    LWIP_DEBUGF(TCP_QLEN_DEBUG, ("%"TCPWNDSIZE_F" (after freeing %s)\n",
                                 (tcpwnd_size_t)pcb->snd_queuelen,
                                 dbg_list_name));
    if (pcb->snd_queuelen != 0) {
      LWIP_ASSERT("tcp_receive: valid queue length",
                  seg_list != NULL || dbg_other_seg_list != NULL);
    }
  }
  return seg_list;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testq %r15, %r15
je 0xa4db
movq 0x18(%r15), %rax
movl 0x4(%rax), %edi
callq 0x12ed7
movl %eax, %ebp
movzwl 0x10(%r15), %r12d
movq 0x18(%r15), %rax
movzwl 0xc(%rax), %edi
callq 0x12ed0
andl $0x3, %eax
addl %ebp, %r12d
subl 0x134f7(%rip), %r12d    # 0x1d948
cmpw $0x1, %ax
sbbl $-0x1, %r12d
testl %r12d, %r12d
jg 0xa4db
movq (%r15), %r12
movq 0x8(%r15), %rdi
callq 0x51c5
movzwl 0x9e(%r14), %ecx
cmpw %ax, %cx
jb 0xa4e7
subl %eax, %ecx
movw %cx, 0x9e(%r14)
movzwl 0x10(%r15), %eax
addw %ax, 0x134ed(%rip)      # 0x1d97a
movq %r15, %rdi
callq 0x7e33
cmpw $0x0, 0x9e(%r14)
movq %r12, %r15
je 0xa41b
movq %r12, %r15
testq %rbx, %rbx
jne 0xa41b
movq %r12, %r15
testq %r12, %r12
jne 0xa41b
leaq 0x9e06(%rip), %rdi      # 0x142cc
leaq 0xb293(%rip), %rsi      # 0x15760
leaq 0xaf78(%rip), %rcx      # 0x1544c
movl $0x472, %edx            # imm = 0x472
jmp 0xa501
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9dde(%rip), %rdi      # 0x142cc
leaq 0xb243(%rip), %rsi      # 0x15738
leaq 0xaf50(%rip), %rcx      # 0x1544c
movl $0x467, %edx            # imm = 0x467
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_in.c
// Function: tcp_oos_insert_segment
static void
tcp_oos_insert_segment(struct tcp_seg *cseg, struct tcp_seg *next)
{
  struct tcp_seg *old_seg;

  LWIP_ASSERT("tcp_oos_insert_segment: invalid cseg", cseg != NULL);

  if (TCPH_FLAGS(cseg->tcphdr) & TCP_FIN) {
    /* received segment overlaps all following segments */
    tcp_segs_free(next);
    next = NULL;
  } else {
    /* delete some following segments
       oos queue may have segments with FIN flag */
    while (next &&
           TCP_SEQ_GEQ((seqno + cseg->len),
                       (next->tcphdr->seqno + next->len))) {
      /* cseg with FIN already processed */
      if (TCPH_FLAGS(next->tcphdr) & TCP_FIN) {
        TCPH_SET_FLAG(cseg->tcphdr, TCP_FIN);
      }
      old_seg = next;
      next = next->next;
      tcp_seg_free(old_seg);
    }
    if (next &&
        TCP_SEQ_GT(seqno + cseg->len, next->tcphdr->seqno)) {
      /* We need to trim the incoming segment. */
      cseg->len = (u16_t)(next->tcphdr->seqno - seqno);
      pbuf_realloc(cseg->p, cseg->len);
    }
  }
  cseg->next = next;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movzwl 0xc(%rax), %edi
callq 0x12ed0
testb $0x1, %al
jne 0xa591
pushq $0x1
popq %rbp
testq %r14, %r14
je 0xa599
movl 0x13404(%rip), %eax     # 0x1d944
movzwl 0x10(%rbx), %edx
addl %eax, %edx
movq 0x18(%r14), %rsi
movl 0x4(%rsi), %ecx
movzwl 0x10(%r14), %edi
addl %ecx, %edi
cmpl %edi, %edx
js 0xa5aa
movzwl 0xc(%rsi), %edi
callq 0x12ed0
testb $0x1, %al
je 0xa581
movq 0x18(%rbx), %rax
movzwl 0xc(%rax), %r15d
movl %ebp, %edi
callq 0x12ed0
orw %r15w, %ax
movq 0x18(%rbx), %rcx
movw %ax, 0xc(%rcx)
movq (%r14), %r15
movq %r14, %rdi
callq 0x7e33
movq %r15, %r14
jmp 0xa535
movq %r14, %rdi
callq 0x71d7
xorl %r14d, %r14d
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
subl %ecx, %edx
testl %edx, %edx
jle 0xa59c
subl %eax, %ecx
movw %cx, 0x10(%rbx)
movq 0x8(%rbx), %rdi
movzwl %cx, %esi
callq 0x4f62
jmp 0xa59c
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_pbuf_prealloc
static struct pbuf *
tcp_pbuf_prealloc(pbuf_layer layer, u16_t length, u16_t max_length,
                  u16_t *oversize, const struct tcp_pcb *pcb, u8_t apiflags,
                  u8_t first_seg)
{
  struct pbuf *p;
  u16_t alloc = length;

  LWIP_ASSERT("tcp_pbuf_prealloc: invalid oversize", oversize != NULL);
  LWIP_ASSERT("tcp_pbuf_prealloc: invalid pcb", pcb != NULL);

#if LWIP_NETIF_TX_SINGLE_PBUF
  LWIP_UNUSED_ARG(max_length);
  LWIP_UNUSED_ARG(pcb);
  LWIP_UNUSED_ARG(apiflags);
  LWIP_UNUSED_ARG(first_seg);
  alloc = max_length;
#else /* LWIP_NETIF_TX_SINGLE_PBUF */
  if (length < max_length) {
    /* Should we allocate an oversized pbuf, or just the minimum
     * length required? If tcp_write is going to be called again
     * before this segment is transmitted, we want the oversized
     * buffer. If the segment will be transmitted immediately, we can
     * save memory by allocating only length. We use a simple
     * heuristic based on the following information:
     *
     * Did the user set TCP_WRITE_FLAG_MORE?
     *
     * Will the Nagle algorithm defer transmission of this segment?
     */
    if ((apiflags & TCP_WRITE_FLAG_MORE) ||
        (!(pcb->flags & TF_NODELAY) &&
         (!first_seg ||
          pcb->unsent != NULL ||
          pcb->unacked != NULL))) {
      alloc = LWIP_MIN(max_length, LWIP_MEM_ALIGN_SIZE(TCP_OVERSIZE_CALC_LENGTH(length)));
    }
  }
#endif /* LWIP_NETIF_TX_SINGLE_PBUF */
  p = pbuf_alloc(layer, alloc, PBUF_RAM);
  if (p == NULL) {
    return NULL;
  }
  LWIP_ASSERT("need unchained pbuf", p->next == NULL);
  *oversize = p->len - length;
  /* trim p->len to the currently used size */
  p->len = p->tot_len = length;
  return p;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0xb0bf
movq %rcx, %rbx
movl %esi, %ebp
movl %ebp, %eax
cmpw %dx, %bp
jae 0xb08f
testb $0x2, %r9b
jne 0xb07d
testb $0x40, 0x52(%r8)
movl %ebp, %eax
jne 0xb08f
cmpb $0x0, 0x20(%rsp)
je 0xb07d
cmpq $0x0, 0xa8(%r8)
jne 0xb07d
cmpq $0x0, 0xb0(%r8)
movl %ebp, %eax
je 0xb08f
movzwl %bp, %eax
movzwl %dx, %ecx
addl $0x5b4, %eax            # imm = 0x5B4
cmpl %ecx, %eax
cmovbel %eax, %edx
movl %edx, %eax
movzwl %ax, %esi
movl $0x280, %edx            # imm = 0x280
callq 0x4c47
testq %rax, %rax
je 0xb0b8
cmpq $0x0, (%rax)
jne 0xb0db
movzwl 0x12(%rax), %ecx
subl %ebp, %ecx
movw %cx, (%rbx)
movw %bp, 0x10(%rax)
movw %bp, 0x12(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x9206(%rip), %rdi      # 0x142cc
leaq 0xac90(%rip), %rsi      # 0x15d5d
leaq 0xa6c3(%rip), %rcx      # 0x15797
movl $0xe8, %edx
jmp 0xb0f5
leaq 0x91ea(%rip), %rdi      # 0x142cc
leaq 0xac98(%rip), %rsi      # 0x15d81
leaq 0xa6a7(%rip), %rcx      # 0x15797
movl $0x10b, %edx            # imm = 0x10B
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_out.c
// Function: tcp_seg_add_chksum
static void
tcp_seg_add_chksum(u16_t chksum, u16_t len, u16_t *seg_chksum,
                   u8_t *seg_chksum_swapped)
{
  u32_t helper;
  /* add chksum to old chksum and fold to u16_t */
  helper = chksum + *seg_chksum;
  chksum = FOLD_U32T(helper);
  if ((len & 1) != 0) {
    *seg_chksum_swapped = 1 - *seg_chksum_swapped;
    chksum = SWAP_BYTES_IN_WORD(chksum);
  }
  *seg_chksum = chksum;
}

// Assembly:
movzwl (%rdx), %r8d
addl %edi, %r8d
movl %r8d, %eax
shrl $0x10, %eax
addl %r8d, %eax
testb $0x1, %sil
je 0xb12b
movb $0x1, %sil
subb (%rcx), %sil
movb %sil, (%rcx)
rolw $0x8, %ax
movw %ax, (%rdx)
retq
// File: /workspace/github_c_makefile_star2_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_send_fin
err_t
tcp_send_fin(struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_send_fin: invalid pcb", pcb != NULL);

  /* first, try to add the fin to the last unsent segment */
  if (pcb->unsent != NULL) {
    struct tcp_seg *last_unsent;
    for (last_unsent = pcb->unsent; last_unsent->next != NULL;
         last_unsent = last_unsent->next);

    if ((TCPH_FLAGS(last_unsent->tcphdr) & (TCP_SYN | TCP_FIN | TCP_RST)) == 0) {
      /* no SYN/FIN/RST flag in the header, we can add the FIN flag */
      TCPH_SET_FLAG(last_unsent->tcphdr, TCP_FIN);
      tcp_set_flags(pcb, TF_FIN);
      return ERR_OK;
    }
  }
  /* no data, no length, flags, copy=1, no optdata */
  return tcp_enqueue_flags(pcb, TCP_FIN);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xb650
movq %rdi, %rbx
movq 0xa8(%rdi), %rax
testq %rax, %rax
je 0xb61b
movq %rax, %r14
movq (%rax), %rax
testq %rax, %rax
jne 0xb5ff
movq 0x18(%r14), %rax
movzwl 0xc(%rax), %edi
callq 0x12ed0
testb $0x7, %al
je 0xb62a
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xb67d
movq 0x18(%r14), %rax
movzwl 0xc(%rax), %ebp
pushq $0x1
popq %rdi
callq 0x12ed0
orw %bp, %ax
movq 0x18(%r14), %rcx
movw %ax, 0xc(%rcx)
orb $0x20, 0x52(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x8c75(%rip), %rdi      # 0x142cc
leaq 0xa3fa(%rip), %rsi      # 0x15a58
leaq 0xa132(%rip), %rcx      # 0x15797
movl $0x3eb, %edx            # imm = 0x3EB
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_out.c
// Function: tcp_rexmit_rto_prepare
err_t
tcp_rexmit_rto_prepare(struct tcp_pcb *pcb)
{
  struct tcp_seg *seg;

  LWIP_ASSERT("tcp_rexmit_rto_prepare: invalid pcb", pcb != NULL);

  if (pcb->unacked == NULL) {
    return ERR_VAL;
  }

  /* Move all unacked segments to the head of the unsent queue.
     However, give up if any of the unsent pbufs are still referenced by the
     netif driver due to deferred transmission. No point loading the link further
     if it is struggling to flush its buffered writes. */
  for (seg = pcb->unacked; seg->next != NULL; seg = seg->next) {
    if (tcp_output_segment_busy(seg)) {
      LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit_rto: segment busy\n"));
      return ERR_VAL;
    }
  }
  if (tcp_output_segment_busy(seg)) {
    LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit_rto: segment busy\n"));
    return ERR_VAL;
  }
  /* concatenate unsent queue after unacked queue */
  seg->next = pcb->unsent;
#if TCP_OVERSIZE_DBGCHECK
  /* if last unsent changed, we need to update unsent_oversize */
  if (pcb->unsent == NULL) {
    pcb->unsent_oversize = seg->oversize_left;
  }
#endif /* TCP_OVERSIZE_DBGCHECK */
  /* unsent queue is the concatenated queue (of unacked, unsent) */
  pcb->unsent = pcb->unacked;
  /* unacked queue is now empty */
  pcb->unacked = NULL;

  /* Mark RTO in-progress */
  tcp_set_flags(pcb, TF_RTO);
  /* Record the next byte following retransmit */
  pcb->rto_end = lwip_ntohl(seg->tcphdr->seqno) + TCP_TCPLEN(seg);
  /* Don't take any RTT measurements after retransmitting. */
  pcb->rttest = 0;

  return ERR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xbf9a
movq %rdi, %rbx
movq 0xb0(%rdi), %rcx
movb $-0x6, %al
testq %rcx, %rcx
je 0xbf8f
movq %rcx, %r14
movq (%r14), %rdx
movq 0x8(%r14), %rsi
movb 0x16(%rsi), %sil
testq %rdx, %rdx
je 0xbf20
movq %rdx, %r14
cmpb $0x1, %sil
je 0xbf05
jmp 0xbf8f
cmpb $0x1, %sil
jne 0xbf8f
movq 0xa8(%rbx), %rax
movq %rax, (%r14)
testq %rax, %rax
jne 0xbf41
movzwl 0x12(%r14), %eax
movw %ax, 0xa0(%rbx)
movq %rcx, 0xa8(%rbx)
andq $0x0, 0xb0(%rbx)
orb $0x8, 0x53(%rbx)
movq 0x18(%r14), %rax
movl 0x4(%rax), %edi
callq 0x12ed7
movl %eax, %ebp
movzwl 0x10(%r14), %r15d
movq 0x18(%r14), %rax
movzwl 0xc(%rax), %edi
callq 0x12ed0
andl $0x3, %eax
addl %ebp, %r15d
cmpw $0x1, %ax
sbbl $-0x1, %r15d
movl %r15d, 0x84(%rbx)
andl $0x0, 0x6c(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x832b(%rip), %rdi      # 0x142cc
leaq 0x9c1e(%rip), %rsi      # 0x15bc6
leaq 0x97e8(%rip), %rcx      # 0x15797
movl $0x663, %edx            # imm = 0x663
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_out.c
// Function: tcp_rexmit_rto_commit
void
tcp_rexmit_rto_commit(struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_rexmit_rto_commit: invalid pcb", pcb != NULL);

  /* increment number of retransmissions */
  if (pcb->nrtx < 0xFF) {
    ++pcb->nrtx;
  }
  /* Do the actual retransmission */
  tcp_output(pcb);
}

// Assembly:
testq %rdi, %rdi
je 0xc022
movb 0x7a(%rdi), %al
cmpb $-0x1, %al
je 0xb804
incb %al
movb %al, 0x7a(%rdi)
jmp 0xb804
pushq %rax
leaq 0x82a2(%rip), %rdi      # 0x142cc
leaq 0x9bb9(%rip), %rsi      # 0x15bea
leaq 0x975f(%rip), %rcx      # 0x15797
movl $0x698, %edx            # imm = 0x698
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_out.c
// Function: tcp_rexmit
err_t
tcp_rexmit(struct tcp_pcb *pcb)
{
  struct tcp_seg *seg;
  struct tcp_seg **cur_seg;

  LWIP_ASSERT("tcp_rexmit: invalid pcb", pcb != NULL);

  if (pcb->unacked == NULL) {
    return ERR_VAL;
  }

  seg = pcb->unacked;

  /* Give up if the segment is still referenced by the netif driver
     due to deferred transmission. */
  if (tcp_output_segment_busy(seg)) {
    LWIP_DEBUGF(TCP_RTO_DEBUG, ("tcp_rexmit busy\n"));
    return ERR_VAL;
  }

  /* Move the first unacked segment to the unsent queue */
  /* Keep the unsent queue sorted. */
  pcb->unacked = seg->next;

  cur_seg = &(pcb->unsent);
  while (*cur_seg &&
         TCP_SEQ_LT(lwip_ntohl((*cur_seg)->tcphdr->seqno), lwip_ntohl(seg->tcphdr->seqno))) {
    cur_seg = &((*cur_seg)->next );
  }
  seg->next = *cur_seg;
  *cur_seg = seg;
#if TCP_OVERSIZE
  if (seg->next == NULL) {
    /* the retransmitted segment is last in unsent, so reset unsent_oversize */
    pcb->unsent_oversize = 0;
  }
#endif /* TCP_OVERSIZE */

  if (pcb->nrtx < 0xFF) {
    ++pcb->nrtx;
  }

  /* Don't take any rtt measurements after retransmitting. */
  pcb->rttest = 0;

  /* Do the actual retransmission. */
  MIB2_STATS_INC(mib2.tcpretranssegs);
  /* No need to call tcp_output: we are always called from tcp_input()
     and thus tcp_output directly returns. */
  return ERR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xc137
movq %rdi, %rbx
movq 0xb0(%rdi), %r14
movb $-0x6, %al
testq %r14, %r14
je 0xc12c
movq 0x8(%r14), %rcx
cmpb $0x1, 0x16(%rcx)
jne 0xc12c
movq (%r14), %rax
movq %rax, 0xb0(%rbx)
leaq 0xa8(%rbx), %rax
movq %rax, %r15
movq (%rax), %rax
testq %rax, %rax
je 0xc104
movq 0x18(%rax), %rax
movl 0x4(%rax), %edi
callq 0x12ed7
movl %eax, %ebp
movq 0x18(%r14), %rax
movl 0x4(%rax), %edi
callq 0x12ed7
cmpl %eax, %ebp
movq (%r15), %rax
js 0xc0d6
jmp 0xc106
xorl %eax, %eax
movq %rax, (%r14)
movq %r14, (%r15)
cmpq $0x0, (%r14)
jne 0xc11a
andw $0x0, 0xa0(%rbx)
movb 0x7a(%rbx), %al
cmpb $-0x1, %al
je 0xc126
incb %al
movb %al, 0x7a(%rbx)
andl $0x0, 0x6c(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x818e(%rip), %rdi      # 0x142cc
leaq 0x9ae4(%rip), %rsi      # 0x15c29
leaq 0x964b(%rip), %rcx      # 0x15797
movl $0x6c1, %edx            # imm = 0x6C1
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_out.c
// Function: tcp_rexmit_fast
void
tcp_rexmit_fast(struct tcp_pcb *pcb)
{
  LWIP_ASSERT("tcp_rexmit_fast: invalid pcb", pcb != NULL);

  if (pcb->unacked != NULL && !(pcb->flags & TF_INFR)) {
    /* This is fast retransmit. Retransmit the first unacked segment. */
    LWIP_DEBUGF(TCP_FR_DEBUG,
                ("tcp_receive: dupacks %"U16_F" (%"U32_F
                 "), fast retransmit %"U32_F"\n",
                 (u16_t)pcb->dupacks, pcb->lastack,
                 lwip_ntohl(pcb->unacked->tcphdr->seqno)));
    if (tcp_rexmit(pcb) == ERR_OK) {
      /* Set ssthresh to half of the minimum of the current
       * cwnd and the advertised window */
      pcb->ssthresh = LWIP_MIN(pcb->cwnd, pcb->snd_wnd) / 2;

      /* The minimum value for ssthresh should be 2 MSS */
      if (pcb->ssthresh < (2U * pcb->mss)) {
        LWIP_DEBUGF(TCP_FR_DEBUG,
                    ("tcp_receive: The minimum value for ssthresh %"TCPWNDSIZE_F
                     " should be min 2 mss %"U16_F"...\n",
                     pcb->ssthresh, (u16_t)(2 * pcb->mss)));
        pcb->ssthresh = 2 * pcb->mss;
      }

      pcb->cwnd = pcb->ssthresh + 3 * pcb->mss;
      tcp_set_flags(pcb, TF_INFR);

      /* Reset the retransmission timer to prevent immediate rto retransmissions */
      pcb->rtime = 0;
    }
  }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xc1d3
movq %rdi, %rbx
cmpq $0x0, 0xb0(%rdi)
je 0xc1d1
testb $0x4, 0x52(%rbx)
jne 0xc1d1
movq %rbx, %rdi
callq 0xc09a
testb %al, %al
jne 0xc1d1
movl 0x80(%rbx), %eax
movl 0x98(%rbx), %ecx
cmpw %cx, %ax
cmovbl %eax, %ecx
movzwl %cx, %eax
shrl %eax
movw %ax, 0x82(%rbx)
movzwl 0x6a(%rbx), %ecx
movl %ecx, %edx
addl %ecx, %edx
cmpl %eax, %edx
jbe 0xc1bc
movw %dx, 0x82(%rbx)
movl %edx, %eax
leal (%rcx,%rcx,2), %ecx
addl %ecx, %eax
movw %ax, 0x80(%rbx)
orb $0x4, 0x52(%rbx)
andw $0x0, 0x68(%rbx)
popq %rbx
retq
leaq 0x80f2(%rip), %rdi      # 0x142cc
leaq 0x9a60(%rip), %rsi      # 0x15c41
leaq 0x95af(%rip), %rcx      # 0x15797
movl $0x6f9, %edx            # imm = 0x6F9
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_out.c
// Function: tcp_rst
void
tcp_rst(const struct tcp_pcb *pcb, u32_t seqno, u32_t ackno,
        const ip_addr_t *local_ip, const ip_addr_t *remote_ip,
        u16_t local_port, u16_t remote_port)
{
  struct pbuf *p;
  u16_t wnd;
  u8_t optlen;

  LWIP_ASSERT("tcp_rst: invalid local_ip", local_ip != NULL);
  LWIP_ASSERT("tcp_rst: invalid remote_ip", remote_ip != NULL);

  optlen = LWIP_TCP_OPT_LENGTH_SEGMENT(0, pcb);

#if LWIP_WND_SCALE
  wnd = PP_HTONS(((TCP_WND >> TCP_RCV_SCALE) & 0xFFFF));
#else
  wnd = PP_HTONS(TCP_WND);
#endif

  p = tcp_output_alloc_header_common(ackno, optlen, 0, lwip_htonl(seqno), local_port,
    remote_port, TCP_RST | TCP_ACK, wnd);
  if (p == NULL) {
    LWIP_DEBUGF(TCP_DEBUG, ("tcp_rst: could not allocate memory for pbuf\n"));
    return;
  }
  tcp_output_fill_options(pcb, p, 0, optlen);

  MIB2_STATS_INC(mib2.tcpoutrsts);

  tcp_output_control_segment(pcb, p, local_ip, remote_ip);
  LWIP_DEBUGF(TCP_RST_DEBUG, ("tcp_rst: seqno %"U32_F" ackno %"U32_F".\n", seqno, ackno));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rcx, %rcx
je 0xc285
movq %r8, %rbx
testq %r8, %r8
je 0xc2a1
movl %r9d, %r12d
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %r15
movzwl 0x40(%rsp), %r13d
movl %esi, %edi
callq 0x12ed7
movl $0x80, (%rsp)
movzwl %r12w, %ecx
movzwl %r13w, %r8d
pushq $0x14
popq %r9
movl %ebp, %edi
xorl %esi, %esi
movl %eax, %edx
callq 0xc2ce
testq %rax, %rax
je 0xc276
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc3a0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8040(%rip), %rdi      # 0x142cc
leaq 0x99cb(%rip), %rsi      # 0x15c5e
leaq 0x94fd(%rip), %rcx      # 0x15797
movl $0x7c4, %edx            # imm = 0x7C4
jmp 0xc2bb
leaq 0x8024(%rip), %rdi      # 0x142cc
leaq 0x99c9(%rip), %rsi      # 0x15c78
leaq 0x94e1(%rip), %rcx      # 0x15797
movl $0x7c5, %edx            # imm = 0x7C5
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_out.c
// Function: tcp_output_alloc_header_common
static struct pbuf *
tcp_output_alloc_header_common(u32_t ackno, u16_t optlen, u16_t datalen,
                        u32_t seqno_be /* already in network byte order */,
                        u16_t src_port, u16_t dst_port, u8_t flags, u16_t wnd)
{
  struct tcp_hdr *tcphdr;
  struct pbuf *p;

  p = pbuf_alloc(PBUF_IP, TCP_HLEN + optlen + datalen, PBUF_RAM);
  if (p != NULL) {
    LWIP_ASSERT("check that first pbuf can hold struct tcp_hdr",
                (p->len >= TCP_HLEN + optlen));
    tcphdr = (struct tcp_hdr *)p->payload;
    tcphdr->src = lwip_htons(src_port);
    tcphdr->dest = lwip_htons(dst_port);
    tcphdr->seqno = seqno_be;
    tcphdr->ackno = lwip_htonl(ackno);
    TCPH_HDRLEN_FLAGS_SET(tcphdr, (5 + optlen / 4), flags);
    tcphdr->wnd = lwip_htons(wnd);
    tcphdr->chksum = 0;
    tcphdr->urgp = 0;
  }
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebp
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, %r15d
movl %edi, %r14d
addl $0x14, %esi
movzwl %si, %esi
pushq $0x36
popq %rdi
movl $0x280, %edx            # imm = 0x280
callq 0x4c47
movq %rax, %rbx
testq %rax, %rax
je 0xc361
movl %ebp, 0x4(%rsp)
cmpw $0x13, 0x12(%rbx)
jbe 0xc373
movq 0x8(%rbx), %rbp
movzwl %r13w, %edi
callq 0x12ed0
movw %ax, (%rbp)
movzwl %r12w, %edi
callq 0x12ed0
movw %ax, 0x2(%rbp)
movl %r15d, 0x4(%rbp)
movl %r14d, %edi
callq 0x12ed7
movl %eax, 0x8(%rbp)
movzbl 0x4(%rsp), %edi
orl $0x5000, %edi           # imm = 0x5000
callq 0x12ed0
movw %ax, 0xc(%rbp)
movzwl 0x40(%rsp), %edi
callq 0x12ed0
movw %ax, 0xe(%rbp)
andl $0x0, 0x10(%rbp)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7f52(%rip), %rdi      # 0x142cc
leaq 0x9ad5(%rip), %rsi      # 0x15e56
leaq 0x940f(%rip), %rcx      # 0x15797
movl $0x724, %edx            # imm = 0x724
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_out.c
// Function: tcp_output_control_segment
static err_t
tcp_output_control_segment(const struct tcp_pcb *pcb, struct pbuf *p,
                           const ip_addr_t *src, const ip_addr_t *dst)
{
  err_t err;
  struct netif *netif;

  LWIP_ASSERT("tcp_output_control_segment: invalid pbuf", p != NULL);

  netif = tcp_route(pcb, src, dst);
  if (netif == NULL) {
    err = ERR_RTE;
  } else {
    u8_t ttl, tos;
#if CHECKSUM_GEN_TCP
    IF__NETIF_CHECKSUM_ENABLED(netif, NETIF_CHECKSUM_GEN_TCP) {
      struct tcp_hdr *tcphdr = (struct tcp_hdr *)p->payload;
      tcphdr->chksum = ip_chksum_pseudo(p, IP_PROTO_TCP, p->tot_len,
                                        src, dst);
    }
#endif
    if (pcb != NULL) {
      NETIF_SET_HINTS(netif, LWIP_CONST_CAST(struct netif_hint*, &(pcb->netif_hints)));
      ttl = pcb->ttl;
      tos = pcb->tos;
    } else {
      /* Send output with hardcoded TTL/HL since we have no access to the pcb */
      ttl = TCP_TTL;
      tos = 0;
    }
    TCP_STATS_INC(tcp.xmit);
    err = ip_output_if(p, src, dst, ttl, tos, IP_PROTO_TCP, netif);
    NETIF_RESET_HINTS(netif);
  }
  pbuf_free(p);
  return err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r13
movq %rdx, %rsi
movq %rcx, %rdx
callq 0xbeab
testq %rax, %rax
je 0xc3f6
movq %rax, %r12
movq 0x8(%rbx), %rbp
movzwl 0x10(%rbx), %edx
pushq $0x6
popq %rsi
movq %rbx, %rdi
movq %r15, %rcx
movq %r14, %r8
callq 0x131e6
movw %ax, 0x10(%rbp)
testq %r13, %r13
je 0xc3fb
movb 0x32(%r13), %al
movb 0x33(%r13), %cl
jmp 0xc3ff
movb $-0x4, %bpl
jmp 0xc449
movb $0x40, %cl
xorl %eax, %eax
testq %r14, %r14
je 0xc42a
cmpb $0x6, 0x14(%r14)
jne 0xc42a
movq %r12, (%rsp)
movzbl %cl, %ecx
movzbl %al, %r8d
pushq $0x6
popq %r9
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xf908
jmp 0xc447
movq %r12, (%rsp)
movzbl %cl, %ecx
movzbl %al, %r8d
pushq $0x6
popq %r9
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xdd30
movl %eax, %ebp
movq %rbx, %rdi
callq 0x4e16
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_O2/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp_out.c
// Function: tcp_output_alloc_header
static struct pbuf *
tcp_output_alloc_header(struct tcp_pcb *pcb, u16_t optlen, u16_t datalen,
                        u32_t seqno_be /* already in network byte order */)
{
  struct pbuf *p;

  LWIP_ASSERT("tcp_output_alloc_header: invalid pcb", pcb != NULL);

  p = tcp_output_alloc_header_common(pcb->rcv_nxt, optlen, datalen,
    seqno_be, pcb->local_port, pcb->remote_port, TCP_ACK,
    TCPWND_MIN16(RCV_WND_SCALE(pcb, pcb->rcv_ann_wnd)));
  if (p != NULL) {
    /* If we're sending a packet, update the announced right window edge */
    pcb->rcv_ann_right_edge = pcb->rcv_nxt + pcb->rcv_ann_wnd;
  }
  return p;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x5c(%rdi), %edi
movzwl 0x4e(%rbx), %ecx
movzwl 0x50(%rbx), %r8d
movzwl 0x62(%rbx), %eax
movl %eax, (%rsp)
pushq $0x10
popq %r9
callq 0xc2ce
testq %rax, %rax
je 0xc495
movzwl 0x62(%rbx), %ecx
addl 0x5c(%rbx), %ecx
movl %ecx, 0x64(%rbx)
addq $0x10, %rsp
popq %rbx
retq