	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iwl_mvm_pre_channel_switch
_iwl_mvm_pre_channel_switch:            ## @iwl_mvm_pre_channel_switch
	.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	%rdx, %r14
	movq	%rsi, %r12
	callq	_IWL_MAC80211_GET_MVM
	movq	%rax, %r13
	movq	%r12, %rdi
	callq	_iwl_mvm_vif_from_mac80211
	movq	%rax, %r15
	movq	%r13, %rdi
	callq	_mutex_lock
	movl	$0, (%r15)
	movl	16(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_IWL_DEBUG_MAC80211
	movq	%r13, %rbx
	addq	$24, %rbx
	movq	%r12, %rdi
	callq	_ieee80211_vif_to_wdev
	movq	_FW_DBG_TRIGGER_CHANNEL_SWITCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_iwl_fw_dbg_trigger_simple_stop
	movl	(%r12), %eax
	cmpl	$128, %eax
	je	LBB0_9
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_18
## %bb.2:
	movl	16(%r13), %ebx
	movq	%r13, %rdi
	callq	_lockdep_is_held
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_rcu_dereference_protected
	xorl	%edi, %edi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	cmpl	$0, 8(%rax)
	setne	%dil
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	callq	_WARN_ONCE
	testl	%eax, %eax
	jne	LBB0_5
## %bb.6:
	movl	20(%r13), %ebx
	movq	%r13, %rdi
	callq	_lockdep_is_held
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_rcu_dereference_protected
	testq	%rax, %rax
	jne	LBB0_5
## %bb.7:
	movl	16(%r13), %edi
	movq	%r12, %rsi
	callq	_rcu_assign_pointer
	movl	4(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_WARN_ONCE
	testl	%eax, %eax
	je	LBB0_8
LBB0_5:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_20
LBB0_9:
	cmpl	$0, 4(%r14)
	je	LBB0_14
## %bb.10:
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	imull	4(%r12), %eax
	movq	_IWL_MAX_CSA_BLOCK_TX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	cmpl	%edi, %eax
	jg	LBB0_13
	jmp	LBB0_14
LBB0_11:
	movq	_IWL_MAX_CSA_BLOCK_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
LBB0_13:
	movq	%r15, %rbx
	addq	$20, %rbx
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_schedule_delayed_work
LBB0_14:
	movq	8(%r13), %rdi
	movq	_IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_fw_has_capa
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r14, %rdx
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	callq	_iwl_mvm_schedule_client_csa
LBB0_17:
	movl	(%r14), %eax
	movl	%eax, 8(%r15)
	movl	$0, 12(%r15)
LBB0_18:
	movl	$1, 16(%r15)
	movq	%r13, %rdi
	callq	_iwl_mvm_power_update_ps
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:
	movq	%r13, %rdi
	callq	_iwl_mvm_teardown_tdls_peers
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_15:
	callq	_iwl_mvm_old_pre_chan_sw_sta
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_17
LBB0_20:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	8(%r14), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pre CSA to freq %d\n"

	.comm	_FW_DBG_TRIGGER_CHANNEL_SWITCH,4,2 ## @FW_DBG_TRIGGER_CHANNEL_SWITCH
L_.str.1:                               ## @.str.1
	.asciz	"Another CSA is already in progress"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"Previous CSA countdown didn't complete"

	.comm	_IWL_MAX_CSA_BLOCK_TX,4,2       ## @IWL_MAX_CSA_BLOCK_TX
	.comm	_IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD,4,2 ## @IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD
	.no_dead_strip	_iwl_mvm_pre_channel_switch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iwl_mvm_pre_channel_switch
_iwl_mvm_pre_channel_switch:            ; @iwl_mvm_pre_channel_switch
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x22, x1
	bl	_IWL_MAC80211_GET_MVM
	mov	x19, x0
	mov	x0, x22
	bl	_iwl_mvm_vif_from_mac80211
	mov	x21, x0
	mov	x0, x19
	bl	_mutex_lock
	str	wzr, [x21]
	ldr	w2, [x20, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_IWL_DEBUG_MAC80211
	add	x23, x19, #24
	mov	x0, x22
	bl	_ieee80211_vif_to_wdev
	mov	x1, x0
Lloh2:
	adrp	x8, _FW_DBG_TRIGGER_CHANNEL_SWITCH@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FW_DBG_TRIGGER_CHANNEL_SWITCH@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x23
	bl	_iwl_fw_dbg_trigger_simple_stop
	ldr	w8, [x22]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_16
; %bb.2:
	ldr	w23, [x19, #16]
	mov	x0, x19
	bl	_lockdep_is_held
	mov	x1, x0
	mov	x0, x23
	bl	_rcu_dereference_protected
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x0, #8]
	cmp	w8, #0
	cset	w0, ne
LBB0_4:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_WARN_ONCE
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	w23, [x19, #20]
	mov	x0, x19
	bl	_lockdep_is_held
	mov	x1, x0
	mov	x0, x23
	bl	_rcu_dereference_protected
	cbnz	x0, LBB0_7
; %bb.6:
	ldr	w0, [x19, #16]
	mov	x1, x22
	bl	_rcu_assign_pointer
	ldr	w0, [x21, #4]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_WARN_ONCE
	cbz	w0, LBB0_20
LBB0_7:
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_19
LBB0_8:
	ldr	w8, [x20, #4]
	cbz	w8, LBB0_13
; %bb.9:
	ldr	w8, [x20]
	cbz	w8, LBB0_11
; %bb.10:
	ldr	w9, [x22, #4]
	mul	w8, w9, w8
Lloh12:
	adrp	x9, _IWL_MAX_CSA_BLOCK_TX@GOTPAGE
Lloh13:
	ldr	x9, [x9, _IWL_MAX_CSA_BLOCK_TX@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x9]
	cmp	w8, w0
	b.gt	LBB0_12
	b	LBB0_13
LBB0_11:
Lloh15:
	adrp	x8, _IWL_MAX_CSA_BLOCK_TX@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IWL_MAX_CSA_BLOCK_TX@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
LBB0_12:
	add	x23, x21, #20
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x23
	bl	_schedule_delayed_work
LBB0_13:
	ldr	x0, [x19, #8]
Lloh18:
	adrp	x8, _IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_fw_has_capa
	cbz	w0, LBB0_18
; %bb.14:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_iwl_mvm_schedule_client_csa
LBB0_15:
	ldr	w8, [x20]
	stp	w8, wzr, [x21, #8]
LBB0_16:
	mov	w8, #1
	str	w8, [x21, #16]
	mov	x0, x19
	bl	_iwl_mvm_power_update_ps
	mov	x22, x0
	cbnz	w0, LBB0_19
; %bb.17:
	mov	x0, x19
	bl	_iwl_mvm_teardown_tdls_peers
	b	LBB0_19
LBB0_18:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x20
	bl	_iwl_mvm_old_pre_chan_sw_sta
	mov	x22, x0
	cbz	w0, LBB0_15
LBB0_19:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_20:
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	str	w8, [x21, #24]
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pre CSA to freq %d\n"

	.comm	_FW_DBG_TRIGGER_CHANNEL_SWITCH,4,2 ; @FW_DBG_TRIGGER_CHANNEL_SWITCH
l_.str.1:                               ; @.str.1
	.asciz	"Another CSA is already in progress"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"Previous CSA countdown didn't complete"

	.comm	_IWL_MAX_CSA_BLOCK_TX,4,2       ; @IWL_MAX_CSA_BLOCK_TX
	.comm	_IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD,4,2 ; @IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD
	.no_dead_strip	_iwl_mvm_pre_channel_switch
.subsections_via_symbols
