	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sil_set_pio_mode
_sil_set_pio_mode:                      ## @sil_set_pio_mode
	.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, %r13
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movl	24(%rbx), %edi
	callq	_to_pci_dev
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_ide_get_pair_dev
	movq	%rax, %r14
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_siimage_seldev
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	$2, %esi
	callq	_siimage_selreg
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	16(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ecx
	movq	_IDE_HFLAG_MMIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	8(%rbx), %rsi
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	(%r15), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %r15
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movq	%rsi, %r13
	movl	$255, %esi
	movl	%edx, %ebx
	movl	$4, %edx
	movl	%ecx, %r14d
	callq	_ide_get_best_pio_mode
	movl	%ebx, %edx
	movq	%r13, %rsi
	movq	%rax, %r13
	movq	%r15, %rcx
	cmpq	%r15, %rax
	cmovgeq	%r15, %r13
	movl	%r14d, %ecx
LBB0_2:
	testl	%ecx, %edx
	movl	$128, %ecx
	movl	$180, %edx
	cmoveq	%rcx, %rdx
	movl	$132, %ecx
	movl	$244, %r14d
	cmoveq	%rcx, %r14
	testq	%rsi, %rsi
	cmoveq	%rdx, %r14
	leaq	_sil_set_pio_mode.data_speed(%rip), %rcx
	movl	(%rcx,%r15,4), %esi
	leaq	_sil_set_pio_mode.tf_speed(%rip), %rcx
	movl	(%rcx,%r13,4), %ebx
	movq	%r12, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_sil_iowrite16
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_sil_iowrite16
	addq	$-2, %r13
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_sil_ioread16
	movl	%eax, %ebx
	andl	$-513, %ebx                     ## imm = 0xFDFF
	addq	-72(%rbp), %r14                 ## 8-byte Folded Reload
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_sil_ioread8
	testb	$1, -52(%rbp)                   ## 1-byte Folded Reload
	movq	$-4, %rcx
	movq	%r15, %rsi
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	$-49, %r12
	cmoveq	%rcx, %r12
	movl	$1, %ecx
	movl	$16, %r15d
	cmoveq	%rcx, %r15
	andq	%rax, %r12
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_ide_pio_need_iordy
	xorl	%esi, %esi
	testq	%rax, %rax
	cmoveq	%rax, %r15
	setne	%sil
	orq	%r12, %r15
	shll	$9, %esi
	orl	%ebx, %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_sil_iowrite16
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sil_iowrite8                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @sil_set_pio_mode.tf_speed
_sil_set_pio_mode.tf_speed:
	.long	12938                           ## 0x328a
	.long	8835                            ## 0x2283
	.long	4737                            ## 0x1281
	.long	4291                            ## 0x10c3
	.long	4289                            ## 0x10c1

	.p2align	4                               ## @sil_set_pio_mode.data_speed
_sil_set_pio_mode.data_speed:
	.long	12938                           ## 0x328a
	.long	8835                            ## 0x2283
	.long	4356                            ## 0x1104
	.long	4291                            ## 0x10c3
	.long	4289                            ## 0x10c1

	.comm	_IDE_HFLAG_MMIO,4,2             ## @IDE_HFLAG_MMIO
	.no_dead_strip	_sil_set_pio_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sil_set_pio_mode
_sil_set_pio_mode:                      ; @sil_set_pio_mode
	.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	x20, x1
	mov	x21, x0
	ldr	x25, [x0, #8]
	ldr	w0, [x25, #24]
	bl	_to_pci_dev
	mov	x19, x0
	mov	x0, x21
	bl	_ide_get_pair_dev
	mov	x24, x0
	mov	x0, x21
	mov	w1, #4
	bl	_siimage_seldev
	mov	x23, x0
	mov	x0, x25
	mov	w1, #2
	bl	_siimage_selreg
	mov	x22, x0
Lloh0:
	adrp	x8, _IDE_HFLAG_MMIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDE_HFLAG_MMIO@GOTPAGEOFF]
	ldr	w28, [x25]
Lloh2:
	ldr	w26, [x8]
	ldp	x25, x27, [x25, #8]
	ldr	w8, [x21]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	mov	x8, x20
	cbz	x24, LBB0_2
; %bb.1:
	mov	x0, x24
	mov	w1, #255
	mov	w2, #4
	bl	_ide_get_best_pio_mode
	cmp	x0, x20
	csel	x8, x0, x20, lt
LBB0_2:
	tst	w26, w28
	mov	w9, #180
	mov	w10, #128
	csel	x9, x10, x9, eq
	mov	w10, #244
	mov	w11, #132
	csel	x10, x11, x10, eq
	cmp	x25, #0
	csel	x25, x9, x10, eq
Lloh3:
	adrp	x9, _sil_set_pio_mode.data_speed@PAGE
Lloh4:
	add	x9, x9, _sil_set_pio_mode.data_speed@PAGEOFF
	ldr	w1, [x9, x20, lsl #2]
Lloh5:
	adrp	x9, _sil_set_pio_mode.tf_speed@PAGE
Lloh6:
	add	x9, x9, _sil_set_pio_mode.tf_speed@PAGEOFF
	ldr	w24, [x9, x8, lsl #2]
	mov	x0, x19
	mov	x2, x23
	bl	_sil_iowrite16
	mov	x0, x19
	mov	x1, x24
	mov	x2, x22
	bl	_sil_iowrite16
	sub	x22, x22, #2
	mov	x0, x19
	mov	x1, x22
	bl	_sil_ioread16
	mov	x23, x0
	add	x24, x25, x27
	mov	x0, x19
	mov	x1, x24
	bl	_sil_ioread8
	mov	x25, x0
	mov	x0, x21
	mov	x1, x20
	bl	_ide_pio_need_iordy
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	tst	w8, #0x1
	mov	x8, #-49
	mov	x9, #-4
	csel	x8, x9, x8, eq
	and	x8, x25, x8
	mov	w9, #16
	csinc	x9, x9, xzr, ne
	cmp	x0, #0
	csel	x9, xzr, x9, eq
	cset	w10, ne
	orr	x20, x9, x8
	bfi	w23, w10, #9, #1
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_sil_iowrite16
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	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
	b	_sil_iowrite8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @sil_set_pio_mode.tf_speed
_sil_set_pio_mode.tf_speed:
	.long	12938                           ; 0x328a
	.long	8835                            ; 0x2283
	.long	4737                            ; 0x1281
	.long	4291                            ; 0x10c3
	.long	4289                            ; 0x10c1

	.p2align	2                               ; @sil_set_pio_mode.data_speed
_sil_set_pio_mode.data_speed:
	.long	12938                           ; 0x328a
	.long	8835                            ; 0x2283
	.long	4356                            ; 0x1104
	.long	4291                            ; 0x10c3
	.long	4289                            ; 0x10c1

	.comm	_IDE_HFLAG_MMIO,4,2             ; @IDE_HFLAG_MMIO
	.no_dead_strip	_sil_set_pio_mode
.subsections_via_symbols
