	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sis_ata16_program_timings
_sis_ata16_program_timings:             ## @sis_ata16_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movl	$0, -36(%rbp)
	movslq	(%rbx), %rax
	leaq	(%rax,%rax), %r15
	addq	$64, %r15
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pci_read_config_word
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	andl	$-1808, %edx                    ## imm = 0xF8F0
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	cmpq	%r12, %rsi
	jle	LBB0_1
## %bb.2:
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	subq	(%rax), %r12
	leaq	l___const.sis_ata16_program_timings.pio_timings(%rip), %rax
	movl	(%rax,%r12,4), %ecx
	jmp	LBB0_3
LBB0_1:
	movq	_chipset_family@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_ATA_16@GOTPCREL(%rip), %rdi
	andl	$-34576, %eax                   ## imm = 0xFFFF78F0
	cmpq	(%rdi), %rcx
	movl	%edx, %ecx
	cmovgl	%eax, %ecx
	subq	%rsi, %r12
	leaq	l___const.sis_ata16_program_timings.mwdma_timings(%rip), %rax
	movl	(%rax,%r12,4), %edx
LBB0_3:
	orl	%ecx, %edx
	movl	%edx, -36(%rbp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_pci_write_config_word
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @__const.sis_ata16_program_timings.pio_timings
l___const.sis_ata16_program_timings.pio_timings:
	.long	0                               ## 0x0
	.long	1543                            ## 0x607
	.long	1028                            ## 0x404
	.long	771                             ## 0x303
	.long	769                             ## 0x301

	.p2align	2                               ## @__const.sis_ata16_program_timings.mwdma_timings
l___const.sis_ata16_program_timings.mwdma_timings:
	.long	8                               ## 0x8
	.long	770                             ## 0x302
	.long	769                             ## 0x301

	.comm	_XFER_MW_DMA_0,8,3              ## @XFER_MW_DMA_0
	.comm	_chipset_family,8,3             ## @chipset_family
	.comm	_ATA_16,8,3                     ## @ATA_16
	.comm	_XFER_PIO_0,8,3                 ## @XFER_PIO_0
	.no_dead_strip	_sis_ata16_program_timings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sis_ata16_program_timings
_sis_ata16_program_timings:             ; @sis_ata16_program_timings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	str	wzr, [sp, #12]
	ldrsw	x8, [x20]
	lsl	x8, x8, #1
	add	x20, x8, #64
	add	x2, sp, #12
	mov	x1, x20
	bl	_pci_read_config_word
	ldr	w9, [sp, #12]
	mov	w8, #-1808
	and	w8, w9, w8
Lloh0:
	adrp	x10, _XFER_MW_DMA_0@GOTPAGE
Lloh1:
	ldr	x10, [x10, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	cmp	x10, x21
	b.le	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _XFER_PIO_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XFER_PIO_0@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	sub	x9, x21, x9
Lloh6:
	adrp	x10, l___const.sis_ata16_program_timings.pio_timings@PAGE
Lloh7:
	add	x10, x10, l___const.sis_ata16_program_timings.pio_timings@PAGEOFF
	ldr	w9, [x10, x9, lsl #2]
	b	LBB0_3
LBB0_2:
Lloh8:
	adrp	x11, _chipset_family@GOTPAGE
Lloh9:
	ldr	x11, [x11, _chipset_family@GOTPAGEOFF]
Lloh10:
	ldr	x11, [x11]
Lloh11:
	adrp	x12, _ATA_16@GOTPAGE
Lloh12:
	ldr	x12, [x12, _ATA_16@GOTPAGEOFF]
Lloh13:
	ldr	x12, [x12]
	mov	w13, #-34576
	and	w9, w9, w13
	cmp	x11, x12
	csel	w9, w9, w8, gt
	sub	x8, x21, x10
Lloh14:
	adrp	x10, l___const.sis_ata16_program_timings.mwdma_timings@PAGE
Lloh15:
	add	x10, x10, l___const.sis_ata16_program_timings.mwdma_timings@PAGEOFF
	ldr	w8, [x10, x8, lsl #2]
LBB0_3:
	orr	w2, w9, w8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_word
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.sis_ata16_program_timings.pio_timings
l___const.sis_ata16_program_timings.pio_timings:
	.long	0                               ; 0x0
	.long	1543                            ; 0x607
	.long	1028                            ; 0x404
	.long	771                             ; 0x303
	.long	769                             ; 0x301

	.p2align	2                               ; @__const.sis_ata16_program_timings.mwdma_timings
l___const.sis_ata16_program_timings.mwdma_timings:
	.long	8                               ; 0x8
	.long	770                             ; 0x302
	.long	769                             ; 0x301

	.comm	_XFER_MW_DMA_0,8,3              ; @XFER_MW_DMA_0
	.comm	_chipset_family,8,3             ; @chipset_family
	.comm	_ATA_16,8,3                     ; @ATA_16
	.comm	_XFER_PIO_0,8,3                 ; @XFER_PIO_0
	.no_dead_strip	_sis_ata16_program_timings
.subsections_via_symbols
