	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdc202xx_configure_piomode
_pdc202xx_configure_piomode:            ## @pdc202xx_configure_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
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r13
	movl	(%rbx), %r15d
	movl	(%r12), %ebx
	shll	$2, %ebx
	leal	(%rbx,%r15,8), %r14d
	addl	$96, %r14d
	leaq	-44(%rbp), %rdx
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_pci_read_config_byte
	leal	(%rbx,%r15,8), %r15d
	addl	$97, %r15d
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_pci_read_config_byte
	movl	-44(%rbp), %eax
	andl	$-64, %eax
	movl	-48(%rbp), %ecx
	andl	$-32, %ecx
	movslq	-52(%rbp), %rdx                 ## 4-byte Folded Reload
	leaq	_pdc202xx_configure_piomode.pio_timing(%rip), %rsi
	movl	(%rsi,%rdx,4), %edx
	movzbl	%dl, %esi
	sarl	$8, %edx
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
	orl	%ecx, %esi
	movl	%esi, -48(%rbp)
	movq	%r12, %rdi
	callq	_ata_pio_need_iordy
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	orb	$32, -44(%rbp)
LBB0_2:
	movq	8(%r12), %rax
	movq	_ATA_DEV_ATA@GOTPCREL(%rip), %rcx
	movl	-44(%rbp), %edx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	orl	$16, %edx
	movl	%edx, -44(%rbp)
LBB0_4:
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	_pci_write_config_byte
	movl	-48(%rbp), %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_pci_write_config_byte
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @pdc202xx_configure_piomode.pio_timing
_pdc202xx_configure_piomode.pio_timing:
	.long	2323                            ## 0x913
	.long	1292                            ## 0x50c
	.long	776                             ## 0x308
	.long	518                             ## 0x206
	.long	260                             ## 0x104

	.comm	_ATA_DEV_ATA,8,3                ## @ATA_DEV_ATA
	.no_dead_strip	_pdc202xx_configure_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdc202xx_configure_piomode
_pdc202xx_configure_piomode:            ; @pdc202xx_configure_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	x23, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w8, [x20]
	lsl	w8, w8, #3
	ldr	w9, [x22]
	add	w21, w8, w9, lsl #2
	add	w20, w21, #96
	add	x2, sp, #12
	mov	x1, x20
	bl	_pci_read_config_byte
	add	w21, w21, #97
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_byte
	ldp	w9, w8, [sp, #8]
	and	w8, w8, #0xffffffc0
Lloh0:
	adrp	x10, _pdc202xx_configure_piomode.pio_timing@PAGE
Lloh1:
	add	x10, x10, _pdc202xx_configure_piomode.pio_timing@PAGEOFF
	ldr	w10, [x10, w23, sxtw #2]
	and	w9, w9, #0xffffffe0
	orr	w11, w8, w10, asr #8
	and	w8, w10, #0xff
	orr	w8, w8, w9
	stp	w8, w11, [sp, #8]
	mov	x0, x22
	bl	_ata_pio_need_iordy
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w8, [sp, #12]
	orr	w8, w8, #0x20
	str	w8, [sp, #12]
LBB0_2:
	ldr	x8, [x22, #8]
Lloh2:
	adrp	x9, _ATA_DEV_ATA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ATA_DEV_ATA@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	w2, [sp, #12]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	orr	w2, w2, #0x10
	str	w2, [sp, #12]
LBB0_4:
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_byte
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @pdc202xx_configure_piomode.pio_timing
_pdc202xx_configure_piomode.pio_timing:
	.long	2323                            ; 0x913
	.long	1292                            ; 0x50c
	.long	776                             ; 0x308
	.long	518                             ; 0x206
	.long	260                             ; 0x104

	.comm	_ATA_DEV_ATA,8,3                ; @ATA_DEV_ATA
	.no_dead_strip	_pdc202xx_configure_piomode
.subsections_via_symbols
