	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_mvm_mac_remove_interface
_iwl_mvm_mac_remove_interface:          ## @iwl_mvm_mac_remove_interface
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_IWL_MAC80211_GET_MVM
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_iwl_mvm_vif_from_mac80211
	movq	%rax, %r12
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_prepare_mac_removal
	movq	(%r14), %rax
	movq	_NL80211_IFTYPE_AP@GOTPCREL(%rip), %rdx
	movq	_NL80211_IFTYPE_ADHOC@GOTPCREL(%rip), %rcx
	cmpq	(%rdx), %rax
	je	LBB0_3
## %bb.1:
	cmpq	(%rcx), %rax
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_tcm_rm_vif
LBB0_3:
	leaq	4(%r13), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	20(%r12), %ebx
	movq	%r15, %rdi
	callq	_lockdep_is_held
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_rcu_dereference_protected
	movq	%rax, %rbx
	movl	20(%r12), %edi
	xorl	%esi, %esi
	callq	_RCU_INIT_POINTER
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.4:
	movq	_rcu_head@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_kfree_rcu
LBB0_5:
	cmpq	%r12, 56(%r13)
	jne	LBB0_7
## %bb.6:
	movq	$0, 56(%r13)
	movq	_IEEE80211_VIF_BEACON_FILTER@GOTPCREL(%rip), %rax
	movq	_IEEE80211_VIF_SUPPORTS_CQM_RSSI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	notl	%ecx
	andl	%ecx, 8(%r14)
LBB0_7:
	cmpq	$0, 16(%r14)
	je	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	addq	$48, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
LBB0_9:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_vif_dbgfs_clean
	movq	(%r14), %rax
	movq	_NL80211_IFTYPE_AP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.10:
	movq	_NL80211_IFTYPE_ADHOC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
## %bb.12:
	movq	_NL80211_IFTYPE_P2P_DEVICE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_14
## %bb.13:
	movq	$0, 24(%r13)
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_rm_p2p_bcast_sta
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_binding_remove_vif
	movq	8(%r12), %rsi
	movq	%r13, %rdi
	callq	_iwl_mvm_phy_ctxt_unref
	movq	$0, 8(%r12)
LBB0_14:
	movq	16(%r13), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.15:
	movq	(%r14), %rcx
	cmpq	(%rbx), %rcx
	je	LBB0_17
## %bb.16:
	decq	%rax
	movq	%rax, 16(%r13)
LBB0_17:
	movq	%r13, %rdi
	callq	_iwl_mvm_power_update_mac
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_mac_ctxt_remove
	movq	8(%r13), %rax
	movq	(%r12), %rcx
	movl	(%rax,%rcx,4), %edi
	xorl	%esi, %esi
	callq	_RCU_INIT_POINTER
	movq	(%r14), %rax
	movq	_NL80211_IFTYPE_MONITOR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.18:
	movl	$0, (%r13)
	jmp	LBB0_19
LBB0_11:
	addq	$16, %r12
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_iwl_mvm_dealloc_int_sta
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_iwl_mvm_dealloc_bcast_sta
LBB0_19:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_IFTYPE_AP,8,3          ## @NL80211_IFTYPE_AP
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ## @NL80211_IFTYPE_ADHOC
	.comm	_rcu_head,4,2                   ## @rcu_head
	.comm	_IEEE80211_VIF_BEACON_FILTER,4,2 ## @IEEE80211_VIF_BEACON_FILTER
	.comm	_IEEE80211_VIF_SUPPORTS_CQM_RSSI,4,2 ## @IEEE80211_VIF_SUPPORTS_CQM_RSSI
	.comm	_NL80211_IFTYPE_P2P_DEVICE,8,3  ## @NL80211_IFTYPE_P2P_DEVICE
	.comm	_NL80211_IFTYPE_MONITOR,8,3     ## @NL80211_IFTYPE_MONITOR
	.no_dead_strip	_iwl_mvm_mac_remove_interface
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_mvm_mac_remove_interface
_iwl_mvm_mac_remove_interface:          ; @iwl_mvm_mac_remove_interface
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	bl	_IWL_MAC80211_GET_MVM
	mov	x19, x0
	mov	x0, x20
	bl	_iwl_mvm_vif_from_mac80211
	mov	x22, x0
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_prepare_mac_removal
	ldr	x8, [x20]
Lloh0:
	adrp	x24, _NL80211_IFTYPE_AP@GOTPAGE
Lloh1:
	ldr	x24, [x24, _NL80211_IFTYPE_AP@GOTPAGEOFF]
	ldr	x9, [x24]
Lloh2:
	adrp	x25, _NL80211_IFTYPE_ADHOC@GOTPAGE
Lloh3:
	ldr	x25, [x25, _NL80211_IFTYPE_ADHOC@GOTPAGEOFF]
	ldr	x10, [x25]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_tcm_rm_vif
LBB0_2:
	add	x21, x19, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w23, [x22, #20]
	mov	x0, x21
	bl	_lockdep_is_held
	mov	x1, x0
	mov	x0, x23
	bl	_rcu_dereference_protected
	mov	x23, x0
	ldr	w0, [x22, #20]
	mov	x1, #0
	bl	_RCU_INIT_POINTER
	cbz	x23, LBB0_4
; %bb.3:
Lloh4:
	adrp	x8, _rcu_head@GOTPAGE
Lloh5:
	ldr	x8, [x8, _rcu_head@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kfree_rcu
LBB0_4:
	ldr	x8, [x19, #56]
	cmp	x8, x22
	b.ne	LBB0_6
; %bb.5:
	str	xzr, [x19, #56]
Lloh7:
	adrp	x8, _IEEE80211_VIF_BEACON_FILTER@GOTPAGE
Lloh8:
	ldr	x8, [x8, _IEEE80211_VIF_BEACON_FILTER@GOTPAGEOFF]
Lloh9:
	adrp	x9, _IEEE80211_VIF_SUPPORTS_CQM_RSSI@GOTPAGE
Lloh10:
	ldr	x9, [x9, _IEEE80211_VIF_SUPPORTS_CQM_RSSI@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x20, #8]
	bic	w8, w9, w8
	str	w8, [x20, #8]
LBB0_6:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_8
; %bb.7:
	add	x0, x19, #48
	mov	w1, #0
	mov	w2, #4
	bl	_memset
LBB0_8:
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_vif_dbgfs_clean
	ldr	x8, [x20]
	ldr	x9, [x24]
	ldr	x10, [x25]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_10
; %bb.9:
	add	x1, x22, #16
	mov	x0, x19
	bl	_iwl_mvm_dealloc_int_sta
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_dealloc_bcast_sta
	b	LBB0_17
LBB0_10:
Lloh13:
	adrp	x23, _NL80211_IFTYPE_P2P_DEVICE@GOTPAGE
Lloh14:
	ldr	x23, [x23, _NL80211_IFTYPE_P2P_DEVICE@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.11:
	str	xzr, [x19, #24]
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_rm_p2p_bcast_sta
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_binding_remove_vif
	ldr	x1, [x22, #8]
	mov	x0, x19
	bl	_iwl_mvm_phy_ctxt_unref
	str	xzr, [x22, #8]
LBB0_12:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_15
; %bb.13:
	ldr	x9, [x20]
	ldr	x10, [x23]
	cmp	x9, x10
	b.eq	LBB0_15
; %bb.14:
	sub	x8, x8, #1
	str	x8, [x19, #16]
LBB0_15:
	mov	x0, x19
	bl	_iwl_mvm_power_update_mac
	mov	x0, x19
	mov	x1, x20
	bl	_iwl_mvm_mac_ctxt_remove
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	ldr	w0, [x8, x9, lsl #2]
	mov	x1, #0
	bl	_RCU_INIT_POINTER
	ldr	x8, [x20]
Lloh15:
	adrp	x9, _NL80211_IFTYPE_MONITOR@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NL80211_IFTYPE_MONITOR@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:
	str	wzr, [x19]
LBB0_17:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_IFTYPE_AP,8,3          ; @NL80211_IFTYPE_AP
	.comm	_NL80211_IFTYPE_ADHOC,8,3       ; @NL80211_IFTYPE_ADHOC
	.comm	_rcu_head,4,2                   ; @rcu_head
	.comm	_IEEE80211_VIF_BEACON_FILTER,4,2 ; @IEEE80211_VIF_BEACON_FILTER
	.comm	_IEEE80211_VIF_SUPPORTS_CQM_RSSI,4,2 ; @IEEE80211_VIF_SUPPORTS_CQM_RSSI
	.comm	_NL80211_IFTYPE_P2P_DEVICE,8,3  ; @NL80211_IFTYPE_P2P_DEVICE
	.comm	_NL80211_IFTYPE_MONITOR,8,3     ; @NL80211_IFTYPE_MONITOR
	.no_dead_strip	_iwl_mvm_mac_remove_interface
.subsections_via_symbols
