	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cmd64x_program_timings
_cmd64x_program_timings:                ## @cmd64x_program_timings
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	16(%rdi), %r13
	movl	8(%r13), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movq	_ide_pci_clk@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	$33, %ecx
	cmovnel	%eax, %ecx
	movl	$1000000, %eax                  ## imm = 0xF4240
	xorl	%edx, %edx
	idivl	%ecx
	movslq	%eax, %r15
	movl	$0, -44(%rbp)
	leaq	-56(%rbp), %rdx
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_ide_timing_compute
	movl	-56(%rbp), %eax
	leal	-16(%rax), %edx
	cmpl	$16, %eax
	movl	$16, %ecx
	cmovgel	%ecx, %eax
	movl	$0, %esi
	cmovlel	%esi, %edx
	cltq
	addl	-52(%rbp), %edx
	cmpl	$16, %edx
	cmovgel	%ecx, %edx
	leaq	_cmd64x_program_timings.recovery_values(%rip), %rcx
	movl	(%rcx,%rax,4), %eax
	movl	%eax, -56(%rbp)
	andl	$15, %edx
	movl	%edx, -52(%rbp)
	movq	(%r12), %rcx
	leaq	_cmd64x_program_timings.drwtim_regs(%rip), %rsi
	movl	(%rsi,%rcx,4), %esi
	shll	$4, %edx
	orl	%eax, %edx
	movq	%r14, %rdi
	callq	_pci_write_config_byte
	cmpq	$0, (%r13)
	je	LBB0_4
## %bb.1:
	movq	%r12, %rdi
	callq	_ide_get_pair_dev
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	%rax, %rbx
	movl	8(%rax), %esi
	leaq	-72(%rbp), %rdx
	movq	%rax, %rdi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_ide_timing_compute
	movq	_IDE_TIMING_SETUP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rdi
	leaq	-72(%rbp), %rsi
	movq	%rdi, %rdx
	callq	_ide_timing_merge
	movl	12(%rbx), %esi
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	leaq	-72(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rbx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_ide_timing_compute
	movq	_IDE_TIMING_SETUP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ide_timing_merge
LBB0_4:
	cmpl	$6, -48(%rbp)
	jl	LBB0_6
## %bb.5:
	movl	$5, -48(%rbp)
LBB0_6:
	movq	(%r12), %rax
	leaq	_cmd64x_program_timings.arttim_regs(%rip), %rbx
	movl	(%rbx,%rax,4), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	cmpq	$0, (%r13)
	je	LBB0_7
## %bb.8:
	movq	_ARTTIM23_INTR_CH1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-44(%rbp), %edx
	jmp	LBB0_9
LBB0_7:
	movl	-44(%rbp), %edx
LBB0_9:
	andl	$-193, %edx
	movslq	-48(%rbp), %rax
	leaq	_cmd64x_program_timings.setup_values(%rip), %rcx
	orl	(%rcx,%rax,4), %edx
	movl	%edx, -44(%rbp)
	movq	(%r12), %rax
	movl	(%rbx,%rax,4), %esi
	movq	%r14, %rdi
	callq	_pci_write_config_byte
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ide_pci_clk,4,2                ## @ide_pci_clk
	.section	__TEXT,__const
	.p2align	4                               ## @cmd64x_program_timings.recovery_values
_cmd64x_program_timings.recovery_values:
	.long	15                              ## 0xf
	.long	15                              ## 0xf
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	4                               ## 0x4
	.long	5                               ## 0x5
	.long	6                               ## 0x6
	.long	7                               ## 0x7
	.long	8                               ## 0x8
	.long	9                               ## 0x9
	.long	10                              ## 0xa
	.long	11                              ## 0xb
	.long	12                              ## 0xc
	.long	13                              ## 0xd
	.long	14                              ## 0xe
	.long	0                               ## 0x0

	.p2align	4                               ## @cmd64x_program_timings.setup_values
_cmd64x_program_timings.setup_values:
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	64                              ## 0x40
	.long	128                             ## 0x80
	.long	0                               ## 0x0
	.long	192                             ## 0xc0

	.p2align	4                               ## @cmd64x_program_timings.arttim_regs
_cmd64x_program_timings.arttim_regs:
	.long	134                             ## 0x86
	.long	133                             ## 0x85
	.long	132                             ## 0x84
	.long	132                             ## 0x84

	.p2align	4                               ## @cmd64x_program_timings.drwtim_regs
_cmd64x_program_timings.drwtim_regs:
	.long	131                             ## 0x83
	.long	130                             ## 0x82
	.long	129                             ## 0x81
	.long	128                             ## 0x80

	.comm	_IDE_TIMING_SETUP,4,2           ## @IDE_TIMING_SETUP
	.comm	_ARTTIM23_INTR_CH1,4,2          ## @ARTTIM23_INTR_CH1
	.no_dead_strip	_cmd64x_program_timings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cmd64x_program_timings
_cmd64x_program_timings:                ; @cmd64x_program_timings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, x1
	mov	x19, x0
	ldr	x23, [x0, #16]
	ldr	w0, [x23, #8]
	bl	_to_pci_dev
	mov	x20, x0
Lloh0:
	adrp	x8, _ide_pci_clk@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ide_pci_clk@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #33
	cmp	w8, #0
	csel	w8, w9, w8, eq
	mov	w9, #16960
	movk	w9, #15, lsl #16
	sdiv	w8, w9, w8
	sxtw	x21, w8
	str	wzr, [sp, #12]
	add	x2, sp, #16
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	mov	w4, #0
	bl	_ide_timing_compute
	ldp	w8, w9, [sp, #16]
	subs	w10, w8, #16
	mov	w11, #16
	csel	w8, w8, w11, lt
	csel	w10, w10, wzr, gt
	add	w9, w9, w10
Lloh3:
	adrp	x10, _cmd64x_program_timings.recovery_values@PAGE
Lloh4:
	add	x10, x10, _cmd64x_program_timings.recovery_values@PAGEOFF
	cmp	w9, #16
	csel	w9, w9, w11, lt
	ldr	w8, [x10, w8, sxtw #2]
	and	w9, w9, #0xf
	stp	w8, w9, [sp, #16]
	ldr	x10, [x19]
Lloh5:
	adrp	x11, _cmd64x_program_timings.drwtim_regs@PAGE
Lloh6:
	add	x11, x11, _cmd64x_program_timings.drwtim_regs@PAGEOFF
	ldr	w1, [x11, x10, lsl #2]
	orr	w2, w8, w9, lsl #4
	mov	x0, x20
	bl	_pci_write_config_byte
	ldr	x8, [x23]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_ide_get_pair_dev
	cbz	x0, LBB0_4
; %bb.2:
	mov	x22, x0
	ldr	w1, [x0, #8]
	mov	x2, sp
	mov	x3, x21
	mov	w4, #0
	bl	_ide_timing_compute
Lloh7:
	adrp	x24, _IDE_TIMING_SETUP@GOTPAGE
Lloh8:
	ldr	x24, [x24, _IDE_TIMING_SETUP@GOTPAGEOFF]
	ldr	w3, [x24]
	add	x0, sp, #16
	mov	x1, sp
	add	x2, sp, #16
	bl	_ide_timing_merge
	ldr	w1, [x22, #12]
	cbz	w1, LBB0_4
; %bb.3:
	mov	x2, sp
	mov	x0, x22
	mov	x3, x21
	mov	w4, #0
	bl	_ide_timing_compute
	ldr	w3, [x24]
	mov	x0, sp
	add	x1, sp, #16
	add	x2, sp, #16
	bl	_ide_timing_merge
LBB0_4:
	ldr	w8, [sp, #24]
	cmp	w8, #6
	b.lt	LBB0_6
; %bb.5:
	mov	w8, #5
	str	w8, [sp, #24]
LBB0_6:
	ldr	x8, [x19]
Lloh9:
	adrp	x21, _cmd64x_program_timings.arttim_regs@PAGE
Lloh10:
	add	x21, x21, _cmd64x_program_timings.arttim_regs@PAGEOFF
	ldr	w1, [x21, x8, lsl #2]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_byte
	ldr	x8, [x23]
	cbz	x8, LBB0_8
; %bb.7:
Lloh11:
	adrp	x8, _ARTTIM23_INTR_CH1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ARTTIM23_INTR_CH1@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	b	LBB0_9
LBB0_8:
	ldr	w8, [sp, #12]
LBB0_9:
	ldrsw	x9, [sp, #24]
Lloh14:
	adrp	x10, _cmd64x_program_timings.setup_values@PAGE
Lloh15:
	add	x10, x10, _cmd64x_program_timings.setup_values@PAGEOFF
	ldr	w9, [x10, x9, lsl #2]
	and	w8, w8, #0xffffff3f
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	x8, [x19]
	ldr	w1, [x21, x8, lsl #2]
	mov	x0, x20
	bl	_pci_write_config_byte
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ide_pci_clk,4,2                ; @ide_pci_clk
	.section	__TEXT,__const
	.p2align	2                               ; @cmd64x_program_timings.recovery_values
_cmd64x_program_timings.recovery_values:
	.long	15                              ; 0xf
	.long	15                              ; 0xf
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.long	5                               ; 0x5
	.long	6                               ; 0x6
	.long	7                               ; 0x7
	.long	8                               ; 0x8
	.long	9                               ; 0x9
	.long	10                              ; 0xa
	.long	11                              ; 0xb
	.long	12                              ; 0xc
	.long	13                              ; 0xd
	.long	14                              ; 0xe
	.long	0                               ; 0x0

	.p2align	2                               ; @cmd64x_program_timings.setup_values
_cmd64x_program_timings.setup_values:
	.long	64                              ; 0x40
	.long	64                              ; 0x40
	.long	64                              ; 0x40
	.long	128                             ; 0x80
	.long	0                               ; 0x0
	.long	192                             ; 0xc0

	.p2align	2                               ; @cmd64x_program_timings.arttim_regs
_cmd64x_program_timings.arttim_regs:
	.long	134                             ; 0x86
	.long	133                             ; 0x85
	.long	132                             ; 0x84
	.long	132                             ; 0x84

	.p2align	2                               ; @cmd64x_program_timings.drwtim_regs
_cmd64x_program_timings.drwtim_regs:
	.long	131                             ; 0x83
	.long	130                             ; 0x82
	.long	129                             ; 0x81
	.long	128                             ; 0x80

	.comm	_IDE_TIMING_SETUP,4,2           ; @IDE_TIMING_SETUP
	.comm	_ARTTIM23_INTR_CH1,4,2          ; @ARTTIM23_INTR_CH1
	.no_dead_strip	_cmd64x_program_timings
.subsections_via_symbols
