	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function octeon_cf_dma_finished
_octeon_cf_dma_finished:                ## @octeon_cf_dma_finished
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	movq	(%rax), %r12
	movl	24(%rdi), %esi
	movq	(%r14), %rdx
	movq	(%rdi), %rcx
	leaq	L_.str(%rip), %rdi
	callq	_VPRINTK
	movq	(%rbx), %rax
	movq	_HSM_ST_LAST@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.1:
	movl	(%r12), %edi
	callq	_CVMX_MIO_BOOT_DMA_CFGX
	movl	%eax, %edi
	callq	_cvmx_read_csr
	cmpl	$1048575, %eax                  ## imm = 0xFFFFF
	je	LBB0_3
## %bb.2:
	movq	_AC_ERR_HOST_BUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r14)
	movq	_HSM_ST_ERR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
LBB0_3:
	movl	(%r12), %edi
	callq	_CVMX_MIO_BOOT_DMA_CFGX
	movl	$4294967295, %esi               ## imm = 0xFFFFFFFF
	movl	%eax, %edi
	callq	_cvmx_write_csr
	movl	(%r12), %edi
	callq	_CVMX_MIO_BOOT_DMA_INT_ENX
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_cvmx_write_csr
	movl	(%r12), %edi
	callq	_CVMX_MIO_BOOT_DMA_INTX
	movl	$1, %esi
	movl	%eax, %edi
	callq	_cvmx_write_csr
	movq	8(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	callq	_ata_sff_hsm_move
	movl	8(%r14), %edi
	callq	_unlikely
	movl	$1, %r15d
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	(%r14), %rax
	movq	_ATA_PROT_DMA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	addq	$40, %rbx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_ata_ehi_push_desc
LBB0_6:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ata%u: protocol %d task_state %d\n"

	.comm	_HSM_ST_LAST,8,3                ## @HSM_ST_LAST
	.comm	_AC_ERR_HOST_BUS,4,2            ## @AC_ERR_HOST_BUS
	.comm	_HSM_ST_ERR,8,3                 ## @HSM_ST_ERR
	.comm	_ATA_PROT_DMA,8,3               ## @ATA_PROT_DMA
L_.str.1:                               ## @.str.1
	.asciz	"DMA stat 0x%x"

	.no_dead_strip	_octeon_cf_dma_finished
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function octeon_cf_dma_finished
_octeon_cf_dma_finished:                ; @octeon_cf_dma_finished
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #32]
	ldr	x21, [x8]
	ldr	w1, [x0, #24]
	ldr	x2, [x20]
	ldr	x3, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VPRINTK
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _HSM_ST_LAST@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HSM_ST_LAST@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.1:
	ldr	w0, [x21]
	bl	_CVMX_MIO_BOOT_DMA_CFGX
	bl	_cvmx_read_csr
	mov	w8, #1048575
	cmp	w0, w8
	b.eq	LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _AC_ERR_HOST_BUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AC_ERR_HOST_BUS@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	orr	w8, w9, w8
	str	w8, [x20, #8]
Lloh8:
	adrp	x8, _HSM_ST_ERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HSM_ST_ERR@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_3:
	ldr	w0, [x21]
	bl	_CVMX_MIO_BOOT_DMA_CFGX
	mov	w1, #-1
	bl	_cvmx_write_csr
	ldr	w0, [x21]
	bl	_CVMX_MIO_BOOT_DMA_INT_ENX
	mov	x1, #0
	bl	_cvmx_write_csr
	ldr	w0, [x21]
	bl	_CVMX_MIO_BOOT_DMA_INTX
	mov	w21, #1
	mov	w1, #1
	bl	_cvmx_write_csr
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	mov	x22, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	w3, #0
	bl	_ata_sff_hsm_move
	ldr	w0, [x20, #8]
	bl	_unlikely
	cbz	x0, LBB0_8
; %bb.4:
	ldr	x8, [x20]
Lloh11:
	adrp	x9, _ATA_PROT_DMA@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_PROT_DMA@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	add	x0, x19, #40
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_ata_ehi_push_desc
LBB0_6:
	mov	w21, #1
	b	LBB0_8
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x21
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ata%u: protocol %d task_state %d\n"

	.comm	_HSM_ST_LAST,8,3                ; @HSM_ST_LAST
	.comm	_AC_ERR_HOST_BUS,4,2            ; @AC_ERR_HOST_BUS
	.comm	_HSM_ST_ERR,8,3                 ; @HSM_ST_ERR
	.comm	_ATA_PROT_DMA,8,3               ; @ATA_PROT_DMA
l_.str.1:                               ; @.str.1
	.asciz	"DMA stat 0x%x"

	.no_dead_strip	_octeon_cf_dma_finished
.subsections_via_symbols
