// File: /workspace/github_c_makefile_star2_O3/FH0[P]tun_direct/lwip-2.1.2/src/core/netif.c
// Function: netif_poll
void
netif_poll(struct netif *netif)
{
  /* If we have a loopif, SNMP counters are adjusted for it,
   * if not they are adjusted for 'netif'. */
#if MIB2_STATS
#if LWIP_HAVE_LOOPIF
  struct netif *stats_if = &loop_netif;
#else /* LWIP_HAVE_LOOPIF */
  struct netif *stats_if = netif;
#endif /* LWIP_HAVE_LOOPIF */
#endif /* MIB2_STATS */
  SYS_ARCH_DECL_PROTECT(lev);

  LWIP_ASSERT("netif_poll: invalid netif", netif != NULL);

  /* Get a packet from the list. With SYS_LIGHTWEIGHT_PROT=1, this is protected */
  SYS_ARCH_PROTECT(lev);
  while (netif->loop_first != NULL) {
    struct pbuf *in, *in_end;
#if LWIP_LOOPBACK_MAX_PBUFS
    u8_t clen = 1;
#endif /* LWIP_LOOPBACK_MAX_PBUFS */

    in = in_end = netif->loop_first;
    while (in_end->len != in_end->tot_len) {
      LWIP_ASSERT("bogus pbuf: len != tot_len but next == NULL!", in_end->next != NULL);
      in_end = in_end->next;
#if LWIP_LOOPBACK_MAX_PBUFS
      clen++;
#endif /* LWIP_LOOPBACK_MAX_PBUFS */
    }
#if LWIP_LOOPBACK_MAX_PBUFS
    /* adjust the number of pbufs on queue */
    LWIP_ASSERT("netif->loop_cnt_current underflow",
                ((netif->loop_cnt_current - clen) < netif->loop_cnt_current));
    netif->loop_cnt_current = (u16_t)(netif->loop_cnt_current - clen);
#endif /* LWIP_LOOPBACK_MAX_PBUFS */

    /* 'in_end' now points to the last pbuf from 'in' */
    if (in_end == netif->loop_last) {
      /* this was the last pbuf in the list */
      netif->loop_first = netif->loop_last = NULL;
    } else {
      /* pop the pbuf off the list */
      netif->loop_first = in_end->next;
      LWIP_ASSERT("should not be null since first != last!", netif->loop_first != NULL);
    }
    /* De-queue the pbuf from its successors on the 'loop_' list. */
    in_end->next = NULL;
    SYS_ARCH_UNPROTECT(lev);

    in->if_idx = netif_get_index(netif);

    LINK_STATS_INC(link.recv);
    MIB2_STATS_NETIF_ADD(stats_if, ifinoctets, in->tot_len);
    MIB2_STATS_NETIF_INC(stats_if, ifinucastpkts);
    /* loopback packets are always IP packets! */
    if (ip_input(in, netif) != ERR_OK) {
      pbuf_free(in);
    }
    SYS_ARCH_PROTECT(lev);
  }
  SYS_ARCH_UNPROTECT(lev);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x4752
movq %rdi, %rbx
movq 0xf8(%rdi), %r14
testq %r14, %r14
je 0x4703
leaq 0xf8(%rbx), %r15
movq %r14, %rax
movzwl 0x12(%rax), %ecx
cmpw 0x10(%rax), %cx
je 0x46b4
movq (%rax), %rax
testq %rax, %rax
jne 0x46a0
jmp 0x4709
cmpq 0x100(%rbx), %rax
je 0x46ca
movq (%rax), %rcx
movq %rcx, (%r15)
testq %rcx, %rcx
jne 0x46d1
jmp 0x4736
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, (%rax)
movb 0xee(%rbx), %al
incb %al
movb %al, 0x17(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3bcb
testb %al, %al
je 0x46fb
movq %r14, %rdi
callq 0x4fdf
movq (%r15), %r14
testq %r14, %r14
jne 0x469d
popq %rbx
popq %r14
popq %r15
retq
leaq 0xfbbc(%rip), %rdi      # 0x142cc
leaq 0xff39(%rip), %rsi      # 0x14650
leaq 0xfd1c(%rip), %rcx      # 0x1443a
movl $0x4c7, %edx            # imm = 0x4C7
xorl %eax, %eax
callq 0x20d0
xorl %edi, %edi
callq 0x21b0
callq 0x2050
leaq 0xfb8f(%rip), %rdi      # 0x142cc
leaq 0xff39(%rip), %rsi      # 0x1467d
leaq 0xfcef(%rip), %rcx      # 0x1443a
movl $0x4db, %edx            # imm = 0x4DB
jmp 0x4723
leaq 0xfb73(%rip), %rdi      # 0x142cc
leaq 0xfed6(%rip), %rsi      # 0x14636
leaq 0xfcd3(%rip), %rcx      # 0x1443a
movl $0x4bb, %edx            # imm = 0x4BB
jmp 0x4723