	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ath5k_hw_rf5111_channel
_ath5k_hw_rf5111_channel:               ## @ath5k_hw_rf5111_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, %rbx
	movq	%rdi, %r14
	movl	8(%rsi), %edi
	callq	_ieee80211_frequency_to_channel
	movl	%eax, %r12d
	movq	(%rbx), %rax
	movq	_NL80211_BAND_2GHZ@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.1:
	movl	8(%rbx), %edi
	callq	_ieee80211_frequency_to_channel
	leaq	-40(%rbp), %rsi
	movl	%eax, %edi
	callq	_ath5k_hw_rf5111_chan2athchan
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movl	-40(%rbp), %r12d
	movl	-36(%rbp), %edi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movzbl	%al, %r15d
	shll	$5, %r15d
	orl	$16, %r15d
LBB0_3:
	cmpl	$145, %r12d
	setb	%al
	testb	$1, %r12b
	sete	%cl
	orb	%al, %cl
	addl	$-24, %r12d
	movzbl	%cl, %ebx
	xorb	$1, %cl
	shrl	%cl, %r12d
	movl	%r12d, %edi
	movl	$8, %esi
	callq	_ath5k_hw_bitswap
	movzbl	%al, %eax
	shll	$2, %eax
	leal	(%rax,%rbx,2), %ebx
	addl	$1025, %ebx                     ## imm = 0x401
	movzbl	%bl, %eax
	movl	%r15d, %ecx
	shll	$8, %ecx
	movzwl	%cx, %esi
	orl	%eax, %esi
	movq	_AR5K_RF_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_ath5k_hw_reg_write
	shrl	$8, %ebx
	andl	$7936, %r15d                    ## imm = 0x1F00
	orl	%ebx, %r15d
	movq	_AR5K_RF_BUFFER_CONTROL_3@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_ath5k_hw_reg_write
	xorl	%eax, %eax
LBB0_4:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ## @NL80211_BAND_2GHZ
	.comm	_AR5K_RF_BUFFER,4,2             ## @AR5K_RF_BUFFER
	.comm	_AR5K_RF_BUFFER_CONTROL_3,4,2   ## @AR5K_RF_BUFFER_CONTROL_3
	.no_dead_strip	_ath5k_hw_rf5111_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ath5k_hw_rf5111_channel
_ath5k_hw_rf5111_channel:               ; @ath5k_hw_rf5111_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	x21, x1
	mov	x19, x0
	ldr	w0, [x1, #8]
	bl	_ieee80211_frequency_to_channel
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _NL80211_BAND_2GHZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NL80211_BAND_2GHZ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w0, [x21, #8]
	bl	_ieee80211_frequency_to_channel
	add	x1, sp, #8
	bl	_ath5k_hw_rf5111_chan2athchan
	cbnz	w0, LBB0_5
; %bb.2:
	ldp	w20, w0, [sp, #8]
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	mov	w21, #16
	bfi	w21, w0, #5, #8
	b	LBB0_4
LBB0_3:
	mov	x20, x0
	mov	w21, #0
LBB0_4:
	tst	w20, #0x1
	mov	w8, #145
	ccmp	w20, w8, #0, ne
	cset	w8, lo
	sub	w9, w20, #24
	eor	w10, w8, #0x1
	lsr	w0, w9, w10
	mov	w9, #1025
	mov	w10, #1027
	cmp	w8, #0
	csel	w20, w10, w9, ne
	mov	w1, #8
	bl	_ath5k_hw_bitswap
	bfi	w20, w0, #2, #8
	and	w1, w20, #0xff
	bfi	w1, w21, #8, #8
Lloh3:
	adrp	x8, _AR5K_RF_BUFFER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AR5K_RF_BUFFER@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ath5k_hw_reg_write
	and	w8, w21, #0x1f00
	orr	w1, w8, w20, lsr #8
Lloh6:
	adrp	x8, _AR5K_RF_BUFFER_CONTROL_3@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AR5K_RF_BUFFER_CONTROL_3@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_ath5k_hw_reg_write
	mov	w0, #0
LBB0_5:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NL80211_BAND_2GHZ,8,3          ; @NL80211_BAND_2GHZ
	.comm	_AR5K_RF_BUFFER,4,2             ; @AR5K_RF_BUFFER
	.comm	_AR5K_RF_BUFFER_CONTROL_3,4,2   ; @AR5K_RF_BUFFER_CONTROL_3
	.no_dead_strip	_ath5k_hw_rf5111_channel
.subsections_via_symbols
