	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radisys_set_piomode
_radisys_set_piomode:                   ## @radisys_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
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %r13d
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	movq	8(%rdi), %rcx
	movl	(%rcx), %edi
	xorl	%r14d, %r14d
	subl	(%rax), %r13d
	setne	%r14b
	callq	_to_pci_dev
	movq	%rax, %r15
	movq	%r12, %rdi
	callq	_ata_pio_need_iordy
	leal	2(%r14), %ebx
	testq	%rax, %rax
	cmovel	%r14d, %ebx
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	$64, %esi
	callq	_pci_read_config_word
	movl	$52428, %eax                    ## imm = 0xCCCC
	andl	-44(%rbp), %eax
	movb	4(%r12), %cl
	shlb	$2, %cl
	shll	%cl, %ebx
	leaq	_radisys_set_piomode.timings(%rip), %rcx
	movl	(%rcx,%r13,8), %esi
	movl	4(%rcx,%r13,8), %edx
	shll	$12, %esi
	orl	%eax, %esi
	orl	%ebx, %esi
	shll	$8, %edx
	orl	%esi, %edx
	movl	%edx, -44(%rbp)
	movq	%r15, %rdi
	movl	$64, %esi
	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                               ## @radisys_set_piomode.timings
_radisys_set_piomode.timings:
	.space	8
	.space	8
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	3                               ## 0x3

	.no_dead_strip	_radisys_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radisys_set_piomode
_radisys_set_piomode:                   ; @radisys_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	w22, [x1]
Lloh0:
	adrp	x8, _XFER_PIO_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_PIO_0@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x21, x0
	subs	w22, w22, w23
	cset	w23, ne
	mov	x0, x19
	bl	_ata_pio_need_iordy
	orr	w8, w23, #0x2
	cmp	x0, #0
	csel	w23, w23, w8, eq
	add	x2, sp, #12
	mov	x0, x21
	mov	w1, #64
	bl	_pci_read_config_word
	ldr	w8, [sp, #12]
	mov	w9, #52428
	and	w8, w8, w9
	ldr	w9, [x19, #4]
	lsl	w9, w9, #2
	lsl	w9, w23, w9
	orr	w8, w9, w8
Lloh3:
	adrp	x9, _radisys_set_piomode.timings@PAGE
Lloh4:
	add	x9, x9, _radisys_set_piomode.timings@PAGEOFF
	add	x9, x9, w22, 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	w1, #64
	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	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                               ; @radisys_set_piomode.timings
_radisys_set_piomode.timings:
	.space	8
	.space	8
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	3                               ; 0x3

	.no_dead_strip	_radisys_set_piomode
.subsections_via_symbols
