	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_wait_wpdma_ready        ## -- Begin function rt2800_wait_wpdma_ready
	.p2align	4, 0x90
_rt2800_wait_wpdma_ready:               ## @rt2800_wait_wpdma_ready
	.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
	movq	%rdi, %r14
	xorl	%ebx, %ebx
	movq	_WPDMA_GLO_CFG_TX_DMA_BUSY@GOTPCREL(%rip), %r13
	movq	_REGISTER_BUSY_COUNT@GOTPCREL(%rip), %r12
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$10, %edi
	callq	_msleep
	incl	%ebx
	cmpl	(%r12), %ebx
	jae	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_WPDMA_GLO_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_rt2800_register_read
	movl	%eax, %r15d
	movl	(%r13), %esi
	movl	%eax, %edi
	callq	_rt2x00_get_field32
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_WPDMA_GLO_CFG_RX_DMA_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	callq	_rt2x00_get_field32
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_rt2x00_err
	movq	_EACCES@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REGISTER_BUSY_COUNT,4,2        ## @REGISTER_BUSY_COUNT
	.comm	_WPDMA_GLO_CFG,4,2              ## @WPDMA_GLO_CFG
	.comm	_WPDMA_GLO_CFG_TX_DMA_BUSY,4,2  ## @WPDMA_GLO_CFG_TX_DMA_BUSY
	.comm	_WPDMA_GLO_CFG_RX_DMA_BUSY,4,2  ## @WPDMA_GLO_CFG_RX_DMA_BUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WPDMA TX/RX busy [0x%08x]\n"

	.comm	_EACCES,4,2                     ## @EACCES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rt2800_wait_wpdma_ready        ; -- Begin function rt2800_wait_wpdma_ready
	.p2align	2
_rt2800_wait_wpdma_ready:               ; @rt2800_wait_wpdma_ready
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	mov	w21, #0
Lloh0:
	adrp	x22, _WPDMA_GLO_CFG@GOTPAGE
Lloh1:
	ldr	x22, [x22, _WPDMA_GLO_CFG@GOTPAGEOFF]
Lloh2:
	adrp	x23, _WPDMA_GLO_CFG_TX_DMA_BUSY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _WPDMA_GLO_CFG_TX_DMA_BUSY@GOTPAGEOFF]
Lloh4:
	adrp	x24, _WPDMA_GLO_CFG_RX_DMA_BUSY@GOTPAGE
Lloh5:
	ldr	x24, [x24, _WPDMA_GLO_CFG_RX_DMA_BUSY@GOTPAGEOFF]
Lloh6:
	adrp	x25, _REGISTER_BUSY_COUNT@GOTPAGE
Lloh7:
	ldr	x25, [x25, _REGISTER_BUSY_COUNT@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #10
	bl	_msleep
	add	w21, w21, #1
	ldr	w8, [x25]
	cmp	w21, w8
	b.hs	LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_rt2800_register_read
	mov	x20, x0
	ldr	w1, [x23]
	bl	_rt2x00_get_field32
	cbnz	w0, LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w1, [x24]
	mov	x0, x20
	bl	_rt2x00_get_field32
	cbnz	w0, LBB0_1
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_rt2x00_err
Lloh10:
	adrp	x8, _EACCES@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_REGISTER_BUSY_COUNT,4,2        ; @REGISTER_BUSY_COUNT
	.comm	_WPDMA_GLO_CFG,4,2              ; @WPDMA_GLO_CFG
	.comm	_WPDMA_GLO_CFG_TX_DMA_BUSY,4,2  ; @WPDMA_GLO_CFG_TX_DMA_BUSY
	.comm	_WPDMA_GLO_CFG_RX_DMA_BUSY,4,2  ; @WPDMA_GLO_CFG_RX_DMA_BUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WPDMA TX/RX busy [0x%08x]\n"

	.comm	_EACCES,4,2                     ; @EACCES
.subsections_via_symbols
