	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_bmdma_setup                ## -- Begin function ata_bmdma_setup
	.p2align	4, 0x90
_ata_bmdma_setup:                       ## @ata_bmdma_setup
	.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
	movq	8(%rdi), %r15
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%rdi), %r12d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mb
	movl	16(%r15), %edi
	movq	_ATA_DMA_TABLE_OFS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r15), %rsi
	callq	_iowrite32
	movq	_ATA_DMA_CMD@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%r15), %rdi
	callq	_ioread8
	movq	_ATA_DMA_WR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_ATA_DMA_START@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	testl	%r12d, %r12d
	cmovel	%ecx, %ebx
	orl	%edx, %ebx
	movq	(%r13), %rsi
	addq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_iowrite8
	movq	(%r15), %rax
	movq	(%rax), %rax
	movq	%r15, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.comm	_ATA_DMA_TABLE_OFS,8,3          ## @ATA_DMA_TABLE_OFS
	.comm	_ATA_DMA_CMD,8,3                ## @ATA_DMA_CMD
	.comm	_ATA_DMA_WR,4,2                 ## @ATA_DMA_WR
	.comm	_ATA_DMA_START,4,2              ## @ATA_DMA_START
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_bmdma_setup                ; -- Begin function ata_bmdma_setup
	.p2align	2
_ata_bmdma_setup:                       ; @ata_bmdma_setup
	.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	x19, x0
	ldr	x20, [x0, #8]
	ldr	w21, [x0]
Lloh0:
	adrp	x8, _ATA_TFLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	bl	_mb
	ldr	w0, [x20, #16]
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _ATA_DMA_TABLE_OFS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_DMA_TABLE_OFS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_iowrite32
	ldr	x8, [x20, #8]
Lloh6:
	adrp	x23, _ATA_DMA_CMD@GOTPAGE
Lloh7:
	ldr	x23, [x23, _ATA_DMA_CMD@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_ioread8
Lloh8:
	adrp	x8, _ATA_DMA_WR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATA_DMA_WR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _ATA_DMA_START@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_DMA_START@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w9, w9, w8
	bic	w9, w0, w9
	tst	w22, w21
	csel	w8, w8, wzr, eq
	orr	w0, w9, w8
	ldr	x8, [x20, #8]
	ldr	x9, [x23]
	add	x1, x9, x8
	bl	_iowrite8
	ldr	x8, [x20]
	ldr	x2, [x8]
	mov	x0, x20
	mov	x1, 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
	br	x2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_ATA_DMA_TABLE_OFS,8,3          ; @ATA_DMA_TABLE_OFS
	.comm	_ATA_DMA_CMD,8,3                ; @ATA_DMA_CMD
	.comm	_ATA_DMA_WR,4,2                 ; @ATA_DMA_WR
	.comm	_ATA_DMA_START,4,2              ; @ATA_DMA_START
.subsections_via_symbols
