	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sil_set_dma_mode
_sil_set_dma_mode:                      ## @sil_set_dma_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r13
	movq	8(%rdi), %rbx
	movl	24(%rbx), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	movq	16(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%r13), %eax
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	_IDE_HFLAG_MMIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r12d, %r12d
	andl	(%rbx), %eax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	sete	%r12b
	movl	$132, %eax
	movl	$244, %ecx
	cmoveq	%rax, %rcx
	movl	$128, %eax
	movl	$180, %r14d
	cmoveq	%rax, %r14
	cmpq	$0, 8(%rbx)
	cmovneq	%rcx, %r14
	movq	%r13, %rdi
	movl	$8, %esi
	callq	_siimage_seldev
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	movl	$12, %esi
	callq	_siimage_seldev
	movq	%rax, %r13
	shlq	$6, %r12
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%r12,%rbx), %rsi
	addq	$74, %rsi
	movq	%r15, %rdi
	callq	_sil_ioread8
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	addq	%rbx, %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_sil_ioread8
	movl	%eax, %r12d
	movq	%r15, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_sil_ioread16
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	-56(%rbp), %r15d                ## 4-byte Reload
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	callq	_sil_ioread16
	movl	%eax, %r13d
	testb	$1, %r15b
	movl	$3, %eax
	movl	$48, %ebx
	cmovel	%eax, %ebx
	andl	$-64, %r13d
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_is_sata
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%esi, %ecx
	jle	LBB0_1
## %bb.2:
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%esi, %rcx
	subq	%rax, %rcx
	testb	$1, %r15b
	leaq	_sil_set_dma_mode.dma(%rip), %rax
	movl	(%rax,%rcx,4), %r15d
	movl	$2, %ecx
	movl	$32, %eax
	cmovel	%ecx, %eax
	jmp	LBB0_3
LBB0_1:
	subl	%ecx, %esi
	testb	$48, -52(%rbp)                  ## 1-byte Folded Reload
	leaq	_sil_set_dma_mode.ultra6(%rip), %rcx
	leaq	_sil_set_dma_mode.ultra5(%rip), %rdx
	cmovneq	%rcx, %rdx
	testq	%rax, %rax
	cmovneq	%rcx, %rdx
	movslq	%esi, %rax
	orl	(%rdx,%rax,4), %r13d
	movl	$4289, %r15d                    ## imm = 0x10C1
	movl	%ebx, %eax
LBB0_3:
	notl	%ebx
	andl	%ebx, %r12d
	orl	%eax, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%r14, %rdx
	callq	_sil_iowrite8
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_sil_iowrite16
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movq	-88(%rbp), %rdx                 ## 8-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sil_iowrite16                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @sil_set_dma_mode.ultra6
_sil_set_dma_mode.ultra6:
	.long	15                              ## 0xf
	.long	11                              ## 0xb
	.long	7                               ## 0x7
	.long	5                               ## 0x5
	.long	3                               ## 0x3
	.long	2                               ## 0x2
	.long	1                               ## 0x1

	.p2align	4                               ## @sil_set_dma_mode.ultra5
_sil_set_dma_mode.ultra5:
	.long	12                              ## 0xc
	.long	7                               ## 0x7
	.long	5                               ## 0x5
	.long	4                               ## 0x4
	.long	2                               ## 0x2
	.long	1                               ## 0x1

	.p2align	2                               ## @sil_set_dma_mode.dma
_sil_set_dma_mode.dma:
	.long	8712                            ## 0x2208
	.long	4290                            ## 0x10c2
	.long	4289                            ## 0x10c1

	.comm	_IDE_HFLAG_MMIO,4,2             ## @IDE_HFLAG_MMIO
	.comm	_XFER_UDMA_0,4,2                ## @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.no_dead_strip	_sil_set_dma_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_dma_mode
_sil_set_dma_mode:                      ; @sil_set_dma_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	x21, x1
	mov	x22, x0
	ldr	x23, [x0, #8]
	ldr	w0, [x23, #24]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w28, [x22]
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _IDE_HFLAG_MMIO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IDE_HFLAG_MMIO@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #244
	mov	w9, #132
	ldp	x10, x24, [x23, #8]
	csel	x8, x9, x8, eq
	mov	w9, #180
	mov	w11, #128
	csel	x9, x11, x9, eq
	mov	w11, #74
	mov	w12, #138
	csel	x25, x12, x11, eq
	cmp	x10, #0
	csel	x26, x9, x8, eq
	mov	x0, x22
	mov	w1, #8
	bl	_siimage_seldev
	mov	x20, x0
	mov	x0, x22
	mov	w1, #12
	bl	_siimage_seldev
	mov	x22, x0
	add	x1, x25, x24
	mov	x0, x19
	bl	_sil_ioread8
	mov	x27, x0
	add	x24, x26, x24
	mov	x0, x19
	mov	x1, x24
	bl	_sil_ioread8
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	mov	x0, x19
	mov	x1, x20
	bl	_sil_ioread16
	mov	x0, x19
	mov	x1, x22
	bl	_sil_ioread16
	mov	x25, x28
	tst	w28, #0x1
	mov	w8, #48
	mov	w9, #3
	csel	w28, w9, w8, eq
	and	w26, w0, #0xffffffc0
	mov	x0, x23
	bl	_is_sata
Lloh3:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.le	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _XFER_MW_DMA_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	sub	w8, w21, w8
Lloh9:
	adrp	x9, _sil_set_dma_mode.dma@PAGE
Lloh10:
	add	x9, x9, _sil_set_dma_mode.dma@PAGEOFF
	ldr	w21, [x9, w8, sxtw #2]
	tst	w25, #0x1
	mov	w8, #32
	mov	w9, #2
	csel	w8, w9, w8, eq
	b	LBB0_3
LBB0_2:
	sub	w8, w21, w8
	tst	w27, #0x30
	ccmp	x0, #0, #0, eq
Lloh11:
	adrp	x9, _sil_set_dma_mode.ultra6@PAGE
Lloh12:
	add	x9, x9, _sil_set_dma_mode.ultra6@PAGEOFF
Lloh13:
	adrp	x10, _sil_set_dma_mode.ultra5@PAGE
Lloh14:
	add	x10, x10, _sil_set_dma_mode.ultra5@PAGEOFF
	csel	x9, x9, x10, ne
	ldr	w8, [x9, w8, sxtw #2]
	orr	w26, w8, w26
	mov	w21, #4289
	mov	x8, x28
LBB0_3:
	ldr	w9, [sp, #12]                   ; 4-byte Folded Reload
	bic	w9, w9, w28
	orr	w1, w8, w9
	mov	x0, x19
	mov	x2, x24
	bl	_sil_iowrite8
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_sil_iowrite16
	mov	x0, x19
	mov	x1, x26
	mov	x2, x22
	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_iowrite16
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @sil_set_dma_mode.ultra6
_sil_set_dma_mode.ultra6:
	.long	15                              ; 0xf
	.long	11                              ; 0xb
	.long	7                               ; 0x7
	.long	5                               ; 0x5
	.long	3                               ; 0x3
	.long	2                               ; 0x2
	.long	1                               ; 0x1

	.p2align	2                               ; @sil_set_dma_mode.ultra5
_sil_set_dma_mode.ultra5:
	.long	12                              ; 0xc
	.long	7                               ; 0x7
	.long	5                               ; 0x5
	.long	4                               ; 0x4
	.long	2                               ; 0x2
	.long	1                               ; 0x1

	.p2align	2                               ; @sil_set_dma_mode.dma
_sil_set_dma_mode.dma:
	.long	8712                            ; 0x2208
	.long	4290                            ; 0x10c2
	.long	4289                            ; 0x10c1

	.comm	_IDE_HFLAG_MMIO,4,2             ; @IDE_HFLAG_MMIO
	.comm	_XFER_UDMA_0,4,2                ; @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.no_dead_strip	_sil_set_dma_mode
.subsections_via_symbols
