	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oldpiix_set_piomode
_oldpiix_set_piomode:                   ## @oldpiix_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, %r13
	movq	%rdi, %rbx
	movl	(%rsi), %r12d
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	xorl	%eax, %eax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmpq	$0, 8(%rbx)
	setne	%al
	leal	(%rax,%rax), %r14d
	addl	$64, %r14d
	xorl	%ebx, %ebx
	cmpl	$2, %r12d
	setae	%bl
	movq	%r13, %rdi
	callq	_ata_pio_need_iordy
	leal	2(%rbx), %ecx
	testq	%rax, %rax
	cmovel	%ebx, %ecx
	movq	%r15, %rbx
	movq	8(%r13), %rax
	movq	_ATA_DEV_ATA@GOTPCREL(%rip), %rdx
	leal	4(%rcx), %r15d
	cmpq	(%rdx), %rax
	cmovnel	%ecx, %r15d
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r14d, -48(%rbp)                ## 4-byte Spill
	movl	%r14d, %esi
	callq	_pci_read_config_word
	cmpq	$0, 16(%r13)
	movl	-44(%rbp), %eax
	je	LBB0_1
## %bb.2:
	andl	$52238, %eax                    ## imm = 0xCC0E
	shll	$4, %r15d
	jmp	LBB0_3
LBB0_1:
	andl	$52448, %eax                    ## imm = 0xCCE0
LBB0_3:
	orl	%r15d, %eax
	movl	%r12d, %ecx
	leaq	_oldpiix_set_piomode.timings(%rip), %rdx
	movl	(%rdx,%rcx,8), %esi
	movl	4(%rdx,%rcx,8), %edx
	shll	$12, %esi
	shll	$8, %edx
	orl	%eax, %edx
	orl	%esi, %edx
	movl	%edx, -44(%rbp)
	movq	%rbx, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_word
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r13, (%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                               ## @oldpiix_set_piomode.timings
_oldpiix_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	_ATA_DEV_ATA,8,3                ## @ATA_DEV_ATA
	.no_dead_strip	_oldpiix_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oldpiix_set_piomode
_oldpiix_set_piomode:                   ; @oldpiix_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	w23, w8, w9
	ldr	x8, [x0, #16]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x21, x0
	ldr	x8, [x20, #8]
	cmp	x8, #0
	mov	w8, #66
	mov	w9, #64
	csel	w22, w9, w8, eq
	cmp	w23, #1
	cset	w24, hi
	mov	x0, x19
	bl	_ata_pio_need_iordy
	orr	w8, w24, #0x2
	cmp	x0, #0
	csel	w8, w24, w8, eq
	ldr	x9, [x19, #8]
Lloh3:
	adrp	x10, _ATA_DEV_ATA@GOTPAGE
Lloh4:
	ldr	x10, [x10, _ATA_DEV_ATA@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	orr	w11, w8, #0x4
	cmp	x9, x10
	csel	w24, w11, w8, eq
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x22
	bl	_pci_read_config_word
	ldr	x8, [x19, #16]
	ldr	w9, [sp, #12]
	mov	w10, #52238
	and	w10, w9, w10
	bfi	w10, w24, #4, #3
	mov	w11, #52448
	and	w9, w9, w11
	orr	w9, w9, w24
	cmp	x8, #0
	csel	w8, w10, w9, ne
Lloh6:
	adrp	x9, _oldpiix_set_piomode.timings@PAGE
Lloh7:
	add	x9, x9, _oldpiix_set_piomode.timings@PAGEOFF
	add	x9, x9, w23, uxtw #3
	ldp	w10, w9, [x9]
	orr	w8, w8, w10, lsl #12
	orr	w2, w8, w9, lsl #8
	str	w2, [sp, #12]
	mov	x0, x21
	mov	x1, x22
	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	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_PIO_0,4,2                 ; @XFER_PIO_0
	.section	__TEXT,__const
	.p2align	2                               ; @oldpiix_set_piomode.timings
_oldpiix_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	_ATA_DEV_ATA,8,3                ; @ATA_DEV_ATA
	.no_dead_strip	_oldpiix_set_piomode
.subsections_via_symbols
