	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function timing_setup
_timing_setup:                          ## @timing_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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movl	%ecx, %r13d
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_ata_dev_pair
	movq	%rax, %r12
	movl	(%rbx), %eax
	movl	%r13d, %ebx
	addl	%eax, %eax
	addl	(%r15), %eax
	movq	%rax, %r13
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	cmpl	$2, %r14d
	movl	$15000, %r14d                   ## imm = 0x3A98
	movl	$30000, %eax                    ## imm = 0x7530
	cmovll	%eax, %r14d
	leaq	-72(%rbp), %rdx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$30000, %ecx                    ## imm = 0x7530
	movl	%r14d, %r8d
	callq	_ata_timing_compute
	testq	%rax, %rax
	js	LBB0_13
## %bb.1:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	testq	%r12, %r12
	je	LBB0_5
## %bb.2:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	4(%r12), %esi
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	leaq	-120(%rbp), %rbx
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movl	$30000, %ecx                    ## imm = 0x7530
	movl	%r14d, %r8d
	callq	_ata_timing_compute
	movq	_ATA_TIMING_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-72(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ata_timing_merge
LBB0_4:
	movl	8(%r12), %esi
	leaq	-120(%rbp), %rbx
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movl	$30000, %ecx                    ## imm = 0x7530
	movl	%r14d, %r8d
	callq	_ata_timing_compute
	movq	_ATA_TIMING_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-72(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ata_timing_merge
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
LBB0_5:
	movq	_XFER_UDMA_5@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_7
## %bb.6:
	movl	$1, -72(%rbp)
LBB0_7:
	movq	_XFER_UDMA_6@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_9
## %bb.8:
	movl	$15, -72(%rbp)
LBB0_9:
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	leal	12(%r14), %esi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	leal	(%r13,%r13), %eax
	movb	$6, %r12b
	subb	%al, %r12b
	movl	$3, %ebx
	movl	%r12d, %ecx
	shll	%cl, %ebx
	notl	%ebx
	andl	-44(%rbp), %ebx
	movl	-68(%rbp), %edi
	movl	$1, %esi
	movl	$4, %edx
	callq	_clamp_val
	movl	$4294967295, %r15d              ## imm = 0xFFFFFFFF
	leaq	(%rax,%r15), %rdx
	movl	%r12d, %ecx
	shlq	%cl, %rdx
	orl	%ebx, %edx
	movl	%edx, -44(%rbp)
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pci_write_config_byte
	movl	%r13d, %eax
	sarl	%eax
	negl	%eax
	addl	%r14d, %eax
	addl	$15, %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	-64(%rbp), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	shll	$4, %eax
	leal	-16(%rax), %ebx
	movl	-60(%rbp), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	leal	(%rax,%r15), %edx
	orl	%ebx, %edx
	movq	%r12, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_byte
	subl	%r13d, %r14d
	movq	%r12, %r13
	movq	%r14, %r12
	addl	$11, %r14d
	movl	-56(%rbp), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	shll	$4, %eax
	leal	-16(%rax), %ebx
	movl	-52(%rbp), %edi
	movl	$1, %esi
	movl	$16, %edx
	callq	_clamp_val
	addl	%eax, %r15d
	orl	%ebx, %r15d
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_pci_write_config_byte
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	decl	%ecx
	cmpl	$3, %ecx
	ja	LBB0_24
## %bb.10:
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rcx,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_11:
	movl	-72(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_27
## %bb.12:
	movl	$2, %esi
	movl	$5, %edx
	callq	_clamp_val
	movq	%rax, %rdx
	addl	$-2, %edx
	jmp	LBB0_21
LBB0_13:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rdx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %ecx
	callq	_dev_printk
	jmp	LBB0_24
LBB0_14:
	movl	-72(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_27
## %bb.15:
	movl	$2, %esi
	movl	$10, %edx
	jmp	LBB0_20
LBB0_16:
	movl	-72(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_27
## %bb.17:
	movl	$1, %esi
	movl	$10, %edx
	jmp	LBB0_20
LBB0_18:
	movl	-72(%rbp), %edi
	testl	%edi, %edi
	je	LBB0_27
## %bb.19:
	movl	$1, %esi
	movl	$15, %edx
LBB0_20:
	callq	_clamp_val
	leaq	_timing_setup.amd_cyc2udma(%rip), %rcx
	movzbl	(%rax,%rcx), %edx
LBB0_21:
	orl	$192, %edx
	jmp	LBB0_22
LBB0_27:
	movl	$3, %edx
LBB0_22:
	movl	%edx, -44(%rbp)
	cmpl	$0, -72(%rbp)
	je	LBB0_24
## %bb.23:
	addl	$19, %r12d
	movq	%r13, %rdi
	movl	%r12d, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pci_write_config_byte
LBB0_24:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_18, LBB0_18-LJTI0_0
LJTI0_0:
	.long	L0_0_set_11
	.long	L0_0_set_14
	.long	L0_0_set_16
	.long	L0_0_set_18
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @timing_setup.amd_cyc2udma
_timing_setup.amd_cyc2udma:
	.ascii	"\006\006\005\004\000\001\001\002\002\003\003\003\003\003\003\007"

	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown mode %d.\n"

	.comm	_ATA_TIMING_8BIT,4,2            ## @ATA_TIMING_8BIT
	.comm	_XFER_UDMA_5,4,2                ## @XFER_UDMA_5
	.comm	_XFER_UDMA_6,4,2                ## @XFER_UDMA_6
	.no_dead_strip	_timing_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function timing_setup
_timing_setup:                          ; @timing_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x4
	mov	x21, x3
	mov	x20, x2
	mov	x24, x1
	mov	x25, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	mov	x0, x24
	bl	_ata_dev_pair
	mov	x22, x0
	ldr	w26, [x25]
	ldr	w27, [x24]
	subs	w25, w23, #1
	mov	w8, #30000
	mov	w9, #15000
	csel	w23, w9, w8, gt
	add	x2, sp, #40
	mov	x0, x24
	mov	x1, x21
	mov	w3, #30000
	mov	x4, x23
	bl	_ata_timing_compute
	tbnz	x0, #63, LBB0_13
; %bb.1:
	cbz	x22, LBB0_5
; %bb.2:
	ldr	w1, [x22, #4]
Lloh0:
	adrp	x24, _ATA_TIMING_8BIT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ATA_TIMING_8BIT@GOTPAGEOFF]
	cbz	w1, LBB0_4
; %bb.3:
	add	x2, sp, #16
	mov	x0, x22
	mov	w3, #30000
	mov	x4, x23
	bl	_ata_timing_compute
	ldr	w3, [x24]
	add	x0, sp, #16
	add	x1, sp, #40
	add	x2, sp, #40
	bl	_ata_timing_merge
LBB0_4:
	ldr	w1, [x22, #8]
	add	x2, sp, #16
	mov	x0, x22
	mov	w3, #30000
	mov	x4, x23
	bl	_ata_timing_compute
	ldr	w3, [x24]
	add	x0, sp, #16
	add	x1, sp, #40
	add	x2, sp, #40
	bl	_ata_timing_merge
LBB0_5:
Lloh2:
	adrp	x8, _XFER_UDMA_5@GOTPAGE
Lloh3:
	ldr	x8, [x8, _XFER_UDMA_5@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.6:
	mov	w8, #1
	str	w8, [sp, #40]
LBB0_7:
	add	w22, w27, w26, lsl #1
Lloh5:
	adrp	x8, _XFER_UDMA_6@GOTPAGE
Lloh6:
	ldr	x8, [x8, _XFER_UDMA_6@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ne	LBB0_9
; %bb.8:
	mov	w8, #15
	str	w8, [sp, #40]
LBB0_9:
	add	w21, w20, #12
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	mov	w9, #6
	sub	w23, w9, w22, lsl #1
	mov	w9, #3
	lsl	w9, w9, w23
	bic	w24, w8, w9
	ldr	w0, [sp, #44]
	mov	w1, #1
	mov	w2, #4
	bl	_clamp_val
	mov	w8, #-1
	add	x8, x0, x8
	lsl	x8, x8, x23
	orr	w2, w24, w8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
	sub	w8, w20, w22, asr #1
	add	w21, w8, #15
	ldr	w0, [sp, #48]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	lsl	w8, w0, #4
	sub	w23, w8, #16
	ldr	w0, [sp, #52]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	sub	w8, w0, #1
	orr	w2, w8, w23
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
	sub	w21, w20, w22
	add	w20, w21, #11
	ldr	w0, [sp, #56]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	lsl	w8, w0, #4
	sub	w22, w8, #16
	ldr	w0, [sp, #60]
	mov	w1, #1
	mov	w2, #16
	bl	_clamp_val
	sub	w8, w0, #1
	orr	w2, w8, w22
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_byte
	cmp	w25, #3
	b.hi	LBB0_25
; %bb.10:
Lloh8:
	adrp	x8, lJTI0_0@PAGE
Lloh9:
	add	x8, x8, lJTI0_0@PAGEOFF
	adr	x9, LBB0_11
	ldrb	w10, [x8, x25]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_11:
	ldr	w0, [sp, #40]
	cbz	w0, LBB0_22
; %bb.12:
	mov	w1, #2
	mov	w2, #5
	bl	_clamp_val
	sub	w8, w0, #2
	b	LBB0_21
LBB0_13:
Lloh10:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	mov	x1, x19
	mov	x3, x21
	bl	_dev_printk
	b	LBB0_25
LBB0_14:
	ldr	w0, [sp, #40]
	cbz	w0, LBB0_22
; %bb.15:
	mov	w1, #2
	mov	w2, #10
	b	LBB0_20
LBB0_16:
	ldr	w0, [sp, #40]
	cbz	w0, LBB0_22
; %bb.17:
	mov	w1, #1
	mov	w2, #10
	b	LBB0_20
LBB0_18:
	ldr	w0, [sp, #40]
	cbz	w0, LBB0_22
; %bb.19:
	mov	w1, #1
	mov	w2, #15
LBB0_20:
	bl	_clamp_val
Lloh15:
	adrp	x8, _timing_setup.amd_cyc2udma@PAGE
Lloh16:
	add	x8, x8, _timing_setup.amd_cyc2udma@PAGEOFF
	ldrb	w8, [x8, x0]
LBB0_21:
	orr	w2, w8, #0xc0
	b	LBB0_23
LBB0_22:
	mov	w2, #3
LBB0_23:
	str	w2, [sp, #12]
	ldr	w8, [sp, #40]
	cbz	w8, LBB0_25
; %bb.24:
	add	w1, w21, #19
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_25:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_11-LBB0_11)>>2
	.byte	(LBB0_14-LBB0_11)>>2
	.byte	(LBB0_16-LBB0_11)>>2
	.byte	(LBB0_18-LBB0_11)>>2
                                        ; -- End function
_timing_setup.amd_cyc2udma:             ; @timing_setup.amd_cyc2udma
	.ascii	"\006\006\005\004\000\001\001\002\002\003\003\003\003\003\003\007"

	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown mode %d.\n"

	.comm	_ATA_TIMING_8BIT,4,2            ; @ATA_TIMING_8BIT
	.comm	_XFER_UDMA_5,4,2                ; @XFER_UDMA_5
	.comm	_XFER_UDMA_6,4,2                ; @XFER_UDMA_6
	.no_dead_strip	_timing_setup
.subsections_via_symbols
