	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max2820_rf_set_channel
_max2820_rf_set_channel:                ## @max2820_rf_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	(%rsi), %rax
	movl	(%rax), %edi
	callq	_ieee80211_frequency_to_channel
	movl	%eax, %r14d
	jmp	LBB0_3
LBB0_1:
	movl	$1, %r14d
LBB0_3:
	leal	-1(%r14), %eax
	movq	(%r15), %rcx
	movzbl	(%rcx,%rax,4), %edx
	movq	_max2820_chan@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,4), %r15d
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_rtl8180_write_phy
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_max2820_write_phy_antenna
	movq	%rbx, %rdi
	movl	$3, %esi
	movl	%r15d, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_write_max2820                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_max2820_chan,8,3               ## @max2820_chan
	.no_dead_strip	_max2820_rf_set_channel
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max2820_rf_set_channel
_max2820_rf_set_channel:                ; @max2820_rf_set_channel
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	ldr	x21, [x0]
	cbz	x1, LBB0_2
; %bb.1:
	ldr	x8, [x1]
	ldr	w0, [x8]
	bl	_ieee80211_frequency_to_channel
	mov	x20, x0
	b	LBB0_3
LBB0_2:
	mov	w20, #1
LBB0_3:
	sub	w8, w20, #1
	ldr	x9, [x21]
	lsl	x8, x8, #2
	ldrb	w2, [x9, x8]
Lloh0:
	adrp	x9, _max2820_chan@GOTPAGE
Lloh1:
	ldr	x9, [x9, _max2820_chan@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w21, [x9, x8]
	mov	x0, x19
	mov	w1, #3
	bl	_rtl8180_write_phy
	mov	x0, x19
	mov	x1, x20
	bl	_max2820_write_phy_antenna
	mov	x0, x19
	mov	w1, #3
	mov	x2, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_write_max2820
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_max2820_chan,8,3               ; @max2820_chan
	.no_dead_strip	_max2820_rf_set_channel
.subsections_via_symbols
