// File: /workspace/github_c_makefile_star2_O0/FH0[P]tun_direct/lwip-2.1.2/src/core/netif.c
// Function: netif_remove
void
netif_remove(struct netif *netif)
{
#if LWIP_IPV6
  int i;
#endif

  LWIP_ASSERT_CORE_LOCKED();

  if (netif == NULL) {
    return;
  }

  netif_invoke_ext_callback(netif, LWIP_NSC_NETIF_REMOVED, NULL);

#if LWIP_IPV4
  if (!ip4_addr_isany_val(*netif_ip4_addr(netif))) {
    netif_do_ip_addr_changed(netif_ip_addr4(netif), NULL);
  }

#if LWIP_IGMP
  /* stop IGMP processing */
  if (netif->flags & NETIF_FLAG_IGMP) {
    igmp_stop(netif);
  }
#endif /* LWIP_IGMP */
#endif /* LWIP_IPV4*/

#if LWIP_IPV6
  for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) {
    if (ip6_addr_isvalid(netif_ip6_addr_state(netif, i))) {
      netif_do_ip_addr_changed(netif_ip_addr6(netif, i), NULL);
    }
  }
#if LWIP_IPV6_MLD
  /* stop MLD processing */
  mld6_stop(netif);
#endif /* LWIP_IPV6_MLD */
#endif /* LWIP_IPV6 */
  if (netif_is_up(netif)) {
    /* set netif down before removing (call callback function) */
    netif_set_down(netif);
  }

  mib2_remove_ip4(netif);

  /* this netif is default? */
  if (netif_default == netif) {
    /* reset default netif */
    netif_set_default(NULL);
  }
#if !LWIP_SINGLE_NETIF
  /*  is it the first netif? */
  if (netif_list == netif) {
    netif_list = netif->next;
  } else {
    /*  look for netif further down the list */
    struct netif *tmp_netif;
    NETIF_FOREACH(tmp_netif) {
      if (tmp_netif->next == netif) {
        tmp_netif->next = netif->next;
        break;
      }
    }
    if (tmp_netif == NULL) {
      return; /* netif is not on the list */
    }
  }
#endif /* !LWIP_SINGLE_NETIF */
  mib2_netif_removed(netif);
#if LWIP_NETIF_REMOVE_CALLBACK
  if (netif->remove_callback) {
    netif->remove_callback(netif);
  }
#endif /* LWIP_NETIF_REMOVE_CALLBACK */
  LWIP_DEBUGF( NETIF_DEBUG, ("netif_remove: removed netif\n") );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x5948
jmp 0x5a5d
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x5963
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5a70
movl $0x0, -0xc(%rbp)
cmpl $0x3, -0xc(%rbp)
jge 0x59b1
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movzbl 0x98(%rax,%rcx), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x59a4
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movslq -0xc(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5a70
jmp 0x59a6
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x596a
movq -0x8(%rbp), %rax
movzbl 0xeb(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x59cc
movb $0x1, %al
testb $0x1, %al
jne 0x59d4
jmp 0x59dd
xorl %eax, %eax
testb $0x1, %al
jne 0x59d4
jmp 0x59dd
movq -0x8(%rbp), %rdi
callq 0x5ab0
movq 0x29efc(%rip), %rax     # 0x2f8e0
cmpq -0x8(%rbp), %rax
jne 0x59f3
xorl %eax, %eax
movl %eax, %edi
callq 0x5b40
movq 0x29ede(%rip), %rax     # 0x2f8d8
cmpq -0x8(%rbp), %rax
jne 0x5a10
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, 0x29eca(%rip)     # 0x2f8d8
jmp 0x5a59
movq 0x29ec1(%rip), %rax     # 0x2f8d8
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5a4e
movq -0x18(%rbp), %rax
movq (%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x5a3f
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x5a4e
jmp 0x5a41
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x5a1b
cmpq $0x0, -0x18(%rbp)
jne 0x5a57
jmp 0x5a5d
jmp 0x5a59
jmp 0x5a5b
jmp 0x5a5d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)