	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar5008_hw_set_channel
_ar5008_hw_set_channel:                 ## @ar5008_hw_set_channel
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_ath9k_hw_common
	movq	%rax, %r12
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ath9k_hw_get_channel_centers
	movl	-56(%rbp), %r14d
	cmpl	$4799, %r14d                    ## imm = 0x12BF
	jg	LBB0_10
## %bb.1:
	imull	$-858993459, %r14d, %eax        ## imm = 0xCCCCCCCD
	leal	2147483209(%rax), %ecx
	cmpl	$858993459, %ecx                ## imm = 0x33333333
	jb	LBB0_2
## %bb.3:
	addl	$-429497175, %eax               ## imm = 0xE66664A9
	cmpl	$858993458, %eax                ## imm = 0x33333332
	ja	LBB0_22
## %bb.4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$2, %ebx
	movl	$-4448, %eax                    ## imm = 0xEEA0
	jmp	LBB0_5
LBB0_10:
	cmpl	$5120, %r14d                    ## imm = 0x1400
	jb	LBB0_13
## %bb.11:
	movl	%r14d, %eax
	movl	$3435973837, %ecx               ## imm = 0xCCCCCCCD
	imulq	%rax, %rcx
	shrq	$36, %rcx
	shll	$2, %ecx
	leal	(%rcx,%rcx,4), %eax
	movl	%r14d, %ecx
	subl	%eax, %ecx
	jne	LBB0_13
## %bb.12:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leal	-4800(%r14), %eax
	movl	$3435973837, %edi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdi
	shrq	$34, %rdi
	andl	$-4, %edi
LBB0_20:
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8, %esi
	callq	_ath9k_hw_reverse_bits
	movl	%eax, %r12d
LBB0_21:
	movl	$1, %edi
	jmp	LBB0_17
LBB0_13:
	imull	$-858993459, %r14d, %eax        ## imm = 0xCCCCCCCD
	movl	%eax, %ecx
	rorl	%ecx
	cmpl	$429496729, %ecx                ## imm = 0x19999999
	jbe	LBB0_14
## %bb.18:
	cmpl	$858993459, %eax                ## imm = 0x33333333
	jbe	LBB0_19
LBB0_22:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_ath_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_23
LBB0_2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movl	$-4384, %eax                    ## imm = 0xEEE0
LBB0_5:
	leal	(%rax,%r14,2), %eax
	cltq
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	shrq	$34, %rax
	addl	%ecx, %eax
	shll	$2, %eax
	movzbl	%al, %edi
	movl	$8, %esi
	callq	_ath9k_hw_reverse_bits
	movl	%eax, %r12d
	movq	_AR_PHY_CCK_TX_CTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r15, %rdi
	callq	_REG_READ
	movl	(%r13), %esi
	movq	_AR_PHY_CCK_TX_CTRL_JAPAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	$2484, %r14d                    ## imm = 0x9B4
	jne	LBB0_9
## %bb.6:
	orl	%eax, %edx
	movq	%r15, %rdi
	jmp	LBB0_7
LBB0_9:
	notl	%edx
	andl	%edx, %eax
	movq	%r15, %rdi
	movl	%eax, %edx
LBB0_7:
	callq	_REG_WRITE
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_14:
	leal	-4800(%r14), %eax
	movl	$3435973837, %edi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdi
	shrq	$34, %rdi
	andl	$-2, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	movl	$8, %esi
	callq	_ath9k_hw_reverse_bits
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_AR_SREV_9100
	testq	%rax, %rax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_16
## %bb.15:
	movq	%r15, %rdi
	callq	_AR_SREV_9160_10_OR_LATER
	testq	%rax, %rax
	je	LBB0_21
LBB0_16:
	movl	$2, %edi
LBB0_17:
	movl	$2, %esi
	callq	_ath9k_hw_reverse_bits
	movl	%eax, %r13d
	xorl	%ebx, %ebx
LBB0_8:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_ar5008_hw_force_bias
	shll	$8, %r12d
	leal	(%rbx,%r13,4), %ebx
	orl	%r12d, %ebx
	orl	$33, %ebx
	movl	$55, %edi
	callq	_AR_PHY
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_REG_WRITE
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r15)
	xorl	%eax, %eax
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leal	-4800(%r14), %eax
	movl	$3435973837, %edi               ## imm = 0xCCCCCCCD
	imulq	%rax, %rdi
	shrq	$34, %rdi
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid channel %u MHz\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AR_PHY_CCK_TX_CTRL,4,2         ## @AR_PHY_CCK_TX_CTRL
	.comm	_AR_PHY_CCK_TX_CTRL_JAPAN,4,2   ## @AR_PHY_CCK_TX_CTRL_JAPAN
	.no_dead_strip	_ar5008_hw_set_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ar5008_hw_set_channel
_ar5008_hw_set_channel:                 ; @ar5008_hw_set_channel
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_ath9k_hw_common
	mov	x22, x0
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_ath9k_hw_get_channel_centers
	ldr	w21, [sp, #8]
	mov	w8, #4799
	cmp	w21, w8
	b.gt	LBB0_4
; %bb.1:
	sub	w10, w21, #2192
	mov	w8, #52429
	movk	w8, #52428, lsl #16
	mov	w9, #39321
	movk	w9, #6553, lsl #16
	madd	w10, w10, w8, w9
	mov	w11, #858993459
	cmp	w10, w11
	b.lo	LBB0_11
; %bb.2:
	sub	w10, w21, #2224
	madd	w8, w10, w8, w9
	mov	w9, #13106
	movk	w9, #13107, lsl #16
	cmp	w8, w9
	b.hi	LBB0_7
; %bb.3:
	mov	w24, #2
	mov	w8, #-4448
	b	LBB0_12
LBB0_4:
	mov	w8, #52429
	movk	w8, #52428, lsl #16
	umull	x9, w21, w8
	lsr	x9, x9, #36
	mov	w10, #20
	msub	w9, w9, w10, w21
	lsr	w10, w21, #10
	cmp	w10, #5
	ccmp	w9, #0, #0, hs
	b.eq	LBB0_8
; %bb.5:
	mul	w8, w21, w8
	ror	w8, w8, #1
	mov	w9, #39321
	movk	w9, #6553, lsl #16
	cmp	w8, w9
	b.ls	LBB0_16
; %bb.6:
	mov	w8, #52429
	movk	w8, #52428, lsl #16
	mul	w9, w21, w8
	mov	w10, #858993459
	cmp	w9, w10
	b.ls	LBB0_22
LBB0_7:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_ath_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_21
LBB0_8:
	mov	w9, #-4800
	add	w9, w21, w9
	umull	x8, w9, w8
	lsr	x8, x8, #34
	and	w0, w8, #0x3ffffffc
LBB0_9:
	mov	w1, #8
	bl	_ath9k_hw_reverse_bits
	mov	x22, x0
LBB0_10:
	mov	w0, #1
	b	LBB0_19
LBB0_11:
	mov	w24, #0
	mov	w8, #-4384
LBB0_12:
	add	w8, w8, w21, lsl #1
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	lsr	x8, x8, #34
	add	w8, w8, w9
	ubfiz	w0, w8, #2, #6
	mov	w1, #8
	bl	_ath9k_hw_reverse_bits
	mov	x22, x0
Lloh5:
	adrp	x23, _AR_PHY_CCK_TX_CTRL@GOTPAGE
Lloh6:
	ldr	x23, [x23, _AR_PHY_CCK_TX_CTRL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_REG_READ
	ldr	w1, [x23]
Lloh7:
	adrp	x8, _AR_PHY_CCK_TX_CTRL_JAPAN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _AR_PHY_CCK_TX_CTRL_JAPAN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w21, #2484
	b.ne	LBB0_14
; %bb.13:
	orr	w2, w8, w0
	b	LBB0_15
LBB0_14:
	bic	w2, w0, w8
LBB0_15:
	mov	x0, x20
	bl	_REG_WRITE
	mov	w23, #0
	b	LBB0_20
LBB0_16:
	mov	w8, #-4800
	add	w8, w21, w8
	mov	w9, #52429
	movk	w9, #52428, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #34
	and	w0, w8, #0x3ffffffe
	mov	w1, #8
	bl	_ath9k_hw_reverse_bits
	mov	x22, x0
	mov	x0, x20
	bl	_AR_SREV_9100
	cbnz	x0, LBB0_18
; %bb.17:
	mov	x0, x20
	bl	_AR_SREV_9160_10_OR_LATER
	cbz	x0, LBB0_10
LBB0_18:
	mov	w0, #2
LBB0_19:
	mov	w1, #2
	bl	_ath9k_hw_reverse_bits
	mov	x23, x0
	mov	w24, #0
LBB0_20:
	mov	x0, x20
	mov	x1, x21
	bl	_ar5008_hw_force_bias
	bfi	w24, w23, #2, #30
	orr	w8, w24, w22, lsl #8
	mov	w9, #33
	orr	w21, w8, w9
	mov	w0, #55
	bl	_AR_PHY
	mov	x1, x0
	mov	x0, x20
	mov	x2, x21
	bl	_REG_WRITE
	mov	w0, #0
	str	x19, [x20]
LBB0_21:
	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
	add	sp, sp, #80
	ret
LBB0_22:
	mov	w9, #-4800
	add	w9, w21, w9
	umull	x8, w9, w8
	lsr	x0, x8, #34
                                        ; kill: def $w0 killed $w0 killed $x0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid channel %u MHz\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AR_PHY_CCK_TX_CTRL,4,2         ; @AR_PHY_CCK_TX_CTRL
	.comm	_AR_PHY_CCK_TX_CTRL_JAPAN,4,2   ; @AR_PHY_CCK_TX_CTRL_JAPAN
	.no_dead_strip	_ar5008_hw_set_channel
.subsections_via_symbols
