	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt2800_bbp_read
_rt2800_bbp_read:                       ## @rt2800_bbp_read
	.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	%esi, %r15d
	movq	%rdi, %r12
	callq	_mutex_lock
	leaq	-40(%rbp), %rsi
	movq	%r12, %rdi
	callq	_WAIT_FOR_BBP
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	$0, -40(%rbp)
	movq	_BBP_CSR_CFG_REGNUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %r14
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_rt2x00_set_field32
	movq	_BBP_CSR_CFG_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_BBP_CSR_CFG_READ_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_BBP_CSR_CFG_BBP_RW_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_rt2x00_set_field32
	movq	_BBP_CSR_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-40(%rbp), %rdx
	movq	%r12, %rdi
	callq	_rt2800_register_write_lock
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_WAIT_FOR_BBP
LBB0_2:
	movq	-40(%rbp), %rdi
	movq	_BBP_CSR_CFG_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_rt2x00_get_field32
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BBP_CSR_CFG_REGNUM,4,2         ## @BBP_CSR_CFG_REGNUM
	.comm	_BBP_CSR_CFG_BUSY,4,2           ## @BBP_CSR_CFG_BUSY
	.comm	_BBP_CSR_CFG_READ_CONTROL,4,2   ## @BBP_CSR_CFG_READ_CONTROL
	.comm	_BBP_CSR_CFG_BBP_RW_MODE,4,2    ## @BBP_CSR_CFG_BBP_RW_MODE
	.comm	_BBP_CSR_CFG,4,2                ## @BBP_CSR_CFG
	.comm	_BBP_CSR_CFG_VALUE,4,2          ## @BBP_CSR_CFG_VALUE
	.no_dead_strip	_rt2800_bbp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt2800_bbp_read
_rt2800_bbp_read:                       ; @rt2800_bbp_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_mutex_lock
	add	x1, sp, #8
	mov	x0, x19
	bl	_WAIT_FOR_BBP
	cbz	x0, LBB0_2
; %bb.1:
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _BBP_CSR_CFG_REGNUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BBP_CSR_CFG_REGNUM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	x2, x20
	bl	_rt2x00_set_field32
Lloh3:
	adrp	x8, _BBP_CSR_CFG_BUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BBP_CSR_CFG_BUSY@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh6:
	adrp	x8, _BBP_CSR_CFG_READ_CONTROL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BBP_CSR_CFG_READ_CONTROL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh9:
	adrp	x8, _BBP_CSR_CFG_BBP_RW_MODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BBP_CSR_CFG_BBP_RW_MODE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x0, sp, #8
	mov	w2, #1
	bl	_rt2x00_set_field32
Lloh12:
	adrp	x8, _BBP_CSR_CFG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BBP_CSR_CFG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	x2, [sp, #8]
	mov	x0, x19
	bl	_rt2800_register_write_lock
	add	x1, sp, #8
	mov	x0, x19
	bl	_WAIT_FOR_BBP
LBB0_2:
	ldr	x0, [sp, #8]
Lloh15:
	adrp	x8, _BBP_CSR_CFG_VALUE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BBP_CSR_CFG_VALUE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_rt2x00_get_field32
	mov	x20, x0
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.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
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_BBP_CSR_CFG_REGNUM,4,2         ; @BBP_CSR_CFG_REGNUM
	.comm	_BBP_CSR_CFG_BUSY,4,2           ; @BBP_CSR_CFG_BUSY
	.comm	_BBP_CSR_CFG_READ_CONTROL,4,2   ; @BBP_CSR_CFG_READ_CONTROL
	.comm	_BBP_CSR_CFG_BBP_RW_MODE,4,2    ; @BBP_CSR_CFG_BBP_RW_MODE
	.comm	_BBP_CSR_CFG,4,2                ; @BBP_CSR_CFG
	.comm	_BBP_CSR_CFG_VALUE,4,2          ; @BBP_CSR_CFG_VALUE
	.no_dead_strip	_rt2800_bbp_read
.subsections_via_symbols
