	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pdc202xx_set_mode
_pdc202xx_set_mode:                     ## @pdc202xx_set_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	$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
	movl	(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movl	(%r12), %ebx
	movl	4(%r12), %r15d
	leal	96(,%rbx,4), %esi
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -52(%rbp)
	leaq	-48(%rbp), %rdx
	movq	%rax, %rdi
	movl	%esi, -64(%rbp)                 ## 4-byte Spill
	callq	_pci_read_config_byte
	leal	97(,%rbx,4), %r13d
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_pci_read_config_byte
	leal	98(,%rbx,4), %ebx
	leaq	-52(%rbp), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_read_config_byte
	leal	-128(%r15), %eax
	cmpl	$13, %eax
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	ja	LBB0_1
## %bb.2:
	cltq
	leaq	l_switch.table.pdc202xx_set_mode(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	leaq	l_switch.table.pdc202xx_set_mode.1(%rip), %rcx
	movl	(%rcx,%rax,4), %esi
	leaq	l_switch.table.pdc202xx_set_mode.2(%rip), %rcx
	movl	(%rcx,%rax,4), %r13d
	jmp	LBB0_3
LBB0_1:
	xorl	%r13d, %r13d
	movl	$19, %esi
	movl	$9, %edx
LBB0_3:
	movq	_XFER_SW_DMA_0@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_9
## %bb.4:
	movl	%edx, %r13d
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	andb	$-64, -48(%rbp)
	addl	$-138, %r15d
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_ide_pio_need_iordy
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	orb	$32, -48(%rbp)
LBB0_6:
	movq	8(%r12), %rax
	movq	_ide_disk@GOTPCREL(%rip), %rcx
	movl	-48(%rbp), %edx
	cmpq	(%rcx), %rax
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_8
## %bb.7:
	orl	$16, %edx
	movl	%edx, -48(%rbp)
LBB0_8:
	orl	%r13d, %edx
	andb	$-32, -44(%rbp)
	movq	%r14, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_byte
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	orl	-44(%rbp), %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	jmp	LBB0_10
LBB0_9:
	movl	$-225, %edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	andb	$-16, -52(%rbp)
	orl	%esi, %edx
	movq	%r14, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_byte
	orl	-52(%rbp), %r13d
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
LBB0_10:
	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
	.comm	_XFER_SW_DMA_0,4,2              ## @XFER_SW_DMA_0
	.comm	_ide_disk,8,3                   ## @ide_disk
	.no_dead_strip	_pdc202xx_set_mode
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.pdc202xx_set_mode
l_switch.table.pdc202xx_set_mode:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	5                               ## 0x5
	.long	9                               ## 0x9
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0

	.p2align	2                               ## @switch.table.pdc202xx_set_mode.1
l_switch.table.pdc202xx_set_mode.1:
	.long	32                              ## 0x20
	.long	32                              ## 0x20
	.long	64                              ## 0x40
	.long	32                              ## 0x20
	.long	64                              ## 0x40
	.long	96                              ## 0x60
	.long	4                               ## 0x4
	.long	6                               ## 0x6
	.long	8                               ## 0x8
	.long	12                              ## 0xc
	.long	19                              ## 0x13
	.long	96                              ## 0x60
	.long	96                              ## 0x60
	.long	224                             ## 0xe0

	.p2align	2                               ## @switch.table.pdc202xx_set_mode.2
l_switch.table.pdc202xx_set_mode.2:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	3                               ## 0x3
	.long	4                               ## 0x4
	.long	15                              ## 0xf

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pdc202xx_set_mode
_pdc202xx_set_mode:                     ; @pdc202xx_set_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	x22, x1
	ldr	w0, [x0]
	bl	_to_pci_dev
	mov	x19, x0
	ldp	w8, w25, [x22]
	lsl	w23, w8, #2
	add	w21, w23, #96
	str	xzr, [sp, #8]
	str	wzr, [sp, #4]
	add	x2, sp, #12
	mov	x1, x21
	bl	_pci_read_config_byte
	add	w20, w23, #97
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_pci_read_config_byte
	add	w23, w23, #98
	add	x2, sp, #4
	mov	x0, x19
	mov	x1, x23
	bl	_pci_read_config_byte
	sub	w8, w25, #128
	cmp	w8, #13
	b.hi	LBB0_2
; %bb.1:
	sbfiz	x8, x8, #2, #32
Lloh0:
	adrp	x9, l_switch.table.pdc202xx_set_mode@PAGE
Lloh1:
	add	x9, x9, l_switch.table.pdc202xx_set_mode@PAGEOFF
	ldr	w26, [x9, x8]
Lloh2:
	adrp	x9, l_switch.table.pdc202xx_set_mode.1@PAGE
Lloh3:
	add	x9, x9, l_switch.table.pdc202xx_set_mode.1@PAGEOFF
	ldr	w24, [x9, x8]
Lloh4:
	adrp	x9, l_switch.table.pdc202xx_set_mode.2@PAGE
Lloh5:
	add	x9, x9, l_switch.table.pdc202xx_set_mode.2@PAGEOFF
	ldr	w27, [x9, x8]
	b	LBB0_3
LBB0_2:
	mov	w27, #0
	mov	w24, #19
	mov	w26, #9
LBB0_3:
Lloh6:
	adrp	x8, _XFER_SW_DMA_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XFER_SW_DMA_0@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ge	LBB0_9
; %bb.4:
	ldr	w8, [sp, #12]
	and	w8, w8, #0xffffffc0
	str	w8, [sp, #12]
	sub	w1, w25, #138
	mov	x0, x22
	bl	_ide_pio_need_iordy
	cbz	x0, LBB0_6
; %bb.5:
	ldr	w8, [sp, #12]
	orr	w8, w8, #0x20
	str	w8, [sp, #12]
LBB0_6:
	ldr	x9, [x22, #8]
Lloh9:
	adrp	x8, _ide_disk@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ide_disk@GOTPAGEOFF]
Lloh11:
	ldr	x10, [x8]
	ldr	w8, [sp, #12]
	cmp	x9, x10
	b.ne	LBB0_8
; %bb.7:
	orr	w8, w8, #0x10
	str	w8, [sp, #12]
LBB0_8:
	ldr	w9, [sp, #8]
	and	w9, w9, #0xffffffe0
	str	w9, [sp, #8]
	orr	w2, w8, w26
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
	ldr	w8, [sp, #8]
	orr	w2, w8, w24
	mov	x0, x19
	mov	x1, x20
	b	LBB0_10
LBB0_9:
	ldp	w9, w8, [sp, #4]
	and	w8, w8, #0xffffff1f
	and	w9, w9, #0xfffffff0
	stp	w9, w8, [sp, #4]
	orr	w2, w8, w24
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_byte
	ldr	w8, [sp, #4]
	orr	w2, w8, w27
	mov	x0, x19
	mov	x1, x23
LBB0_10:
	bl	_pci_write_config_byte
	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
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_SW_DMA_0,4,2              ; @XFER_SW_DMA_0
	.comm	_ide_disk,8,3                   ; @ide_disk
	.no_dead_strip	_pdc202xx_set_mode
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.pdc202xx_set_mode
l_switch.table.pdc202xx_set_mode:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	5                               ; 0x5
	.long	9                               ; 0x9
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0

	.p2align	2                               ; @switch.table.pdc202xx_set_mode.1
l_switch.table.pdc202xx_set_mode.1:
	.long	32                              ; 0x20
	.long	32                              ; 0x20
	.long	64                              ; 0x40
	.long	32                              ; 0x20
	.long	64                              ; 0x40
	.long	96                              ; 0x60
	.long	4                               ; 0x4
	.long	6                               ; 0x6
	.long	8                               ; 0x8
	.long	12                              ; 0xc
	.long	19                              ; 0x13
	.long	96                              ; 0x60
	.long	96                              ; 0x60
	.long	224                             ; 0xe0

	.p2align	2                               ; @switch.table.pdc202xx_set_mode.2
l_switch.table.pdc202xx_set_mode.2:
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.long	15                              ; 0xf

.subsections_via_symbols
