	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_dbdma_load
_ata_dbdma_load:                        ## @ata_dbdma_load
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rdi, %rbx
	movl	32(%rdi), %edi
	callq	_device_get_softc
	movq	%rax, %r14
	movl	32(%rbx), %edi
	callq	_device_get_softc
	movq	%rax, -40(%rbp)
	movq	_ATA_R_READ@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	xorl	%ecx, %ecx
	andl	(%rbx), %eax
	sete	%cl
	movl	%ecx, -48(%rbp)
	movl	4(%rbx), %ecx
	testl	%ecx, %ecx
	je	LBB0_1
## %bb.4:
	movq	24(%rbx), %rdx
	movslq	(%r14), %rax
	decq	%rax
	testq	%rax, %rdx
	jne	LBB0_6
## %bb.5:
	andl	%ecx, %eax
	jne	LBB0_6
## %bb.7:
	movl	4(%r14), %eax
	cmpl	%eax, %ecx
	jle	LBB0_9
## %bb.8:
	movl	16(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%ecx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_3
LBB0_1:
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_6:
	movl	16(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_device_printf
LBB0_3:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_16:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	16(%r14), %rax
	movq	%rax, 8(%rbx)
	movl	(%rax), %esi
	movl	4(%rax), %edi
	movq	_BUS_DMA_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	_ata_dbdma_setprd@GOTPCREL(%rip), %r8
	leaq	-48(%rbp), %r9
	callq	_bus_dmamap_load
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	16(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
	movq	%rbx, %rdi
	callq	*8(%r14)
	jmp	LBB0_3
LBB0_11:
	testq	%r15, %r15
	je	LBB0_13
## %bb.12:
	movl	-44(%rbp), %eax
	movl	%eax, (%r15)
LBB0_13:
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	movl	12(%rax), %edi
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_bus_dmamap_sync
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edi
	movl	(%r12), %eax
	andl	(%rbx), %eax
	je	LBB0_15
## %bb.14:
	movq	_BUS_DMASYNC_PREREAD@GOTPCREL(%rip), %r14
LBB0_15:
	movl	(%r14), %edx
	callq	_bus_dmamap_sync
	xorl	%eax, %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_R_READ,4,2                 ## @ATA_R_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FAILURE - zero length DMA transfer attempted\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"FAILURE - non aligned DMA transfer attempted\n"

L_.str.2:                               ## @.str.2
	.asciz	"FAILURE - oversized DMA transfer attempt %d > %d\n"

	.comm	_ata_dbdma_setprd,4,2           ## @ata_dbdma_setprd
	.comm	_BUS_DMA_NOWAIT,4,2             ## @BUS_DMA_NOWAIT
L_.str.3:                               ## @.str.3
	.asciz	"FAILURE - load data\n"

	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_BUS_DMASYNC_PREREAD,4,2        ## @BUS_DMASYNC_PREREAD
	.no_dead_strip	_ata_dbdma_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_dbdma_load
_ata_dbdma_load:                        ; @ata_dbdma_load
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x19, x0
	ldr	w0, [x0, #32]
	bl	_device_get_softc
	mov	x21, x0
	ldr	w0, [x19, #32]
	bl	_device_get_softc
	str	x0, [sp, #24]
Lloh0:
	adrp	x22, _ATA_R_READ@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ATA_R_READ@GOTPAGEOFF]
	ldr	w8, [x22]
	ldp	w9, w3, [x19]
	tst	w8, w9
	cset	w8, eq
	str	w8, [sp, #16]
	cbz	w3, LBB0_3
; %bb.1:
	ldr	x2, [x19, #24]
	ldrsw	x8, [x21]
	sub	x8, x8, #1
	and	x9, x2, x8
	and	w8, w8, w3
	cmp	x9, #0
	ccmp	w8, #0, #0, eq
	b.eq	LBB0_4
; %bb.2:
	ldr	w0, [x19, #16]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_3:
	ldr	w0, [x19, #16]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	w8, [x21, #4]
	cmp	w3, w8
	b.le	LBB0_9
; %bb.5:
	ldr	w0, [x19, #16]
	stp	x3, x8, [sp]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	bl	_device_printf
LBB0_7:
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
LBB0_8:
	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
	add	sp, sp, #80
	ret
LBB0_9:
	ldr	x8, [x21, #16]
	str	x8, [x19, #8]
	ldp	w1, w0, [x8]
Lloh11:
	adrp	x8, _BUS_DMA_NOWAIT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BUS_DMA_NOWAIT@GOTPAGEOFF]
Lloh13:
	ldr	w6, [x8]
Lloh14:
	adrp	x4, _ata_dbdma_setprd@GOTPAGE
Lloh15:
	ldr	x4, [x4, _ata_dbdma_setprd@GOTPAGEOFF]
	add	x5, sp, #16
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_bus_dmamap_load
	cbz	w0, LBB0_11
; %bb.10:
	ldr	w0, [x19, #16]
Lloh16:
	adrp	x1, l_.str.3@PAGE
Lloh17:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_device_printf
	ldr	x8, [x21, #8]
	mov	x0, x19
	blr	x8
	b	LBB0_7
LBB0_11:
	cbz	x20, LBB0_13
; %bb.12:
	ldr	w8, [sp, #20]
	str	w8, [x20]
LBB0_13:
	ldr	x8, [x19, #8]
	ldp	w1, w0, [x8, #8]
Lloh18:
	adrp	x20, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh19:
	ldr	x20, [x20, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
	ldr	w2, [x20]
	bl	_bus_dmamap_sync
	ldr	x8, [x19, #8]
	ldp	w1, w0, [x8]
	ldr	w8, [x19]
	ldr	w9, [x22]
Lloh20:
	adrp	x10, _BUS_DMASYNC_PREREAD@GOTPAGE
Lloh21:
	ldr	x10, [x10, _BUS_DMASYNC_PREREAD@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x20, x10, eq
	ldr	w2, [x8]
	bl	_bus_dmamap_sync
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_R_READ,4,2                 ; @ATA_R_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FAILURE - zero length DMA transfer attempted\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"FAILURE - non aligned DMA transfer attempted\n"

l_.str.2:                               ; @.str.2
	.asciz	"FAILURE - oversized DMA transfer attempt %d > %d\n"

	.comm	_ata_dbdma_setprd,4,2           ; @ata_dbdma_setprd
	.comm	_BUS_DMA_NOWAIT,4,2             ; @BUS_DMA_NOWAIT
l_.str.3:                               ; @.str.3
	.asciz	"FAILURE - load data\n"

	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_BUS_DMASYNC_PREREAD,4,2        ; @BUS_DMASYNC_PREREAD
	.no_dead_strip	_ata_dbdma_load
.subsections_via_symbols
