// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x2b(%rbp)
je 0x12728
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl 0x4(%rax), %edi
callq 0x251f0
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x10(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movzwl 0xc(%rax), %edi
callq 0x251c0
movl -0x34(%rbp), %ecx
movw %ax, %dx
movl -0x30(%rbp), %eax
movzwl %dx, %edx
andl $0x3f, %edx
movzbl %dl, %edi
andl $0x3, %edi
xorl %edx, %edx
movl $0x1, %esi
cmpl $0x0, %edi
cmovnel %esi, %edx
addl %edx, %ecx
addl %ecx, %eax
subl 0x1d229(%rip), %eax     # 0x2f948
cmpl $0x0, %eax
setle %al
movb %al, -0x2b(%rbp)
movb -0x2b(%rbp), %al
testb $0x1, %al
jne 0x12734
jmp 0x12842
jmp 0x12736
jmp 0x12738
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7bf0
movw %ax, -0x2a(%rbp)
jmp 0x1275e
jmp 0x12760
movq -0x8(%rbp), %rax
movzwl 0x9e(%rax), %eax
movzwl -0x2a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x127a4
jmp 0x12775
leaq 0x14b50(%rip), %rdi     # 0x272cc
leaq 0x161cb(%rip), %rsi     # 0x2894e
movl $0x467, %edx            # imm = 0x467
leaq 0x15e15(%rip), %rcx     # 0x285a4
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0x127a6
movq -0x8(%rbp), %rax
movzwl 0x9e(%rax), %eax
movzwl -0x2a(%rbp), %ecx
subl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x9e(%rax)
movzwl 0x1d1ae(%rip), %eax     # 0x2f97a
movq -0x28(%rbp), %rcx
movzwl 0x10(%rcx), %ecx
addl %ecx, %eax
movw %ax, 0x1d19d(%rip)      # 0x2f97a
movq -0x28(%rbp), %rdi
callq 0xd7a0
jmp 0x127e8
movq -0x8(%rbp), %rax
movzwl 0x9e(%rax), %eax
cmpl $0x0, %eax
je 0x1283d
jmp 0x127fa
cmpq $0x0, -0x10(%rbp)
jne 0x12839
cmpq $0x0, -0x20(%rbp)
jne 0x12839
jmp 0x1280a
leaq 0x14abb(%rip), %rdi     # 0x272cc
leaq 0x1615e(%rip), %rsi     # 0x28976
movl $0x472, %edx            # imm = 0x472
leaq 0x15d80(%rip), %rcx     # 0x285a4
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0x1283b
jmp 0x1283d
jmp 0x126b8
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)