	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mt7601u_bbp_wr
_mt7601u_bbp_wr:                        ## @mt7601u_bbp_wr
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	_MT7601U_STATE_WLAN_RUNNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r12), %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_6
## %bb.1:
	movq	_MT7601U_STATE_REMOVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_2
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	_MT_BBP_CSR_CFG@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_MT_BBP_CSR_CFG_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	callq	_mt76_poll
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	(%r13), %r13d
	movq	_MT_BBP_CSR_CFG_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_MT_BBP_CSR_CFG_REG_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_FIELD_PREP
	orl	%eax, %ebx
	movq	_MT_BBP_CSR_CFG_RW_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_MT_BBP_CSR_CFG_BUSY@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	callq	_mt7601u_wr
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_trace_bbp_write
	jmp	LBB0_5
LBB0_3:
	movl	4(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
LBB0_5:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MT7601U_STATE_WLAN_RUNNING,4,2 ## @MT7601U_STATE_WLAN_RUNNING
	.comm	_MT7601U_STATE_REMOVED,4,2      ## @MT7601U_STATE_REMOVED
	.comm	_MT_BBP_CSR_CFG,4,2             ## @MT_BBP_CSR_CFG
	.comm	_MT_BBP_CSR_CFG_BUSY,4,2        ## @MT_BBP_CSR_CFG_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error: BBP write %02hhx failed!!\n"

	.comm	_MT_BBP_CSR_CFG_VAL,4,2         ## @MT_BBP_CSR_CFG_VAL
	.comm	_MT_BBP_CSR_CFG_REG_NUM,4,2     ## @MT_BBP_CSR_CFG_REG_NUM
	.comm	_MT_BBP_CSR_CFG_RW_MODE,4,2     ## @MT_BBP_CSR_CFG_RW_MODE
	.no_dead_strip	_mt7601u_bbp_wr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mt7601u_bbp_wr
_mt7601u_bbp_wr:                        ; @mt7601u_bbp_wr
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _MT7601U_STATE_WLAN_RUNNING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MT7601U_STATE_WLAN_RUNNING@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x22, x19, #8
	mov	x1, x22
	bl	_test_bit
	cmp	x0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbnz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _MT7601U_STATE_REMOVED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MT7601U_STATE_REMOVED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_test_bit
	cbz	x0, LBB0_3
LBB0_2:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x19
	bl	_mutex_lock
Lloh6:
	adrp	x22, _MT_BBP_CSR_CFG@GOTPAGE
Lloh7:
	ldr	x22, [x22, _MT_BBP_CSR_CFG@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh8:
	adrp	x24, _MT_BBP_CSR_CFG_BUSY@GOTPAGE
Lloh9:
	ldr	x24, [x24, _MT_BBP_CSR_CFG_BUSY@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	mov	w3, #0
	mov	w4, #1000
	bl	_mt76_poll
	cbz	w0, LBB0_5
; %bb.4:
	ldr	w22, [x22]
Lloh10:
	adrp	x8, _MT_BBP_CSR_CFG_VAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MT_BBP_CSR_CFG_VAL@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_FIELD_PREP
	mov	x23, x0
Lloh13:
	adrp	x8, _MT_BBP_CSR_CFG_REG_NUM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MT_BBP_CSR_CFG_REG_NUM@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_PREP
	orr	w8, w0, w23
Lloh16:
	adrp	x9, _MT_BBP_CSR_CFG_RW_MODE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MT_BBP_CSR_CFG_RW_MODE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x24]
	orr	w2, w8, w9
	mov	x0, x19
	mov	x1, x22
	bl	_mt7601u_wr
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_trace_bbp_write
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #4]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
LBB0_6:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MT7601U_STATE_WLAN_RUNNING,4,2 ; @MT7601U_STATE_WLAN_RUNNING
	.comm	_MT7601U_STATE_REMOVED,4,2      ; @MT7601U_STATE_REMOVED
	.comm	_MT_BBP_CSR_CFG,4,2             ; @MT_BBP_CSR_CFG
	.comm	_MT_BBP_CSR_CFG_BUSY,4,2        ; @MT_BBP_CSR_CFG_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error: BBP write %02hhx failed!!\n"

	.comm	_MT_BBP_CSR_CFG_VAL,4,2         ; @MT_BBP_CSR_CFG_VAL
	.comm	_MT_BBP_CSR_CFG_REG_NUM,4,2     ; @MT_BBP_CSR_CFG_REG_NUM
	.comm	_MT_BBP_CSR_CFG_RW_MODE,4,2     ; @MT_BBP_CSR_CFG_RW_MODE
	.no_dead_strip	_mt7601u_bbp_wr
.subsections_via_symbols
