// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xd574
jmp 0xd545
leaq 0x19d80(%rip), %rdi     # 0x272cc
leaq 0x1abe9(%rip), %rsi     # 0x2813c
movl $0x609, %edx            # imm = 0x609
leaq 0x1a80c(%rip), %rcx     # 0x27d6b
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0xd576
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rax
movb 0x15(%rax), %al
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0xc0(%rax)
jmp 0xd5a7
jmp 0xd5a9
movq -0x10(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
je 0xd5db
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq *%rax
movb %al, -0x11(%rbp)
jmp 0xd5f1
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
xorl %ecx, %ecx
callq 0xd700
movb %al, -0x11(%rbp)
jmp 0xd5f3
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0xd674
movzbl -0x12(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xd672
movq -0x10(%rbp), %rax
movzwl 0x60(%rax), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0xd627
movq -0x10(%rbp), %rax
movw 0x60(%rax), %cx
addw $0x1, %cx
movw %cx, 0x60(%rax)
jmp 0xd629
movq -0x10(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
je 0xd65b
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x10(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
xorl %ecx, %ecx
callq *%rax
movb %al, -0x11(%rbp)
jmp 0xd65f
movb $0x0, -0x11(%rbp)
jmp 0xd661
movsbl -0x11(%rbp), %eax
cmpl $-0xd, %eax
jne 0xd670
movb $-0xd, -0x1(%rbp)
jmp 0xd6a0
jmp 0xd672
jmp 0xd69c
movsbl -0x11(%rbp), %eax
cmpl $-0xd, %eax
jne 0xd687
jmp 0xd67f
jmp 0xd681
movb $-0xd, -0x1(%rbp)
jmp 0xd6a0
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xc0(%rax)
movb $-0x5, -0x1(%rbp)
jmp 0xd6a0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)