// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/tcp.c
// Function: tcp_process_refused_data
err_t
tcp_process_refused_data(struct tcp_pcb *pcb)
{
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
  struct pbuf *rest;
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */

  LWIP_ERROR("tcp_process_refused_data: invalid pcb", pcb != NULL, return ERR_ARG);

#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
  while (pcb->refused_data != NULL)
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
  {
    err_t err;
    u8_t refused_flags = pcb->refused_data->flags;
    /* set pcb->refused_data to NULL in case the callback frees it and then
       closes the pcb */
    struct pbuf *refused_data = pcb->refused_data;
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
    pbuf_split_64k(refused_data, &rest);
    pcb->refused_data = rest;
#else /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
    pcb->refused_data = NULL;
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
    /* Notify again application with data previously received. */
    LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: notify kept packet\n"));
    TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err);
    if (err == ERR_OK) {
      /* did refused_data include a FIN? */
      if ((refused_flags & PBUF_FLAG_TCP_FIN)
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
          && (rest == NULL)
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
         ) {
        /* correct rcv_wnd as the application won't call tcp_recved()
           for the FIN's seqno */
        if (pcb->rcv_wnd != TCP_WND_MAX(pcb)) {
          pcb->rcv_wnd++;
        }
        TCP_EVENT_CLOSED(pcb, err);
        if (err == ERR_ABRT) {
          return ERR_ABRT;
        }
      }
    } else if (err == ERR_ABRT) {
      /* if err == ERR_ABRT, 'pcb' is already deallocated */
      /* Drop incoming packets because pcb is "full" (only if the incoming
         segment contains data). */
      LWIP_DEBUGF(TCP_INPUT_DEBUG, ("tcp_input: drop incoming packets, because pcb is \"full\"\n"));
      return ERR_ABRT;
    } else {
      /* data is still refused, pbuf is still valid (go on for ACK-only packets) */
#if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE
      if (rest != NULL) {
        pbuf_cat(refused_data, rest);
      }
#endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */
      pcb->refused_data = refused_data;
      return ERR_INPROGRESS;
    }
  }
  return ERR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x80b9
movq %rdi, %rbx
movq 0xc0(%rdi), %r15
movq 0xd8(%rdi), %rax
movb 0x15(%r15), %bpl
movq $0x0, 0xc0(%rdi)
testq %rax, %rax
je 0x803d
movq 0x40(%rbx), %rdi
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq *%rax
jmp 0x804a
movq %rbx, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x8109
movl %eax, %r14d
cmpb $-0xd, %al
je 0x80ab
movzbl %r14b, %eax
testl %eax, %eax
jne 0x8064
testb $0x20, %bpl
jne 0x8070
xorl %r14d, %r14d
jmp 0x80ab
movq %r15, 0xc0(%rbx)
movb $-0x5, %r14b
jmp 0x80ab
movzwl 0x60(%rbx), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0x8081
incl %eax
movw %ax, 0x60(%rbx)
movq 0xd8(%rbx), %rax
xorl %r14d, %r14d
testq %rax, %rax
je 0x80ab
movq 0x40(%rbx), %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%rax
cmpb $-0xd, %al
movl $0xf3, %eax
cmovnel %r14d, %eax
movl %eax, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc20c(%rip), %rdi      # 0x142cc
leaq 0xcf92(%rip), %rsi      # 0x15059
leaq 0xcbba(%rip), %rcx      # 0x14c88
movl $0x609, %edx            # imm = 0x609
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050