	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2500usb_rf_write
_rt2500usb_rf_write:                    ## @rt2500usb_rf_write
	.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
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_mutex_lock
	leaq	-40(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_WAIT_FOR_RF
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	$0, -40(%rbp)
	movq	_PHY_CSR9_RF_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %r12
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR9@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_rt2500usb_register_write_lock
	movq	$0, -40(%rbp)
	movq	_PHY_CSR10_RF_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	sarl	$16, %edx
	movq	%r12, %rdi
	callq	_rt2x00_set_field16
	movq	_PHY_CSR10_RF_NUMBER_OF_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$20, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR10_RF_IF_SELECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR10_RF_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field16
	movq	_PHY_CSR10@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_rt2500usb_register_write_lock
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_rt2x00_rf_write
LBB0_2:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PHY_CSR9_RF_VALUE,4,2          ## @PHY_CSR9_RF_VALUE
	.comm	_PHY_CSR9,4,2                   ## @PHY_CSR9
	.comm	_PHY_CSR10_RF_VALUE,4,2         ## @PHY_CSR10_RF_VALUE
	.comm	_PHY_CSR10_RF_NUMBER_OF_BITS,4,2 ## @PHY_CSR10_RF_NUMBER_OF_BITS
	.comm	_PHY_CSR10_RF_IF_SELECT,4,2     ## @PHY_CSR10_RF_IF_SELECT
	.comm	_PHY_CSR10_RF_BUSY,4,2          ## @PHY_CSR10_RF_BUSY
	.comm	_PHY_CSR10,4,2                  ## @PHY_CSR10
	.no_dead_strip	_rt2500usb_rf_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2500usb_rf_write
_rt2500usb_rf_write:                    ; @rt2500usb_rf_write
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_mutex_lock
	add	x1, sp, #8
	mov	x0, x19
	bl	_WAIT_FOR_RF
	cbz	x0, LBB0_2
; %bb.1:
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _PHY_CSR9_RF_VALUE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PHY_CSR9_RF_VALUE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	x2, x20
	bl	_rt2x00_set_field16
Lloh3:
	adrp	x8, _PHY_CSR9@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PHY_CSR9@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_rt2500usb_register_write_lock
	str	xzr, [sp, #8]
Lloh6:
	adrp	x8, _PHY_CSR10_RF_VALUE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PHY_CSR10_RF_VALUE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	asr	w2, w20, #16
	add	x0, sp, #8
	bl	_rt2x00_set_field16
Lloh9:
	adrp	x8, _PHY_CSR10_RF_NUMBER_OF_BITS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PHY_CSR10_RF_NUMBER_OF_BITS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #20
	bl	_rt2x00_set_field16
Lloh12:
	adrp	x8, _PHY_CSR10_RF_IF_SELECT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PHY_CSR10_RF_IF_SELECT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #0
	bl	_rt2x00_set_field16
Lloh15:
	adrp	x8, _PHY_CSR10_RF_BUSY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PHY_CSR10_RF_BUSY@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field16
Lloh18:
	adrp	x8, _PHY_CSR10@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PHY_CSR10@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_rt2500usb_register_write_lock
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_rt2x00_rf_write
LBB0_2:
	mov	x0, x19
	bl	_mutex_unlock
	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	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PHY_CSR9_RF_VALUE,4,2          ; @PHY_CSR9_RF_VALUE
	.comm	_PHY_CSR9,4,2                   ; @PHY_CSR9
	.comm	_PHY_CSR10_RF_VALUE,4,2         ; @PHY_CSR10_RF_VALUE
	.comm	_PHY_CSR10_RF_NUMBER_OF_BITS,4,2 ; @PHY_CSR10_RF_NUMBER_OF_BITS
	.comm	_PHY_CSR10_RF_IF_SELECT,4,2     ; @PHY_CSR10_RF_IF_SELECT
	.comm	_PHY_CSR10_RF_BUSY,4,2          ; @PHY_CSR10_RF_BUSY
	.comm	_PHY_CSR10,4,2                  ; @PHY_CSR10
	.no_dead_strip	_rt2500usb_rf_write
.subsections_via_symbols
