	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cs5535_set_speed
_cs5535_set_speed:                      ## @cs5535_set_speed
	.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	%rsi, %r14
	movl	(%rdi), %r13d
	movq	_XFER_SW_DMA_0@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jle	LBB0_11
## %bb.1:
	callq	_ide_get_pair_dev
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rcx
	subq	(%rcx), %r14
	movq	%r14, %r15
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %rdi
	movl	$255, %esi
	movl	$4, %edx
	callq	_ide_get_best_pio_mode
	movq	%rax, %r15
	cmpq	%r14, %rax
	cmovgeq	%r14, %r15
LBB0_3:
	movq	_cs5535_pio_cmd_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r15,4), %ebx
	shll	$16, %ebx
	movq	_cs5535_pio_dta_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r14,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	orl	%eax, %ebx
	testb	$1, %r13b
	movq	_ATAC_CH0D1_PIO@GOTPCREL(%rip), %rcx
	movq	_ATAC_CH0D0_PIO@GOTPCREL(%rip), %r12
	movq	%rcx, %rax
	cmoveq	%r12, %rax
	movl	(%rax), %edi
	movq	%r12, %r14
	cmoveq	%rcx, %r14
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_wrmsr
	movl	(%r14), %edi
	movl	%ebx, %esi
	callq	_rdmsr
	movl	%ebx, %ecx
	sarl	$16, %ecx
	movq	_cs5535_pio_cmd_timings@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r15,4), %eax
	notl	%ecx
	testl	%ecx, %eax
	je	LBB0_7
## %bb.4:
	movzwl	-44(%rbp), %ecx                 ## 2-byte Folded Reload
	shll	$16, %eax
	movl	%eax, %ebx
	orl	%ecx, %ebx
	movl	%r13d, %r14d
	testb	$1, %r13b
	jne	LBB0_6
## %bb.5:
	movq	_ATAC_CH0D1_PIO@GOTPCREL(%rip), %r12
LBB0_6:
	movl	(%r12), %edi
	movl	%ebx, %esi
	xorl	%edx, %edx
	callq	_wrmsr
	movl	%r14d, %r13d
LBB0_7:
	testb	$1, %r13b
	jne	LBB0_8
## %bb.9:
	movq	_ATAC_CH0D0_DMA@GOTPCREL(%rip), %r14
	jmp	LBB0_10
LBB0_11:
	testb	$1, %r13b
	jne	LBB0_12
## %bb.13:
	movq	_ATAC_CH0D0_DMA@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_8:
	movq	_ATAC_CH0D1_DMA@GOTPCREL(%rip), %r14
LBB0_10:
	movl	(%r14), %edi
	movl	%ebx, %esi
	callq	_rdmsr
	movl	(%r14), %edi
	orl	$-2147483648, %ebx              ## imm = 0x80000000
	movl	%ebx, %esi
	jmp	LBB0_24
LBB0_12:
	movq	_ATAC_CH0D1_DMA@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_rdmsr
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%r14, %rax
	jg	LBB0_17
## %bb.15:
	movq	_XFER_UDMA_4@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jl	LBB0_17
## %bb.16:
	movq	_cs5535_udma_timings@GOTPCREL(%rip), %rcx
	jmp	LBB0_20
LBB0_17:
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%r14, %rax
	jg	LBB0_25
## %bb.18:
	movq	_XFER_MW_DMA_2@GOTPCREL(%rip), %rcx
	cmpq	%r14, (%rcx)
	jl	LBB0_25
## %bb.19:
	movq	_cs5535_mwdma_timings@GOTPCREL(%rip), %rcx
LBB0_20:
	subq	%rax, %r14
	movq	(%rcx), %rax
	movl	(%rax,%r14,4), %esi
	testb	$1, %r13b
	jne	LBB0_21
## %bb.22:
	movq	_ATAC_CH0D0_DMA@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_21:
	movq	_ATAC_CH0D1_DMA@GOTPCREL(%rip), %rax
LBB0_23:
	movl	(%rax), %edi
LBB0_24:
	xorl	%edx, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wrmsr                          ## TAILCALL
LBB0_25:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_SW_DMA_0,8,3              ## @XFER_SW_DMA_0
	.comm	_XFER_PIO_0,8,3                 ## @XFER_PIO_0
	.comm	_cs5535_pio_cmd_timings,8,3     ## @cs5535_pio_cmd_timings
	.comm	_cs5535_pio_dta_timings,8,3     ## @cs5535_pio_dta_timings
	.comm	_ATAC_CH0D1_PIO,4,2             ## @ATAC_CH0D1_PIO
	.comm	_ATAC_CH0D0_PIO,4,2             ## @ATAC_CH0D0_PIO
	.comm	_ATAC_CH0D1_DMA,4,2             ## @ATAC_CH0D1_DMA
	.comm	_ATAC_CH0D0_DMA,4,2             ## @ATAC_CH0D0_DMA
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_XFER_UDMA_4,8,3                ## @XFER_UDMA_4
	.comm	_cs5535_udma_timings,8,3        ## @cs5535_udma_timings
	.comm	_XFER_MW_DMA_0,8,3              ## @XFER_MW_DMA_0
	.comm	_XFER_MW_DMA_2,8,3              ## @XFER_MW_DMA_2
	.comm	_cs5535_mwdma_timings,8,3       ## @cs5535_mwdma_timings
	.no_dead_strip	_cs5535_set_speed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cs5535_set_speed
_cs5535_set_speed:                      ; @cs5535_set_speed
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	ldr	w21, [x0]
Lloh0:
	adrp	x8, _XFER_SW_DMA_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_SW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x1
	b.le	LBB0_6
; %bb.1:
	bl	_ide_get_pair_dev
Lloh3:
	adrp	x8, _XFER_PIO_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_PIO_0@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	sub	x19, x19, x8
	mov	x8, x19
	cbz	x0, LBB0_3
; %bb.2:
	mov	w1, #255
	mov	w2, #4
	bl	_ide_get_best_pio_mode
	cmp	x0, x19
	csel	x8, x0, x19, lt
LBB0_3:
Lloh6:
	adrp	x24, _cs5535_pio_cmd_timings@GOTPAGE
Lloh7:
	ldr	x24, [x24, _cs5535_pio_cmd_timings@GOTPAGEOFF]
	ldr	x9, [x24]
	lsl	x25, x8, #2
	ldr	w8, [x9, x25]
Lloh8:
	adrp	x9, _cs5535_pio_dta_timings@GOTPAGE
Lloh9:
	ldr	x9, [x9, _cs5535_pio_dta_timings@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	ldr	w19, [x9, x19, lsl #2]
Lloh11:
	adrp	x22, _ATAC_CH0D1_PIO@GOTPAGE
Lloh12:
	ldr	x22, [x22, _ATAC_CH0D1_PIO@GOTPAGEOFF]
	orr	w20, w19, w8, lsl #16
Lloh13:
	adrp	x23, _ATAC_CH0D0_PIO@GOTPAGE
Lloh14:
	ldr	x23, [x23, _ATAC_CH0D0_PIO@GOTPAGEOFF]
	tst	w21, #0x1
	csel	x8, x23, x22, eq
	ldr	w0, [x8]
	csel	x26, x22, x23, eq
	mov	x1, x20
	mov	w2, #0
	bl	_wrmsr
	ldr	w0, [x26]
	mov	x1, x20
	bl	_rdmsr
	ldr	x8, [x24]
	ldr	w8, [x8, x25]
	bics	wzr, w8, w20, asr #16
	b.eq	LBB0_5
; %bb.4:
	bfi	w19, w8, #16, #16
	tst	w21, #0x1
	csel	x8, x22, x23, eq
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #0
	bl	_wrmsr
	mov	x20, x19
LBB0_5:
Lloh15:
	adrp	x8, _ATAC_CH0D1_DMA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATAC_CH0D1_DMA@GOTPAGEOFF]
Lloh17:
	adrp	x9, _ATAC_CH0D0_DMA@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ATAC_CH0D0_DMA@GOTPAGEOFF]
	tst	w21, #0x1
	csel	x19, x9, x8, eq
	ldr	w0, [x19]
	mov	x1, x20
	bl	_rdmsr
	ldr	w0, [x19]
	orr	w1, w20, #0x80000000
	b	LBB0_12
LBB0_6:
Lloh19:
	adrp	x20, _ATAC_CH0D1_DMA@GOTPAGE
Lloh20:
	ldr	x20, [x20, _ATAC_CH0D1_DMA@GOTPAGEOFF]
Lloh21:
	adrp	x22, _ATAC_CH0D0_DMA@GOTPAGE
Lloh22:
	ldr	x22, [x22, _ATAC_CH0D0_DMA@GOTPAGEOFF]
	tst	w21, #0x1
	csel	x8, x22, x20, eq
	ldr	w0, [x8]
	mov	w1, #0
	bl	_rdmsr
Lloh23:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh24:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
Lloh26:
	adrp	x9, _XFER_UDMA_4@GOTPAGE
Lloh27:
	ldr	x9, [x9, _XFER_UDMA_4@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x8, x19
	ccmp	x9, x19, #8, le
	b.ge	LBB0_9
; %bb.7:
Lloh29:
	adrp	x8, _XFER_MW_DMA_0@GOTPAGE
Lloh30:
	ldr	x8, [x8, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
Lloh32:
	adrp	x9, _XFER_MW_DMA_2@GOTPAGE
Lloh33:
	ldr	x9, [x9, _XFER_MW_DMA_2@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x8, x19
	ccmp	x9, x19, #8, le
	b.ge	LBB0_10
; %bb.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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
Lloh35:
	adrp	x9, _cs5535_udma_timings@GOTPAGE
Lloh36:
	ldr	x9, [x9, _cs5535_udma_timings@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh37:
	adrp	x9, _cs5535_mwdma_timings@GOTPAGE
Lloh38:
	ldr	x9, [x9, _cs5535_mwdma_timings@GOTPAGEOFF]
LBB0_11:
	ldr	x9, [x9]
	sub	x8, x19, x8
	ldr	w1, [x9, x8, lsl #2]
	tst	w21, #0x1
	csel	x8, x22, x20, eq
	ldr	w0, [x8]
LBB0_12:
	mov	w2, #0
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_wrmsr
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_SW_DMA_0,8,3              ; @XFER_SW_DMA_0
	.comm	_XFER_PIO_0,8,3                 ; @XFER_PIO_0
	.comm	_cs5535_pio_cmd_timings,8,3     ; @cs5535_pio_cmd_timings
	.comm	_cs5535_pio_dta_timings,8,3     ; @cs5535_pio_dta_timings
	.comm	_ATAC_CH0D1_PIO,4,2             ; @ATAC_CH0D1_PIO
	.comm	_ATAC_CH0D0_PIO,4,2             ; @ATAC_CH0D0_PIO
	.comm	_ATAC_CH0D1_DMA,4,2             ; @ATAC_CH0D1_DMA
	.comm	_ATAC_CH0D0_DMA,4,2             ; @ATAC_CH0D0_DMA
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_XFER_UDMA_4,8,3                ; @XFER_UDMA_4
	.comm	_cs5535_udma_timings,8,3        ; @cs5535_udma_timings
	.comm	_XFER_MW_DMA_0,8,3              ; @XFER_MW_DMA_0
	.comm	_XFER_MW_DMA_2,8,3              ; @XFER_MW_DMA_2
	.comm	_cs5535_mwdma_timings,8,3       ; @cs5535_mwdma_timings
	.no_dead_strip	_cs5535_set_speed
.subsections_via_symbols
