	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_macio_setmode
_ata_macio_setmode:                     ## @ata_macio_setmode
	.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
	movl	%edx, %ebx
	movl	%esi, %r14d
	callq	_device_get_softc
	movq	%rax, %r12
	movl	32(%rax), %esi
	movl	%ebx, %edi
	callq	_min
	movl	%eax, %r15d
	movq	_ATA_DMA_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_ATA_UDMA0@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_2
## %bb.1:
	movq	_udma_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ATA_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r15d, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %ebx
	movl	(%r12), %edi
	callq	_ATA_TIME_TO_TICK
	movl	%eax, %r13d
	movl	(%r12), %edi
	movl	%ebx, %esi
	callq	_ATA_TIME_TO_TICK
	movl	%eax, %ebx
	shll	$21, %r13d
	shll	$25, %ebx
	orl	%r13d, %ebx
	orl	$1048576, %ebx                  ## imm = 0x100000
	addq	$8, %r12
	jmp	LBB0_11
LBB0_2:
	movq	_ATA_WDMA0@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
## %bb.3:
	movq	_dma_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ATA_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r15d, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %r13d
	movl	(%r12), %edi
	callq	_ATA_TIME_TO_TICK
	movl	%eax, %ebx
	movl	(%r12), %edi
	movl	%r13d, %esi
	callq	_ATA_TIME_TO_TICK
	cmpl	$4, (%r12)
	jne	LBB0_6
## %bb.4:
	subl	%eax, %ebx
	shll	$10, %eax
	shll	$15, %ebx
	jmp	LBB0_5
LBB0_7:
	movq	_pio_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ATA_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%r15d, %ecx
	movslq	%ecx, %rcx
	movq	_ATA_PIO0@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	subq	%rdx, %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %r13d
	movl	(%r12), %edi
	callq	_ATA_TIME_TO_TICK
	movl	%eax, %ebx
	movl	(%r12), %edi
	movl	%r13d, %esi
	callq	_ATA_TIME_TO_TICK
	cmpl	$4, (%r12)
	jne	LBB0_9
## %bb.8:
	subl	%eax, %ebx
	shll	$5, %ebx
	orl	%eax, %ebx
	jmp	LBB0_10
LBB0_6:
	movq	_DMA_REC_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%eax, %ecx
	subl	%ecx, %ebx
	movq	_DMA_REC_MIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %ebx
	cmovlel	%ecx, %ebx
	shll	$16, %ebx
	shll	$11, %eax
LBB0_5:
	orl	%eax, %ebx
	addq	$16, %r12
	jmp	LBB0_11
LBB0_9:
	movq	_PIO_ACT_MIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %eax
	cmovgl	%eax, %ecx
	movq	_PIO_REC_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ecx, %eax
	subl	%eax, %ebx
	movq	_PIO_REC_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	cmovlel	%eax, %ebx
	shll	$5, %ebx
	orl	%ecx, %ebx
LBB0_10:
	addq	$24, %r12
LBB0_11:
	movq	(%r12), %rax
	movslq	%r14d, %rcx
	movl	%ebx, (%rax,%rcx,4)
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_DMA_MASK,4,2               ## @ATA_DMA_MASK
	.comm	_ATA_UDMA0,4,2                  ## @ATA_UDMA0
	.comm	_udma_timings,8,3               ## @udma_timings
	.comm	_ATA_MODE_MASK,4,2              ## @ATA_MODE_MASK
	.comm	_ATA_WDMA0,4,2                  ## @ATA_WDMA0
	.comm	_dma_timings,8,3                ## @dma_timings
	.comm	_DMA_REC_OFFSET,4,2             ## @DMA_REC_OFFSET
	.comm	_DMA_REC_MIN,4,2                ## @DMA_REC_MIN
	.comm	_pio_timings,8,3                ## @pio_timings
	.comm	_ATA_PIO0,4,2                   ## @ATA_PIO0
	.comm	_PIO_ACT_MIN,4,2                ## @PIO_ACT_MIN
	.comm	_PIO_REC_OFFSET,4,2             ## @PIO_REC_OFFSET
	.comm	_PIO_REC_MIN,4,2                ## @PIO_REC_MIN
	.no_dead_strip	_ata_macio_setmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_macio_setmode
_ata_macio_setmode:                     ; @ata_macio_setmode
	.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	x21, x2
	mov	x19, x1
	bl	_device_get_softc
	mov	x20, x0
	ldr	w1, [x0, #32]
	mov	x0, x21
	bl	_min
	mov	x21, x0
Lloh0:
	adrp	x8, _ATA_DMA_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_DMA_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh3:
	adrp	x9, _ATA_UDMA0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_UDMA0@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _udma_timings@GOTPAGE
Lloh7:
	ldr	x8, [x8, _udma_timings@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _ATA_MODE_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ATA_MODE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w9, w9, w21
	add	x8, x8, w9, sxtw #3
	ldp	w1, w22, [x8]
	ldr	w0, [x20]
	bl	_ATA_TIME_TO_TICK
	mov	x23, x0
	ldr	w0, [x20], #8
	mov	x1, x22
	bl	_ATA_TIME_TO_TICK
	lsl	w8, w23, #21
	orr	w8, w8, w0, lsl #25
	orr	w8, w8, #0x100000
	b	LBB0_10
LBB0_2:
Lloh12:
	adrp	x9, _ATA_WDMA0@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATA_WDMA0@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.3:
Lloh15:
	adrp	x8, _dma_timings@GOTPAGE
Lloh16:
	ldr	x8, [x8, _dma_timings@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
Lloh18:
	adrp	x9, _ATA_MODE_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_MODE_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	and	w9, w9, w21
	add	x8, x8, w9, sxtw #3
	ldp	w1, w23, [x8]
	ldr	w0, [x20]
	bl	_ATA_TIME_TO_TICK
	mov	x22, x0
	ldr	w0, [x20]
	mov	x1, x23
	bl	_ATA_TIME_TO_TICK
	ldr	w8, [x20]
	cmp	w8, #4
	b.ne	LBB0_7
; %bb.4:
	sub	w8, w22, w0
	lsl	w8, w8, #15
	orr	w8, w8, w0, lsl #10
	add	x20, x20, #16
	b	LBB0_10
LBB0_5:
Lloh21:
	adrp	x8, _pio_timings@GOTPAGE
Lloh22:
	ldr	x8, [x8, _pio_timings@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
Lloh24:
	adrp	x9, _ATA_MODE_MASK@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ATA_MODE_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	and	w9, w9, w21
Lloh27:
	adrp	x10, _ATA_PIO0@GOTPAGE
Lloh28:
	ldr	x10, [x10, _ATA_PIO0@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	sub	w9, w9, w10
	add	x8, x8, w9, sxtw #3
	ldp	w1, w23, [x8]
	ldr	w0, [x20]
	bl	_ATA_TIME_TO_TICK
	mov	x22, x0
	ldr	w0, [x20]
	mov	x1, x23
	bl	_ATA_TIME_TO_TICK
	ldr	w8, [x20]
	cmp	w8, #4
	b.ne	LBB0_8
; %bb.6:
	sub	w8, w22, w0
	orr	w8, w0, w8, lsl #5
	b	LBB0_9
LBB0_7:
Lloh30:
	adrp	x8, _DMA_REC_OFFSET@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DMA_REC_OFFSET@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	add	w8, w0, w8
	sub	w8, w22, w8
Lloh33:
	adrp	x9, _DMA_REC_MIN@GOTPAGE
Lloh34:
	ldr	x9, [x9, _DMA_REC_MIN@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	cmp	w8, w9
	csel	w8, w8, w9, gt
	lsl	w8, w8, #16
	orr	w8, w8, w0, lsl #11
	add	x20, x20, #16
	b	LBB0_10
LBB0_8:
Lloh36:
	adrp	x8, _PIO_ACT_MIN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _PIO_ACT_MIN@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	cmp	w0, w8
	csel	w8, w0, w8, gt
Lloh39:
	adrp	x9, _PIO_REC_OFFSET@GOTPAGE
Lloh40:
	ldr	x9, [x9, _PIO_REC_OFFSET@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
Lloh42:
	adrp	x10, _PIO_REC_MIN@GOTPAGE
Lloh43:
	ldr	x10, [x10, _PIO_REC_MIN@GOTPAGEOFF]
	add	w9, w9, w8
	sub	w9, w22, w9
Lloh44:
	ldr	w10, [x10]
	cmp	w9, w10
	csel	w9, w9, w10, gt
	orr	w8, w8, w9, lsl #5
LBB0_9:
	add	x20, x20, #24
LBB0_10:
	ldr	x9, [x20]
	str	w8, [x9, w19, sxtw #2]
	mov	x0, x21
	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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_DMA_MASK,4,2               ; @ATA_DMA_MASK
	.comm	_ATA_UDMA0,4,2                  ; @ATA_UDMA0
	.comm	_udma_timings,8,3               ; @udma_timings
	.comm	_ATA_MODE_MASK,4,2              ; @ATA_MODE_MASK
	.comm	_ATA_WDMA0,4,2                  ; @ATA_WDMA0
	.comm	_dma_timings,8,3                ; @dma_timings
	.comm	_DMA_REC_OFFSET,4,2             ; @DMA_REC_OFFSET
	.comm	_DMA_REC_MIN,4,2                ; @DMA_REC_MIN
	.comm	_pio_timings,8,3                ; @pio_timings
	.comm	_ATA_PIO0,4,2                   ; @ATA_PIO0
	.comm	_PIO_ACT_MIN,4,2                ; @PIO_ACT_MIN
	.comm	_PIO_REC_OFFSET,4,2             ; @PIO_REC_OFFSET
	.comm	_PIO_REC_MIN,4,2                ; @PIO_REC_MIN
	.no_dead_strip	_ata_macio_setmode
.subsections_via_symbols
