	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl18xx_cmd_channel_switch      ## -- Begin function wl18xx_cmd_channel_switch
	.p2align	4, 0x90
_wl18xx_cmd_channel_switch:             ## @wl18xx_cmd_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_DEBUG_ACX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%rdx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_wl1271_debug
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$28, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movl	24(%r15), %eax
	movl	%eax, 24(%r12)
	movq	(%rbx), %rax
	movl	4(%rax), %ecx
	movl	%ecx, 20(%r12)
	movl	12(%rbx), %ecx
	movl	%ecx, 16(%r12)
	movl	8(%rbx), %ecx
	movl	%ecx, 12(%r12)
	movl	(%rax), %esi
	cmpl	$129, %esi
	je	LBB0_3
## %bb.4:
	cmpl	$128, %esi
	jne	LBB0_13
## %bb.5:
	movq	_WLCORE_BAND_5GHZ@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_3:
	movq	_WLCORE_BAND_2_4GHZ@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	movq	_CONF_TX_ENABLED_RATES@GOTPCREL(%rip), %rax
	movq	_CONF_TX_MCS_RATES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rax), %ebx
	movq	(%r15), %rax
	movq	_BSS_TYPE_STA_BSS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_wlcore_hw_sta_get_ap_rate_mask
	jmp	LBB0_9
LBB0_13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_wl1271_error
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_wlcore_hw_ap_get_mimo_wide_rate_mask
LBB0_9:
	orl	%eax, %ebx
	movq	_CONF_TX_CCK_RATES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	xorl	%edi, %edi
	cmpq	$1, 16(%r15)
	sbbl	%edi, %edi
	orl	%eax, %edi
	andl	%ebx, %edi
	callq	_cpu_to_le32
	movl	%eax, 4(%r12)
	movl	8(%r15), %eax
	movl	%eax, (%r12)
	movq	_CMD_CHANNEL_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r12, %rdx
	movl	$28, %ecx
	xorl	%r8d, %r8d
	callq	_wl1271_cmd_send
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_11
## %bb.10:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_wl1271_error
LBB0_11:
	movq	%r12, %rdi
	callq	_kfree
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBUG_ACX,4,2                  ## @DEBUG_ACX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmd channel switch (count=%d)"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_WLCORE_BAND_2_4GHZ,4,2         ## @WLCORE_BAND_2_4GHZ
	.comm	_WLCORE_BAND_5GHZ,4,2           ## @WLCORE_BAND_5GHZ
L_.str.1:                               ## @.str.1
	.asciz	"invalid channel switch band: %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CONF_TX_ENABLED_RATES,4,2      ## @CONF_TX_ENABLED_RATES
	.comm	_CONF_TX_MCS_RATES,4,2          ## @CONF_TX_MCS_RATES
	.comm	_BSS_TYPE_STA_BSS,8,3           ## @BSS_TYPE_STA_BSS
	.comm	_CONF_TX_CCK_RATES,4,2          ## @CONF_TX_CCK_RATES
	.comm	_CMD_CHANNEL_SWITCH,4,2         ## @CMD_CHANNEL_SWITCH
L_.str.2:                               ## @.str.2
	.asciz	"failed to send channel switch command"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_wl18xx_cmd_channel_switch      ; -- Begin function wl18xx_cmd_channel_switch
	.p2align	2
_wl18xx_cmd_channel_switch:             ; @wl18xx_cmd_channel_switch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _DEBUG_ACX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBUG_ACX@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w2, [x2, #12]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wl1271_debug
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w0, #28
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w8, [x21, #24]
	ldr	x9, [x22]
	ldr	w10, [x9, #4]
	stp	w10, w8, [x0, #20]
	ldr	d0, [x22, #8]
	stur	d0, [x0, #12]
	ldr	w8, [x9]
	cmp	w8, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.3:
Lloh8:
	adrp	x8, _WLCORE_BAND_5GHZ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _WLCORE_BAND_5GHZ@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_5:
Lloh13:
	adrp	x8, _WLCORE_BAND_2_4GHZ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _WLCORE_BAND_2_4GHZ@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh15:
	adrp	x8, _CONF_TX_ENABLED_RATES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CONF_TX_ENABLED_RATES@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _CONF_TX_MCS_RATES@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CONF_TX_MCS_RATES@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w22, w9, w8
	ldr	x8, [x21]
Lloh21:
	adrp	x9, _BSS_TYPE_STA_BSS@GOTPAGE
Lloh22:
	ldr	x9, [x9, _BSS_TYPE_STA_BSS@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	mov	x0, x20
	mov	x1, x21
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	bl	_wlcore_hw_sta_get_ap_rate_mask
	b	LBB0_10
LBB0_8:
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_wl1271_error
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_9:
	bl	_wlcore_hw_ap_get_mimo_wide_rate_mask
LBB0_10:
	orr	w8, w22, w0
Lloh29:
	adrp	x9, _CONF_TX_CCK_RATES@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CONF_TX_CCK_RATES@GOTPAGEOFF]
	ldr	x10, [x21, #16]
Lloh31:
	ldr	w9, [x9]
	cmp	x10, #0
	mov	w10, #-1
	csinv	w9, w10, w9, eq
	and	w0, w9, w8
	bl	_cpu_to_le32
	ldr	w8, [x21, #8]
	stp	w8, w0, [x19]
Lloh32:
	adrp	x8, _CMD_CHANNEL_SWITCH@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CMD_CHANNEL_SWITCH@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x19
	mov	w3, #28
	mov	w4, #0
	bl	_wl1271_cmd_send
	mov	x20, x0
	tbz	w0, #31, LBB0_12
; %bb.11:
Lloh35:
	adrp	x0, l_.str.2@PAGE
Lloh36:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_wl1271_error
LBB0_12:
	mov	x0, x19
	bl	_kfree
LBB0_13:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBUG_ACX,4,2                  ; @DEBUG_ACX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmd channel switch (count=%d)"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_WLCORE_BAND_2_4GHZ,4,2         ; @WLCORE_BAND_2_4GHZ
	.comm	_WLCORE_BAND_5GHZ,4,2           ; @WLCORE_BAND_5GHZ
l_.str.1:                               ; @.str.1
	.asciz	"invalid channel switch band: %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CONF_TX_ENABLED_RATES,4,2      ; @CONF_TX_ENABLED_RATES
	.comm	_CONF_TX_MCS_RATES,4,2          ; @CONF_TX_MCS_RATES
	.comm	_BSS_TYPE_STA_BSS,8,3           ; @BSS_TYPE_STA_BSS
	.comm	_CONF_TX_CCK_RATES,4,2          ; @CONF_TX_CCK_RATES
	.comm	_CMD_CHANNEL_SWITCH,4,2         ; @CMD_CHANNEL_SWITCH
l_.str.2:                               ; @.str.2
	.asciz	"failed to send channel switch command"

.subsections_via_symbols
