	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ar9003_hw_set_channel
_ar9003_hw_set_channel:                 ## @ar9003_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	-40(%rbp), %rdx
	callq	_ath9k_hw_get_channel_centers
	movl	-40(%rbp), %r12d
	movq	%r15, %rdi
	cmpl	$4799, %r12d                    ## imm = 0x12BF
	jg	LBB0_13
## %bb.1:
	callq	_AR_SREV_9330
	testq	%rax, %rax
	jne	LBB0_7
## %bb.2:
	movq	%r15, %rdi
	callq	_AR_SREV_9485
	testq	%rax, %rax
	jne	LBB0_7
## %bb.3:
	movq	%r15, %rdi
	callq	_AR_SREV_9531
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:
	movq	%r15, %rdi
	callq	_AR_SREV_9550
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:
	movq	%r15, %rdi
	callq	_AR_SREV_9561
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_AR_SREV_9565
	testq	%rax, %rax
	je	LBB0_8
LBB0_7:
	cmpq	$0, 8(%r15)
	movl	$120, %eax
	movl	$75, %ecx
	cmovel	%eax, %ecx
	shll	$2, %r12d
	movl	%r12d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %ebx
	movl	%edx, %eax
	shll	$17, %eax
	cltd
	idivl	%ecx
	shll	$17, %ebx
	orl	%eax, %ebx
	movl	$536870912, %edx                ## imm = 0x20000000
	jmp	LBB0_21
LBB0_13:
	callq	_AR_SREV_9340
	testq	%rax, %rax
	jne	LBB0_17
## %bb.14:
	movq	%r15, %rdi
	callq	_AR_SREV_9550
	testq	%rax, %rax
	jne	LBB0_17
## %bb.15:
	movq	%r15, %rdi
	callq	_AR_SREV_9531
	testq	%rax, %rax
	jne	LBB0_17
## %bb.16:
	movq	%r15, %rdi
	callq	_AR_SREV_9561
	testq	%rax, %rax
	je	LBB0_19
LBB0_17:
	cmpq	$0, 8(%r15)
	je	LBB0_19
## %bb.18:
	movl	%r12d, %eax
	imulq	$458129845, %rax, %rbx          ## imm = 0x1B4E81B5
	shrq	$35, %rbx
	imull	$75, %ebx, %eax
	subl	%eax, %r12d
	shll	$17, %r12d
	imulq	$458129845, %r12, %rax          ## imm = 0x1B4E81B5
	shrq	$35, %rax
	shll	$17, %ebx
	orl	%eax, %ebx
	jmp	LBB0_20
LBB0_19:
	movl	%r12d, %edi
	callq	_CHANSEL_5G
	movl	%eax, %ebx
	sarl	%ebx
LBB0_20:
	xorl	%edx, %edx
LBB0_21:
	movq	_AR_PHY_SYNTH_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_REG_WRITE
	movq	_AR_PHY_65NM_CH0_SYNTH4@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AR_PHY_SYNTH4_LONG_SHIFT_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$1, %ecx
	callq	_REG_RMW_FIELD
	shll	$2, %ebx
	movl	%ebx, %edx
	orl	$1073741824, %edx               ## imm = 0x40000000
	movq	_AR_PHY_65NM_CH0_SYNTH7@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_REG_WRITE
	orl	$-1073741824, %ebx              ## imm = 0xC0000000
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_REG_WRITE
	movq	%r14, (%r15)
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r15, %rdi
	callq	_AR_SREV_9340
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	cmpq	$0, 8(%r15)
	je	LBB0_11
## %bb.10:
	addl	%r12d, %r12d
	movslq	%r12d, %rax
	imulq	$458129845, %rax, %rbx          ## imm = 0x1B4E81B5
	movq	%rbx, %rcx
	shrq	$63, %rcx
	sarq	$35, %rbx
	addl	%ecx, %ebx
	imull	$75, %ebx, %ecx
	subl	%ecx, %eax
	shll	$17, %eax
	cltq
	imulq	$458129845, %rax, %rax          ## imm = 0x1B4E81B5
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$35, %rax
	addl	%ecx, %eax
	shll	$17, %ebx
	orl	%eax, %ebx
	movl	$536870912, %edx                ## imm = 0x20000000
	jmp	LBB0_21
LBB0_12:
	movl	%r12d, %edi
	callq	_CHANSEL_2G
	movl	%eax, %ebx
	movl	$536870912, %edx                ## imm = 0x20000000
	jmp	LBB0_21
LBB0_11:
	movl	%r12d, %edi
	callq	_CHANSEL_2G
	movl	%eax, %ebx
	sarl	%ebx
	movl	$536870912, %edx                ## imm = 0x20000000
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_AR_PHY_SYNTH_CONTROL,4,2       ## @AR_PHY_SYNTH_CONTROL
	.comm	_AR_PHY_65NM_CH0_SYNTH4,4,2     ## @AR_PHY_65NM_CH0_SYNTH4
	.comm	_AR_PHY_SYNTH4_LONG_SHIFT_SELECT,4,2 ## @AR_PHY_SYNTH4_LONG_SHIFT_SELECT
	.comm	_AR_PHY_65NM_CH0_SYNTH7,4,2     ## @AR_PHY_65NM_CH0_SYNTH7
	.no_dead_strip	_ar9003_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 ar9003_hw_set_channel
_ar9003_hw_set_channel:                 ; @ar9003_hw_set_channel
	.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	x19, x1
	mov	x20, x0
	add	x2, sp, #8
	bl	_ath9k_hw_get_channel_centers
	ldr	w21, [sp, #8]
	mov	w8, #4799
	mov	x0, x20
	cmp	w21, w8
	b.gt	LBB0_9
; %bb.1:
	bl	_AR_SREV_9330
	cbnz	x0, LBB0_7
; %bb.2:
	mov	x0, x20
	bl	_AR_SREV_9485
	cbnz	x0, LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_AR_SREV_9531
	cbnz	x0, LBB0_7
; %bb.4:
	mov	x0, x20
	bl	_AR_SREV_9550
	cbnz	x0, LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_AR_SREV_9561
	cbnz	x0, LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_AR_SREV_9565
	cbz	x0, LBB0_17
LBB0_7:
	ldr	x8, [x20, #8]
	cmp	x8, #0
	mov	w8, #75
	mov	w9, #120
	csel	w8, w9, w8, eq
	lsl	w9, w21, #2
	sdiv	w10, w9, w8
	msub	w9, w10, w8, w9
	lsl	w9, w9, #17
	sdiv	w8, w9, w8
LBB0_8:
	orr	w21, w8, w10, lsl #17
	mov	w2, #536870912
	b	LBB0_16
LBB0_9:
	bl	_AR_SREV_9340
	cbnz	x0, LBB0_13
; %bb.10:
	mov	x0, x20
	bl	_AR_SREV_9550
	cbnz	x0, LBB0_13
; %bb.11:
	mov	x0, x20
	bl	_AR_SREV_9531
	cbnz	x0, LBB0_13
; %bb.12:
	mov	x0, x20
	bl	_AR_SREV_9561
	cbz	x0, LBB0_15
LBB0_13:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_15
; %bb.14:
	mov	w2, #0
	mov	w8, #33205
	movk	w8, #6990, lsl #16
	umull	x9, w21, w8
	lsr	x9, x9, #35
	mov	w10, #75
	msub	w10, w9, w10, w21
	lsl	w10, w10, #17
	umull	x8, w10, w8
	lsr	x8, x8, #35
	orr	w21, w8, w9, lsl #17
	b	LBB0_16
LBB0_15:
	mov	x0, x21
	bl	_CHANSEL_5G
	mov	w2, #0
	asr	w21, w0, #1
LBB0_16:
Lloh0:
	adrp	x8, _AR_PHY_SYNTH_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AR_PHY_SYNTH_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_REG_WRITE
Lloh3:
	adrp	x8, _AR_PHY_65NM_CH0_SYNTH4@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR_PHY_65NM_CH0_SYNTH4@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _AR_PHY_SYNTH4_LONG_SHIFT_SELECT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AR_PHY_SYNTH4_LONG_SHIFT_SELECT@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w3, #1
	bl	_REG_RMW_FIELD
	lsl	w21, w21, #2
	orr	w2, w21, #0x40000000
Lloh9:
	adrp	x22, _AR_PHY_65NM_CH0_SYNTH7@GOTPAGE
Lloh10:
	ldr	x22, [x22, _AR_PHY_65NM_CH0_SYNTH7@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_REG_WRITE
	orr	w2, w21, #0xc0000000
	ldr	w1, [x22]
	mov	x0, x20
	bl	_REG_WRITE
	str	x19, [x20]
	mov	w0, #0
	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
LBB0_17:
	mov	x0, x20
	bl	_AR_SREV_9340
	cbz	x0, LBB0_20
; %bb.18:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_21
; %bb.19:
	lsl	w8, w21, #1
	mov	w9, #33205
	movk	w9, #6990, lsl #16
	smull	x10, w8, w9
	lsr	x11, x10, #63
	asr	x10, x10, #35
	add	w10, w10, w11
	mov	w11, #75
	msub	w8, w10, w11, w8
	lsl	w8, w8, #17
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w8, w8, w9
	b	LBB0_8
LBB0_20:
	mov	x0, x21
	bl	_CHANSEL_2G
	mov	x21, x0
	mov	w2, #536870912
	b	LBB0_16
LBB0_21:
	mov	x0, x21
	bl	_CHANSEL_2G
	asr	w21, w0, #1
	mov	w2, #536870912
	b	LBB0_16
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AR_PHY_SYNTH_CONTROL,4,2       ; @AR_PHY_SYNTH_CONTROL
	.comm	_AR_PHY_65NM_CH0_SYNTH4,4,2     ; @AR_PHY_65NM_CH0_SYNTH4
	.comm	_AR_PHY_SYNTH4_LONG_SHIFT_SELECT,4,2 ; @AR_PHY_SYNTH4_LONG_SHIFT_SELECT
	.comm	_AR_PHY_65NM_CH0_SYNTH7,4,2     ; @AR_PHY_65NM_CH0_SYNTH7
	.no_dead_strip	_ar9003_hw_set_channel
.subsections_via_symbols
