	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wait_dma_not_busy
_wait_dma_not_busy:                     ## @wait_dma_not_busy
	.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	_MAX_DMA_XFER_LOOPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_dma_busy
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$100, %edi
	callq	_udelay
	decl	%ebx
	jne	LBB0_1
	jmp	LBB0_4
LBB0_3:
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	LBB0_10
LBB0_4:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	_SATA_DMA_CHANNEL@GOTPCREL(%rip), %r14
	movq	_DMA_CTRL_STATUS@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	_DMA_CTRL_STATUS_RESET@GOTPCREL(%rip), %r15
	orl	(%r15), %eax
	movq	(%r12), %rsi
	addq	(%r14), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	_MAX_DMA_ABORT_LOOPS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_dma_busy
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	$10, %edi
	callq	_udelay
	decl	%ebx
	jne	LBB0_5
	jmp	LBB0_8
LBB0_7:
	xorl	%r13d, %r13d
	testl	%ebx, %ebx
	jne	LBB0_9
LBB0_8:
	leaq	L_str.2(%rip), %rdi
	callq	_puts
	movl	$1, %r13d
LBB0_9:
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movl	(%r15), %edi
	notl	%edi
	andl	%eax, %edi
	movq	(%r12), %rsi
	addq	(%r14), %rsi
	callq	_writel
LBB0_10:
	xorl	%eax, %eax
	testl	%r13d, %r13d
	sete	%al
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_DMA_XFER_LOOPS,4,2         ## @MAX_DMA_XFER_LOOPS
	.comm	_SATA_DMA_CHANNEL,8,3           ## @SATA_DMA_CHANNEL
	.comm	_DMA_CTRL_STATUS,8,3            ## @DMA_CTRL_STATUS
	.comm	_DMA_CTRL_STATUS_RESET,4,2      ## @DMA_CTRL_STATUS_RESET
	.comm	_MAX_DMA_ABORT_LOOPS,4,2        ## @MAX_DMA_ABORT_LOOPS
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"wait_dma_not_busy() Timed out of wait for DMA not busy"

L_str.2:                                ## @str.2
	.asciz	"wait_dma_not_busy() Timed out of wait for DMA channel abort"

	.no_dead_strip	_wait_dma_not_busy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wait_dma_not_busy
_wait_dma_not_busy:                     ; @wait_dma_not_busy
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, _MAX_DMA_XFER_LOOPS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_DMA_XFER_LOOPS@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	bl	_dma_busy
	cbz	w0, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #100
	bl	_udelay
	subs	w19, w19, #1
	b.ne	LBB0_1
	b	LBB0_5
LBB0_3:
	cbz	w19, LBB0_5
; %bb.4:
	mov	w22, #0
	b	LBB0_12
LBB0_5:
Lloh3:
	adrp	x0, l_str@PAGE
Lloh4:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
Lloh5:
	adrp	x19, _SATA_DMA_CHANNEL@GOTPAGE
Lloh6:
	ldr	x19, [x19, _SATA_DMA_CHANNEL@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh7:
	adrp	x20, _DMA_CTRL_STATUS@GOTPAGE
Lloh8:
	ldr	x20, [x20, _DMA_CTRL_STATUS@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
Lloh9:
	adrp	x21, _DMA_CTRL_STATUS_RESET@GOTPAGE
Lloh10:
	ldr	x21, [x21, _DMA_CTRL_STATUS_RESET@GOTPAGEOFF]
	ldr	w8, [x21]
	orr	w0, w8, w0
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
Lloh11:
	adrp	x8, _MAX_DMA_ABORT_LOOPS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAX_DMA_ABORT_LOOPS@GOTPAGEOFF]
Lloh13:
	ldr	w22, [x8]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	bl	_dma_busy
	cbz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w0, #10
	bl	_udelay
	subs	w22, w22, #1
	b.ne	LBB0_6
	b	LBB0_10
LBB0_8:
	cbz	w22, LBB0_10
; %bb.9:
	mov	w22, #0
	b	LBB0_11
LBB0_10:
Lloh14:
	adrp	x0, l_str.2@PAGE
Lloh15:
	add	x0, x0, l_str.2@PAGEOFF
	bl	_puts
	mov	w22, #1
LBB0_11:
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x0, x9, x8
	bl	_readl
	ldr	w8, [x21]
	bic	w0, w0, w8
	ldr	x8, [x19]
	ldr	x9, [x20]
	add	x1, x9, x8
	bl	_writel
LBB0_12:
	cmp	w22, #0
	cset	w0, eq
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DMA_XFER_LOOPS,4,2         ; @MAX_DMA_XFER_LOOPS
	.comm	_SATA_DMA_CHANNEL,8,3           ; @SATA_DMA_CHANNEL
	.comm	_DMA_CTRL_STATUS,8,3            ; @DMA_CTRL_STATUS
	.comm	_DMA_CTRL_STATUS_RESET,4,2      ; @DMA_CTRL_STATUS_RESET
	.comm	_MAX_DMA_ABORT_LOOPS,4,2        ; @MAX_DMA_ABORT_LOOPS
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"wait_dma_not_busy() Timed out of wait for DMA not busy"

l_str.2:                                ; @str.2
	.asciz	"wait_dma_not_busy() Timed out of wait for DMA channel abort"

	.no_dead_strip	_wait_dma_not_busy
.subsections_via_symbols
