	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_timing_compute             ## -- Begin function ata_timing_compute
	.p2align	4, 0x90
_ata_timing_compute:                    ## @ata_timing_compute
	.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	%r8d, %r14d
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movl	%esi, %r13d
	movq	%rdi, %r12
	movl	%esi, %edi
	callq	_ata_timing_find_mode
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movl	$40, %edx
	callq	_memcpy
	movq	(%r12), %rax
	movq	_ATA_ID_FIELD_VALID@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	testb	$2, (%rax,%rcx,4)
	je	LBB0_14
## %bb.3:
	leaq	-80(%rbp), %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	cmpw	%r13w, (%rax)
	ja	LBB0_9
## %bb.4:
	movq	_XFER_SW_DMA_0@GOTPCREL(%rip), %rax
	cmpw	%r13w, (%rax)
	jb	LBB0_9
## %bb.5:
	movq	_XFER_PIO_2@GOTPCREL(%rip), %rcx
	movq	(%r12), %rax
	cmpw	%r13w, (%rcx)
	jae	LBB0_6
## %bb.8:
	movq	_ATA_ID_EIDE_PIO_IORDY@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_22
LBB0_9:
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	cmpw	%r13w, (%rax)
	ja	LBB0_13
## %bb.10:
	movq	_XFER_MW_DMA_2@GOTPCREL(%rip), %rax
	cmpw	%r13w, (%rax)
	jb	LBB0_13
## %bb.11:
	movq	(%r12), %rax
	movq	_ATA_ID_EIDE_DMA_MIN@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	jmp	LBB0_12
LBB0_6:
	movq	_ATA_ID_EIDE_PIO@GOTPCREL(%rip), %rcx
LBB0_7:
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, -76(%rbp)
LBB0_12:
	movl	%eax, -80(%rbp)
LBB0_13:
	movq	_ATA_TIMING_CYCLE@GOTPCREL(%rip), %rax
	movq	_ATA_TIMING_CYC8B@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	-80(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%rbx, %rdx
	callq	_ata_timing_merge
LBB0_14:
	movq	%rbx, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_ata_timing_quantize
	movq	_XFER_PIO_6@GOTPCREL(%rip), %rax
	cmpw	%r13w, (%rax)
	jae	LBB0_16
## %bb.15:
	movzwl	8(%r12), %esi
	leaq	-80(%rbp), %r13
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	%r15d, %ecx
	movl	%r14d, %r8d
	callq	_ata_timing_compute
	movq	_ATA_TIMING_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movq	%rbx, %rdx
	callq	_ata_timing_merge
LBB0_16:
	movq	8(%rbx), %rax
	movq	16(%rbx), %rdx
	addq	%rax, %rdx
	movslq	4(%rbx), %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_18
## %bb.17:
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	movq	%rsi, %rdx
	shrq	$63, %rdx
	addq	%rsi, %rdx
	sarq	%rdx
	addq	%rax, %rdx
	movq	%rdx, 8(%rbx)
	subq	%rdx, %rcx
	movq	%rcx, 16(%rbx)
LBB0_18:
	movq	24(%rbx), %rax
	movq	32(%rbx), %rdx
	addq	%rax, %rdx
	movslq	(%rbx), %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_20
## %bb.19:
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	movq	%rsi, %rdx
	shrq	$63, %rdx
	addq	%rsi, %rdx
	sarq	%rdx
	addq	%rax, %rdx
	movq	%rdx, 24(%rbx)
	subq	%rdx, %rcx
	movq	%rcx, 32(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_22
LBB0_20:
	xorl	%eax, %eax
	cmpq	%rcx, %rdx
	jle	LBB0_22
## %bb.21:
	movl	%edx, (%rbx)
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATA_ID_FIELD_VALID,8,3         ## @ATA_ID_FIELD_VALID
	.comm	_XFER_PIO_0,2,1                 ## @XFER_PIO_0
	.comm	_XFER_SW_DMA_0,2,1              ## @XFER_SW_DMA_0
	.comm	_XFER_PIO_2,2,1                 ## @XFER_PIO_2
	.comm	_ATA_ID_EIDE_PIO,8,3            ## @ATA_ID_EIDE_PIO
	.comm	_ATA_ID_EIDE_PIO_IORDY,8,3      ## @ATA_ID_EIDE_PIO_IORDY
	.comm	_XFER_MW_DMA_0,2,1              ## @XFER_MW_DMA_0
	.comm	_XFER_MW_DMA_2,2,1              ## @XFER_MW_DMA_2
	.comm	_ATA_ID_EIDE_DMA_MIN,8,3        ## @ATA_ID_EIDE_DMA_MIN
	.comm	_ATA_TIMING_CYCLE,4,2           ## @ATA_TIMING_CYCLE
	.comm	_ATA_TIMING_CYC8B,4,2           ## @ATA_TIMING_CYC8B
	.comm	_XFER_PIO_6,2,1                 ## @XFER_PIO_6
	.comm	_ATA_TIMING_ALL,4,2             ## @ATA_TIMING_ALL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ata_timing_compute             ; -- Begin function ata_timing_compute
	.p2align	2
_ata_timing_compute:                    ; @ata_timing_compute
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x4
	mov	x21, x3
	mov	x19, x2
	mov	x23, x1
	mov	x22, x0
	mov	x0, x1
	bl	_ata_timing_find_mode
	cbz	x0, LBB0_5
; %bb.1:
	mov	x1, x0
	mov	x0, x19
	mov	w2, #40
	bl	_memcpy
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _ATA_ID_FIELD_VALID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ATA_ID_FIELD_VALID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w8, [x8, x9, lsl #2]
	tbz	w8, #1, LBB0_12
; %bb.2:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #40
	bl	_memset
Lloh3:
	adrp	x8, _XFER_PIO_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_PIO_0@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh5:
	adrp	x9, _XFER_SW_DMA_0@GOTPAGE
Lloh6:
	ldr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0_10:
	str	w8, [sp, #8]
LBB0_11:
Lloh23:
	adrp	x8, _ATA_TIMING_CYCLE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ATA_TIMING_CYCLE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _ATA_TIMING_CYC8B@GOTPAGE
Lloh27:
	ldr	x9, [x9, _ATA_TIMING_CYC8B@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w3, w9, w8
	add	x0, sp, #8
	mov	x1, x19
	mov	x2, x19
	bl	_ata_timing_merge
LBB0_12:
	mov	x0, x19
	mov	x1, x19
	mov	x2, x21
	mov	x3, x20
	bl	_ata_timing_quantize
Lloh29:
	adrp	x8, _XFER_PIO_6@GOTPAGE
Lloh30:
	ldr	x8, [x8, _XFER_PIO_6@GOTPAGEOFF]
	ldrh	w8, [x8]
	cmp	w8, w23
	b.hs	LBB0_14
; %bb.13:
	ldrh	w1, [x22, #8]
	add	x2, sp, #8
	mov	x0, x22
	mov	x3, x21
	mov	x4, x20
	bl	_ata_timing_compute
Lloh31:
	adrp	x8, _ATA_TIMING_ALL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ATA_TIMING_ALL@GOTPAGEOFF]
Lloh33:
	ldr	w3, [x8]
	add	x0, sp, #8
	mov	x1, x19
	mov	x2, x19
	bl	_ata_timing_merge
LBB0_14:
	ldp	x8, x10, [x19, #8]
	ldrsw	x9, [x19, #4]
	add	x10, x10, x8
	cmp	x10, x9
	b.ge	LBB0_16
; %bb.15:
	sub	x10, x9, x10
	cmp	x10, #0
	cinc	x10, x10, lt
	add	x8, x8, x10, asr #1
	sub	x9, x9, x8
	stp	x8, x9, [x19, #8]
LBB0_16:
	ldp	x8, x9, [x19, #24]
	ldrsw	x10, [x19]
	add	x9, x9, x8
	cmp	x9, x10
	b.ge	LBB0_18
; %bb.17:
	mov	w0, #0
	sub	x9, x10, x9
	cmp	x9, #0
	cinc	x9, x9, lt
	add	x8, x8, x9, asr #1
	sub	x9, x10, x8
	stp	x8, x9, [x19, #24]
	b	LBB0_20
LBB0_18:
	mov	w0, #0
	b.le	LBB0_20
; %bb.19:
	str	w9, [x19]
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATA_ID_FIELD_VALID,8,3         ; @ATA_ID_FIELD_VALID
	.comm	_XFER_PIO_0,2,1                 ; @XFER_PIO_0
	.comm	_XFER_SW_DMA_0,2,1              ; @XFER_SW_DMA_0
	.comm	_XFER_PIO_2,2,1                 ; @XFER_PIO_2
	.comm	_ATA_ID_EIDE_PIO,8,3            ; @ATA_ID_EIDE_PIO
	.comm	_ATA_ID_EIDE_PIO_IORDY,8,3      ; @ATA_ID_EIDE_PIO_IORDY
	.comm	_XFER_MW_DMA_0,2,1              ; @XFER_MW_DMA_0
	.comm	_XFER_MW_DMA_2,2,1              ; @XFER_MW_DMA_2
	.comm	_ATA_ID_EIDE_DMA_MIN,8,3        ; @ATA_ID_EIDE_DMA_MIN
	.comm	_ATA_TIMING_CYCLE,4,2           ; @ATA_TIMING_CYCLE
	.comm	_ATA_TIMING_CYC8B,4,2           ; @ATA_TIMING_CYC8B
	.comm	_XFER_PIO_6,2,1                 ; @XFER_PIO_6
	.comm	_ATA_TIMING_ALL,4,2             ; @ATA_TIMING_ALL
.subsections_via_symbols
