	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt76x0_rf_csr_rr
_mt76x0_rf_csr_rr:                      ## @mt76x0_rf_csr_rr
	.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
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	xorl	%ebx, %ebx
	movq	_MT76_REMOVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%r14), %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r13d
	jmp	LBB0_5
LBB0_2:
	movl	%r12d, %edi
	callq	_MT_RF_BANK
	movl	%eax, %r15d
	movl	%r12d, %edi
	callq	_MT_RF_REG
	movl	%eax, %r12d
	xorl	%edi, %edi
	cmpl	$127, %eax
	setg	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	cmpl	$9, %r15d
	setge	%dil
	callq	_WARN_ON_ONCE
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_5:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	8(%r14), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_MT_RF_CSR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_RF_CSR_CFG_KICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	callq	_mt76_poll
	testl	%eax, %eax
	je	LBB0_13
## %bb.7:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_MT_RF_CSR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_MT_RF_CSR_CFG_REG_BANK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_MT_RF_CSR_CFG_REG_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	movq	_MT_RF_CSR_CFG_KICK@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_mt76_wr
	movq	_MT_RF_CSR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MT_RF_CSR_CFG_KICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	callq	_mt76_poll
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	movq	_MT_RF_CSR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_mt76_rr
	movl	%eax, %ebx
	movq	_MT_RF_CSR_CFG_REG_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_FIELD_GET
	cmpl	%r12d, %eax
	jne	LBB0_12
## %bb.9:
	movq	_MT_RF_CSR_CFG_REG_BANK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	callq	_FIELD_GET
	cmpl	%r15d, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_13
## %bb.10:
	movq	_MT_RF_CSR_CFG_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_FIELD_GET
	movl	%eax, %r13d
	jmp	LBB0_13
LBB0_12:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_13:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	jns	LBB0_5
## %bb.14:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	callq	_dev_err
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_MT76_REMOVED,4,2               ## @MT76_REMOVED
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MT_RF_CSR_CFG,4,2              ## @MT_RF_CSR_CFG
	.comm	_MT_RF_CSR_CFG_KICK,4,2         ## @MT_RF_CSR_CFG_KICK
	.comm	_MT_RF_CSR_CFG_REG_BANK,4,2     ## @MT_RF_CSR_CFG_REG_BANK
	.comm	_MT_RF_CSR_CFG_REG_ID,4,2       ## @MT_RF_CSR_CFG_REG_ID
	.comm	_MT_RF_CSR_CFG_DATA,4,2         ## @MT_RF_CSR_CFG_DATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: RF read %d:%d failed:%d!!\n"

	.no_dead_strip	_mt76x0_rf_csr_rr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt76x0_rf_csr_rr
_mt76x0_rf_csr_rr:                      ; @mt76x0_rf_csr_rr
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x8, _MT76_REMOVED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT76_REMOVED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	add	x1, x19, #4
	bl	_test_bit
	cbz	x0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	mov	x0, x21
	bl	_MT_RF_BANK
	mov	x20, x0
	mov	x0, x21
	bl	_MT_RF_REG
	mov	x21, x0
	cmp	w0, #127
	cset	w0, gt
	bl	_WARN_ON_ONCE
	cbnz	x0, LBB0_4
; %bb.3:
	cmp	w20, #8
	cset	w0, gt
	bl	_WARN_ON_ONCE
	cbz	x0, LBB0_7
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_7:
	neg	w22, w22
	add	x23, x19, #8
	mov	x0, x23
	bl	_mutex_lock
Lloh10:
	adrp	x26, _MT_RF_CSR_CFG@GOTPAGE
Lloh11:
	ldr	x26, [x26, _MT_RF_CSR_CFG@GOTPAGEOFF]
	ldr	w1, [x26]
Lloh12:
	adrp	x28, _MT_RF_CSR_CFG_KICK@GOTPAGE
Lloh13:
	ldr	x28, [x28, _MT_RF_CSR_CFG_KICK@GOTPAGEOFF]
	ldr	w2, [x28]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #100
	bl	_mt76_poll
	cbz	w0, LBB0_12
; %bb.8:
	ldr	w24, [x26]
Lloh14:
	adrp	x8, _MT_RF_CSR_CFG_REG_BANK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MT_RF_CSR_CFG_REG_BANK@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_PREP
	mov	x25, x0
Lloh17:
	adrp	x27, _MT_RF_CSR_CFG_REG_ID@GOTPAGE
Lloh18:
	ldr	x27, [x27, _MT_RF_CSR_CFG_REG_ID@GOTPAGEOFF]
	ldr	w0, [x27]
	mov	x1, x21
	bl	_FIELD_PREP
	orr	w8, w0, w25
	ldr	w9, [x28]
	orr	w2, w8, w9
	mov	x0, x19
	mov	x1, x24
	bl	_mt76_wr
	ldr	w1, [x26]
	ldr	w2, [x28]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #100
	bl	_mt76_poll
	cbz	w0, LBB0_12
; %bb.9:
	ldr	w1, [x26]
	mov	x0, x19
	bl	_mt76_rr
	mov	x24, x0
	ldr	w0, [x27]
	mov	x1, x24
	bl	_FIELD_GET
	cmp	w0, w21
	b.ne	LBB0_12
; %bb.10:
Lloh19:
	adrp	x8, _MT_RF_CSR_CFG_REG_BANK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MT_RF_CSR_CFG_REG_BANK@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x24
	bl	_FIELD_GET
	cmp	w0, w20
	b.ne	LBB0_12
; %bb.11:
Lloh22:
	adrp	x8, _MT_RF_CSR_CFG_DATA@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MT_RF_CSR_CFG_DATA@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x24
	bl	_FIELD_GET
	mov	x22, x0
LBB0_12:
	mov	x0, x23
	bl	_mutex_unlock
	tbz	w22, #31, LBB0_6
; %bb.13:
	ldr	w0, [x19]
Lloh25:
	adrp	x1, l_.str@PAGE
Lloh26:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	mov	x3, x21
	mov	x4, x22
	bl	_dev_err
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_MT76_REMOVED,4,2               ; @MT76_REMOVED
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MT_RF_CSR_CFG,4,2              ; @MT_RF_CSR_CFG
	.comm	_MT_RF_CSR_CFG_KICK,4,2         ; @MT_RF_CSR_CFG_KICK
	.comm	_MT_RF_CSR_CFG_REG_BANK,4,2     ; @MT_RF_CSR_CFG_REG_BANK
	.comm	_MT_RF_CSR_CFG_REG_ID,4,2       ; @MT_RF_CSR_CFG_REG_ID
	.comm	_MT_RF_CSR_CFG_DATA,4,2         ; @MT_RF_CSR_CFG_DATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: RF read %d:%d failed:%d!!\n"

	.no_dead_strip	_mt76x0_rf_csr_rr
.subsections_via_symbols
