// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x16550
jmp 0x16521
leaq 0x10da4(%rip), %rdi     # 0x272cc
leaq 0x12cc5(%rip), %rsi     # 0x291f4
movl $0x787, %edx            # imm = 0x787
leaq 0x12497(%rip), %rcx     # 0x289d2
movb $0x0, %al
callq 0x20d0
xorl %eax, %eax
movl %eax, %edi
callq 0x21b0
callq 0x2040
jmp 0x16552
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x15530
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x16577
movb $-0x4, -0x21(%rbp)
jmp 0x16656
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movw 0x10(%rax), %ax
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movl $0x6, %esi
movzwl %ax, %edx
callq 0x25a10
movw %ax, %cx
movq -0x40(%rbp), %rax
movw %cx, 0x10(%rax)
cmpq $0x0, -0x8(%rbp)
je 0x165cc
movq -0x8(%rbp), %rax
movb 0x33(%rax), %al
movb %al, -0x31(%rbp)
movq -0x8(%rbp), %rax
movb 0x32(%rax), %al
movb %al, -0x32(%rbp)
jmp 0x165d4
movb $0x40, -0x31(%rbp)
movb $0x0, -0x32(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1661d
movq -0x20(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl $0x6, %eax
jne 0x1661d
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movb -0x31(%rbp), %cl
movb -0x32(%rbp), %r8b
movq -0x30(%rbp), %rax
movl $0x6, %r9d
movzbl %cl, %ecx
movzbl %r8b, %r8d
movq %rax, (%rsp)
callq 0x1d560
movsbl %al, %eax
movl %eax, -0x44(%rbp)
jmp 0x16650
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movb -0x31(%rbp), %cl
movb -0x32(%rbp), %r8b
movq -0x30(%rbp), %rax
movl $0x6, %r9d
movzbl %cl, %ecx
movzbl %r8b, %r8d
movq %rax, (%rsp)
callq 0x19c10
movsbl %al, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movb %al, -0x21(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7260
movb -0x21(%rbp), %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)