	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpiix_set_piomode
_mpiix_set_piomode:                     ## @mpiix_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movslq	(%rsi), %rbx
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	subq	%rax, %rbx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	movq	_IDETIM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movq	8(%r12), %rax
	movq	_ATA_DEV_ATA@GOTPCREL(%rip), %rcx
	xorl	%r13d, %r13d
	movl	$0, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_PPE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_2:
	movq	%r12, %rdi
	callq	_ata_pio_need_iordy
	movl	$0, %esi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_IORDY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_4:
	orl	%r14d, %esi
	cmpl	$2, %ebx
	jl	LBB0_6
## %bb.5:
	movq	_FTIM@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_6:
	movb	16(%r12), %cl
	shlb	$2, %cl
	movl	$7, %eax
	shll	%cl, %eax
	notl	%eax
	andl	-44(%rbp), %eax
	orl	%r13d, %esi
	shll	%cl, %esi
	andl	$52462, %eax                    ## imm = 0xCCEE
	orl	%eax, %esi
	leaq	_mpiix_set_piomode.timings(%rip), %rax
	movl	(%rax,%rbx,8), %ecx
	movl	4(%rax,%rbx,8), %edx
	shll	$12, %ecx
	shll	$8, %edx
	orl	%ecx, %edx
	orl	%esi, %edx
	movl	%edx, -44(%rbp)
	movq	_IDETIM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_pci_write_config_word
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r12, (%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_PIO_0,4,2                 ## @XFER_PIO_0
	.section	__TEXT,__const
	.p2align	4                               ## @mpiix_set_piomode.timings
_mpiix_set_piomode.timings:
	.space	8
	.space	8
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3

	.comm	_IDETIM,4,2                     ## @IDETIM
	.comm	_ATA_DEV_ATA,8,3                ## @ATA_DEV_ATA
	.comm	_PPE,4,2                        ## @PPE
	.comm	_IORDY,4,2                      ## @IORDY
	.comm	_FTIM,4,2                       ## @FTIM
	.no_dead_strip	_mpiix_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpiix_set_piomode
_mpiix_set_piomode:                     ; @mpiix_set_piomode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x1
	mov	x20, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _XFER_PIO_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _XFER_PIO_0@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w22, w8, w9
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x21, x0
Lloh3:
	adrp	x23, _IDETIM@GOTPAGE
Lloh4:
	ldr	x23, [x23, _IDETIM@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x2, sp, #12
	bl	_pci_read_config_word
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x9, _ATA_DEV_ATA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATA_DEV_ATA@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x10, _PPE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PPE@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	x8, x9
	csel	w24, w10, wzr, eq
	mov	x0, x19
	bl	_ata_pio_need_iordy
Lloh11:
	adrp	x8, _IORDY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IORDY@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w8, w8, w24
Lloh14:
	adrp	x9, _FTIM@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FTIM@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w22, #1
	csel	w9, w9, wzr, gt
	orr	w8, w8, w9
	ldr	w9, [sp, #12]
	ldr	w10, [x19, #16]
	lsl	w10, w10, #2
	mov	w11, #7
	lsl	w11, w11, w10
	bic	w9, w9, w11
	mov	w11, #52462
	and	w9, w9, w11
	lsl	w8, w8, w10
	orr	w8, w9, w8
Lloh17:
	adrp	x9, _mpiix_set_piomode.timings@PAGE
Lloh18:
	add	x9, x9, _mpiix_set_piomode.timings@PAGEOFF
	add	x9, x9, w22, sxtw #3
	ldp	w10, w9, [x9]
	lsl	w9, w9, #8
	orr	w9, w9, w10, lsl #12
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x23]
	mov	x0, x21
	bl	_pci_write_config_word
	str	x19, [x20]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_PIO_0,4,2                 ; @XFER_PIO_0
	.section	__TEXT,__const
	.p2align	2                               ; @mpiix_set_piomode.timings
_mpiix_set_piomode.timings:
	.space	8
	.space	8
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3

	.comm	_IDETIM,4,2                     ; @IDETIM
	.comm	_ATA_DEV_ATA,8,3                ; @ATA_DEV_ATA
	.comm	_PPE,4,2                        ; @PPE
	.comm	_IORDY,4,2                      ; @IORDY
	.comm	_FTIM,4,2                       ; @FTIM
	.no_dead_strip	_mpiix_set_piomode
.subsections_via_symbols
