	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sil680_set_piomode
_sil680_set_piomode:                    ## @sil680_set_piomode
	.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
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$2, %esi
	callq	_sil680_selreg
	movq	%rax, %r15
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_sil680_seldev
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movslq	(%rbx), %rax
	leaq	128(,%rax,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %rbx
	movslq	(%r12), %r14
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	subq	%rax, %r14
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	4(%r12), %r13d
	shll	$2, %r13d
	movq	%r12, %rdi
	callq	_ata_dev_pair
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movl	(%rax), %eax
	cmpl	%eax, (%r12)
	jle	LBB0_3
## %bb.2:
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
LBB0_3:
	leaq	_sil680_set_piomode.speed_p(%rip), %rax
	movl	(%rax,%r14,4), %edx
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_pci_write_config_word
	movslq	-52(%rbp), %rax                 ## 4-byte Folded Reload
	leaq	_sil680_set_piomode.speed_t(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_pci_write_config_word
	addq	$-2, %r15
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_pci_read_config_word
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_pci_read_config_byte
	andb	$-3, -47(%rbp)
	movl	$3, %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	%eax, -44(%rbp)
	movq	%r12, %rdi
	callq	_ata_pio_need_iordy
	movl	-48(%rbp), %edx
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	orl	$512, %edx                      ## imm = 0x200
	movl	$1, %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	movl	%edx, -48(%rbp)
	orl	%eax, -44(%rbp)
LBB0_5:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_pci_write_config_word
	movl	-44(%rbp), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	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
	.section	__TEXT,__const
	.p2align	4                               ## @sil680_set_piomode.speed_p
_sil680_set_piomode.speed_p:
	.long	12938                           ## 0x328a
	.long	8835                            ## 0x2283
	.long	4356                            ## 0x1104
	.long	4291                            ## 0x10c3
	.long	4289                            ## 0x10c1

	.p2align	4                               ## @sil680_set_piomode.speed_t
_sil680_set_piomode.speed_t:
	.long	12938                           ## 0x328a
	.long	8835                            ## 0x2283
	.long	4737                            ## 0x1281
	.long	4291                            ## 0x10c3
	.long	4289                            ## 0x10c1

	.comm	_XFER_PIO_0,4,2                 ## @XFER_PIO_0
	.no_dead_strip	_sil680_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sil680_set_piomode
_sil680_set_piomode:                    ; @sil680_set_piomode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x20, x0
	mov	w1, #2
	bl	_sil680_selreg
	mov	x22, x0
	mov	x0, x20
	mov	x1, x21
	mov	w2, #4
	bl	_sil680_seldev
	mov	x23, x0
	ldrsw	x8, [x20]
	lsl	x8, x8, #2
	add	x19, x8, #128
	ldr	x8, [x20, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x20, x0
Lloh0:
	adrp	x27, _XFER_PIO_0@GOTPAGE
Lloh1:
	ldr	x27, [x27, _XFER_PIO_0@GOTPAGEOFF]
	ldr	w8, [x27]
	ldp	w9, w10, [x21]
	sub	w26, w9, w8
	mov	x25, x26
	lsl	w24, w10, #2
	mov	x0, x21
	bl	_ata_dev_pair
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w9, [x21]
	ldr	w8, [x0]
	cmp	w9, w8
	b.le	LBB0_3
; %bb.2:
	ldr	w9, [x27]
	sub	w25, w8, w9
LBB0_3:
Lloh2:
	adrp	x8, _sil680_set_piomode.speed_p@PAGE
Lloh3:
	add	x8, x8, _sil680_set_piomode.speed_p@PAGEOFF
	ldr	w2, [x8, w26, sxtw #2]
	mov	x0, x20
	mov	x1, x23
	bl	_pci_write_config_word
Lloh4:
	adrp	x8, _sil680_set_piomode.speed_t@PAGE
Lloh5:
	add	x8, x8, _sil680_set_piomode.speed_t@PAGEOFF
	ldr	w2, [x8, w25, sxtw #2]
	mov	x0, x20
	mov	x1, x22
	bl	_pci_write_config_word
	sub	x22, x22, #2
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_pci_read_config_word
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_pci_read_config_byte
	ldp	w9, w8, [sp, #8]
	and	w10, w8, #0xfffffdff
	mov	w8, #3
	lsl	w8, w8, w24
	bic	w8, w9, w8
	stp	w8, w10, [sp, #8]
	mov	x0, x21
	bl	_ata_pio_need_iordy
	ldr	w2, [sp, #12]
	cbz	x0, LBB0_5
; %bb.4:
	orr	w2, w2, #0x200
	mov	w8, #1
	lsl	w8, w8, w24
	ldr	w9, [sp, #8]
	orr	w8, w9, w8
	stp	w8, w2, [sp, #8]
LBB0_5:
	mov	x0, x20
	mov	x1, x22
	bl	_pci_write_config_word
	ldr	w2, [sp, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_pci_write_config_byte
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @sil680_set_piomode.speed_p
_sil680_set_piomode.speed_p:
	.long	12938                           ; 0x328a
	.long	8835                            ; 0x2283
	.long	4356                            ; 0x1104
	.long	4291                            ; 0x10c3
	.long	4289                            ; 0x10c1

	.p2align	2                               ; @sil680_set_piomode.speed_t
_sil680_set_piomode.speed_t:
	.long	12938                           ; 0x328a
	.long	8835                            ; 0x2283
	.long	4737                            ; 0x1281
	.long	4291                            ; 0x10c3
	.long	4289                            ; 0x10c1

	.comm	_XFER_PIO_0,4,2                 ; @XFER_PIO_0
	.no_dead_strip	_sil680_set_piomode
.subsections_via_symbols
