	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_kauai_setmode
_ata_kauai_setmode:                     ## @ata_kauai_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	callq	_device_get_softc
	movq	%rax, %r15
	cmpq	$0, 24(%rax)
	jne	LBB0_1
## %bb.2:
	movq	_ATA_UDMA5@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_ATA_UDMA6@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_min
	movq	_ATA_DMA_MASK@GOTPCREL(%rip), %rdx
	movl	%eax, %ecx
	andl	(%rdx), %ecx
	cmpq	$0, 24(%r15)
	je	LBB0_11
## %bb.4:
	cmpl	$128, %ecx
	je	LBB0_8
## %bb.5:
	cmpl	$129, %ecx
	jne	LBB0_10
## %bb.6:
	movq	_udma_timing_shasta@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_11:
	cmpl	$128, %ecx
	je	LBB0_14
## %bb.12:
	cmpl	$129, %ecx
	jne	LBB0_15
## %bb.13:
	movq	_udma_timing_kauai@GOTPCREL(%rip), %rcx
LBB0_7:
	movq	(%rcx), %rcx
	movq	_ATA_MODE_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%eax, %edx
	movslq	%edx, %rdx
	movl	(%rcx,%rdx,4), %ecx
	movq	16(%r15), %rdx
	jmp	LBB0_17
LBB0_8:
	movq	16(%r15), %rcx
	movslq	%r14d, %rdx
	movl	$0, (%rcx,%rdx,4)
	movq	_dma_timing_shasta@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_10:
	movq	_pio_timing_shasta@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_14:
	movq	16(%r15), %rcx
	movslq	%r14d, %rdx
	movl	$0, (%rcx,%rdx,4)
	movq	_dma_timing_kauai@GOTPCREL(%rip), %rcx
LBB0_9:
	movq	(%rcx), %rcx
	movq	_ATA_MODE_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%eax, %esi
	movslq	%esi, %rsi
	movl	(%rcx,%rsi,4), %ecx
	movq	8(%r15), %rsi
	movl	%ecx, (%rsi,%rdx,4)
	jmp	LBB0_18
LBB0_15:
	movq	_pio_timing_kauai@GOTPCREL(%rip), %rcx
LBB0_16:
	movq	(%rcx), %rcx
	movq	_ATA_MODE_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%eax, %edx
	movslq	%edx, %rdx
	movq	_ATA_PIO0@GOTPCREL(%rip), %rsi
	movslq	(%rsi), %rsi
	subq	%rsi, %rdx
	movl	(%rcx,%rdx,4), %ecx
	movq	(%r15), %rdx
LBB0_17:
	movslq	%r14d, %rsi
	movl	%ecx, (%rdx,%rsi,4)
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_UDMA6,4,2                  ## @ATA_UDMA6
	.comm	_ATA_UDMA5,4,2                  ## @ATA_UDMA5
	.comm	_ATA_DMA_MASK,4,2               ## @ATA_DMA_MASK
	.comm	_udma_timing_shasta,8,3         ## @udma_timing_shasta
	.comm	_ATA_MODE_MASK,4,2              ## @ATA_MODE_MASK
	.comm	_dma_timing_shasta,8,3          ## @dma_timing_shasta
	.comm	_pio_timing_shasta,8,3          ## @pio_timing_shasta
	.comm	_ATA_PIO0,4,2                   ## @ATA_PIO0
	.comm	_udma_timing_kauai,8,3          ## @udma_timing_kauai
	.comm	_dma_timing_kauai,8,3           ## @dma_timing_kauai
	.comm	_pio_timing_kauai,8,3           ## @pio_timing_kauai
	.no_dead_strip	_ata_kauai_setmode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_kauai_setmode
_ata_kauai_setmode:                     ; @ata_kauai_setmode
	.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	x21, x2
	mov	x20, x1
	bl	_device_get_softc
	mov	x19, x0
Lloh0:
	adrp	x8, _ATA_UDMA6@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_UDMA6@GOTPAGEOFF]
	ldr	x9, [x0, #24]
Lloh2:
	adrp	x10, _ATA_UDMA5@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ATA_UDMA5@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x10, x8, eq
	ldr	w1, [x8]
	mov	x0, x21
	bl	_min
	ldr	x9, [x19, #24]
Lloh4:
	adrp	x8, _ATA_DMA_MASK@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ATA_DMA_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	and	w8, w8, w0
	cmp	w8, #128
	cbz	x9, LBB0_4
; %bb.1:
	b.eq	LBB0_8
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_9
; %bb.3:
Lloh7:
	adrp	x8, _udma_timing_shasta@GOTPAGE
Lloh8:
	ldr	x8, [x8, _udma_timing_shasta@GOTPAGEOFF]
	b	LBB0_7
LBB0_4:
	b.eq	LBB0_10
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_12
; %bb.6:
Lloh9:
	adrp	x8, _udma_timing_kauai@GOTPAGE
Lloh10:
	ldr	x8, [x8, _udma_timing_kauai@GOTPAGEOFF]
LBB0_7:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _ATA_MODE_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_MODE_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w9, w9, w0
	ldr	w8, [x8, w9, sxtw #2]
	ldr	x9, [x19, #16]
	b	LBB0_14
LBB0_8:
	sbfiz	x8, x20, #2, #32
	ldp	x10, x9, [x19, #8]
	str	wzr, [x9, x8]
Lloh14:
	adrp	x9, _dma_timing_shasta@GOTPAGE
Lloh15:
	ldr	x9, [x9, _dma_timing_shasta@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh16:
	adrp	x8, _pio_timing_shasta@GOTPAGE
Lloh17:
	ldr	x8, [x8, _pio_timing_shasta@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	sbfiz	x8, x20, #2, #32
	ldp	x10, x9, [x19, #8]
	str	wzr, [x9, x8]
Lloh18:
	adrp	x9, _dma_timing_kauai@GOTPAGE
Lloh19:
	ldr	x9, [x9, _dma_timing_kauai@GOTPAGEOFF]
LBB0_11:
	ldr	x9, [x9]
Lloh20:
	adrp	x11, _ATA_MODE_MASK@GOTPAGE
Lloh21:
	ldr	x11, [x11, _ATA_MODE_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w11, [x11]
	and	w11, w11, w0
	ldr	w9, [x9, w11, sxtw #2]
	str	w9, [x10, x8]
	b	LBB0_15
LBB0_12:
Lloh23:
	adrp	x8, _pio_timing_kauai@GOTPAGE
Lloh24:
	ldr	x8, [x8, _pio_timing_kauai@GOTPAGEOFF]
LBB0_13:
Lloh25:
	adrp	x9, _ATA_MODE_MASK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ATA_MODE_MASK@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh27:
	ldr	w9, [x9]
	and	w9, w9, w0
Lloh28:
	adrp	x10, _ATA_PIO0@GOTPAGE
Lloh29:
	ldr	x10, [x10, _ATA_PIO0@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	sub	w9, w9, w10
	ldr	w8, [x8, w9, sxtw #2]
	ldr	x9, [x19]
LBB0_14:
	str	w8, [x9, w20, sxtw #2]
LBB0_15:
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_UDMA6,4,2                  ; @ATA_UDMA6
	.comm	_ATA_UDMA5,4,2                  ; @ATA_UDMA5
	.comm	_ATA_DMA_MASK,4,2               ; @ATA_DMA_MASK
	.comm	_udma_timing_shasta,8,3         ; @udma_timing_shasta
	.comm	_ATA_MODE_MASK,4,2              ; @ATA_MODE_MASK
	.comm	_dma_timing_shasta,8,3          ; @dma_timing_shasta
	.comm	_pio_timing_shasta,8,3          ; @pio_timing_shasta
	.comm	_ATA_PIO0,4,2                   ; @ATA_PIO0
	.comm	_udma_timing_kauai,8,3          ; @udma_timing_kauai
	.comm	_dma_timing_kauai,8,3           ; @dma_timing_kauai
	.comm	_pio_timing_kauai,8,3           ; @pio_timing_kauai
	.no_dead_strip	_ata_kauai_setmode
.subsections_via_symbols
