	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath9k_mci_update_wlan_channels ## -- Begin function ath9k_mci_update_wlan_channels
	.p2align	4, 0x90
_ath9k_mci_update_wlan_channels:        ## @ath9k_mci_update_wlan_channels
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r15
	movq	(%r15), %rbx
	movaps	L___const.ath9k_mci_update_wlan_channels.channelmap(%rip), %xmm0
	movaps	%xmm0, -64(%rbp)
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.1:
	movl	%esi, %r14d
	movq	%rbx, %rdi
	callq	_IS_CHAN_2GHZ
	testl	%eax, %eax
	je	LBB0_11
## %bb.2:
	xorl	%ecx, %ecx
	testl	%r14d, %r14d
	jne	LBB0_10
## %bb.3:
	movl	(%rbx), %r13d
	leal	-2402(%r13), %r14d
	leal	-2412(%r13), %r12d
	movq	%rbx, %rdi
	callq	_IS_CHAN_HT40PLUS
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	addl	$-2372, %r13d                   ## imm = 0xF6BC
	jmp	LBB0_6
LBB0_5:
	leal	-2392(%r13), %eax
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_IS_CHAN_HT40MINUS
	addl	$-2432, %r13d                   ## imm = 0xF680
	testq	%rax, %rax
	cmovel	%r12d, %r13d
	movl	%r13d, %r12d
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r13d
LBB0_6:
	leal	-7(%r12), %ebx
	addl	$7, %r13d
	xorl	%eax, %eax
	cmpl	$8, %r12d
	cmovll	%eax, %ebx
	movq	_ATH_MCI_NUM_BT_CHANNELS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-1(%rax), %r12d
	cmpl	%eax, %r13d
	cmovll	%r13d, %r12d
	movq	%r15, %rdi
	callq	_ath9k_hw_common
	movq	_MCI@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str(%rip), %rdx
	movl	%eax, %edi
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	movl	%r12d, %r9d
	callq	_ath_dbg
	xorl	%ecx, %ecx
	cmpl	%r12d, %ebx
	jge	LBB0_10
## %bb.7:
	leaq	-64(%rbp), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_MCI_GPM_CLR_CHANNEL_BIT
	incl	%ebx
	cmpl	%ebx, %r12d
	jne	LBB0_8
## %bb.9:
	movl	-64(%rbp), %ecx
LBB0_10:
	movq	8(%r15), %rax
	movl	%ecx, (%rax)
	movl	-60(%rbp), %ecx
	movl	%ecx, 4(%rax)
	movl	-56(%rbp), %ecx
	movl	%ecx, 8(%rax)
	movl	-52(%rbp), %ecx
	movl	%ecx, 12(%rax)
	movq	%r15, %rdi
	callq	_ar9003_mci_send_wlan_channels
	movq	_MCI_STATE_SEND_VERSION_QUERY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_ar9003_mci_state
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @__const.ath9k_mci_update_wlan_channels.channelmap
L___const.ath9k_mci_update_wlan_channels.channelmap:
	.long	0                               ## 0x0
	.long	4294901760                      ## 0xffff0000
	.long	4294967295                      ## 0xffffffff
	.long	2147483647                      ## 0x7fffffff

	.comm	_ATH_MCI_NUM_BT_CHANNELS,4,2    ## @ATH_MCI_NUM_BT_CHANNELS
	.comm	_MCI,4,2                        ## @MCI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WLAN current channel %d mask BT channel %d - %d\n"

	.comm	_MCI_STATE_SEND_VERSION_QUERY,4,2 ## @MCI_STATE_SEND_VERSION_QUERY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ath9k_mci_update_wlan_channels ; -- Begin function ath9k_mci_update_wlan_channels
	.p2align	2
_ath9k_mci_update_wlan_channels:        ; @ath9k_mci_update_wlan_channels
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x19, [x0]
	ldr	x21, [x19]
Lloh3:
	adrp	x8, l___const.ath9k_mci_update_wlan_channels.channelmap@PAGE
Lloh4:
	add	x8, x8, l___const.ath9k_mci_update_wlan_channels.channelmap@PAGEOFF
Lloh5:
	ldr	q0, [x8]
	str	q0, [sp]
	cbz	x21, LBB0_11
; %bb.1:
	mov	x20, x1
	mov	x0, x21
	bl	_IS_CHAN_2GHZ
	cbz	w0, LBB0_11
; %bb.2:
	cbz	w20, LBB0_4
; %bb.3:
	mov	w8, #0
	b	LBB0_10
LBB0_4:
	ldr	w24, [x21]
	sub	w20, w24, #2402
	sub	w22, w24, #2412
	mov	x0, x21
	bl	_IS_CHAN_HT40PLUS
	cbz	x0, LBB0_6
; %bb.5:
	sub	w23, w24, #2372
	b	LBB0_7
LBB0_6:
	sub	w23, w24, #2392
	mov	x0, x21
	bl	_IS_CHAN_HT40MINUS
	sub	w8, w24, #2432
	cmp	x0, #0
	csel	w22, w22, w8, eq
LBB0_7:
	sub	w8, w22, #7
	add	w9, w23, #7
	cmp	w22, #8
	csel	w21, wzr, w8, lt
Lloh6:
	adrp	x8, _ATH_MCI_NUM_BT_CHANNELS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATH_MCI_NUM_BT_CHANNELS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	sub	w10, w8, #1
	cmp	w9, w8
	csel	w22, w9, w10, lt
	mov	x0, x19
	bl	_ath9k_hw_common
Lloh9:
	adrp	x8, _MCI@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MCI@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x3, x20
	mov	x4, x21
	mov	x5, x22
	bl	_ath_dbg
	mov	w8, #0
	cmp	w21, w22
	b.ge	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, sp
	mov	x1, x21
	bl	_MCI_GPM_CLR_CHANNEL_BIT
	add	w21, w21, #1
	cmp	w22, w21
	b.ne	LBB0_8
; %bb.9:
	ldr	w8, [sp]
LBB0_10:
	ldr	x9, [x19, #8]
	str	w8, [x9]
	ldr	w8, [sp, #4]
	str	w8, [x9, #4]
	ldr	w8, [sp, #8]
	str	w8, [x9, #8]
	ldr	w8, [sp, #12]
	str	w8, [x9, #12]
	mov	x0, x19
	bl	_ar9003_mci_send_wlan_channels
Lloh14:
	adrp	x8, _MCI_STATE_SEND_VERSION_QUERY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MCI_STATE_SEND_VERSION_QUERY@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ar9003_mci_state
LBB0_11:
	ldr	x8, [sp, #24]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAddLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__literal16,16byte_literals
	.p2align	2                               ; @__const.ath9k_mci_update_wlan_channels.channelmap
l___const.ath9k_mci_update_wlan_channels.channelmap:
	.long	0                               ; 0x0
	.long	4294901760                      ; 0xffff0000
	.long	4294967295                      ; 0xffffffff
	.long	2147483647                      ; 0x7fffffff

	.comm	_ATH_MCI_NUM_BT_CHANNELS,4,2    ; @ATH_MCI_NUM_BT_CHANNELS
	.comm	_MCI,4,2                        ; @MCI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WLAN current channel %d mask BT channel %d - %d\n"

	.comm	_MCI_STATE_SEND_VERSION_QUERY,4,2 ; @MCI_STATE_SEND_VERSION_QUERY
.subsections_via_symbols
