	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function it8213_set_pio_mode
_it8213_set_pio_mode:                   ## @it8213_set_pio_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movb	(%r13), %r12b
	leaq	_it8213_set_pio_mode.tune_lock(%rip), %rdi
	callq	_spin_lock_irqsave
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	$64, %esi
	callq	_pci_read_config_word
	xorl	%eax, %eax
	cmpl	$2, %r15d
	setge	%al
	movq	8(%r13), %rcx
	movq	_ide_disk@GOTPCREL(%rip), %rdx
	leal	4(%rax), %ebx
	cmpq	(%rdx), %rcx
	cmovel	%eax, %ebx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_ide_pio_need_iordy
	leal	2(%rbx), %ecx
	testq	%rax, %rax
	cmovel	%ebx, %ecx
	movl	-44(%rbp), %eax
	testb	$1, %r12b
	jne	LBB0_2
## %bb.1:
	andl	$-13064, %eax                   ## imm = 0xCCF8
	xorl	%esi, %esi
	cmpl	$2, %r15d
	cmovgel	%ecx, %esi
	orl	%eax, %esi
	movslq	%r15d, %rax
	leaq	_it8213_set_pio_mode.timings(%rip), %rcx
	movl	(%rcx,%rax,8), %edi
	movl	4(%rcx,%rax,8), %edx
	shll	$12, %edi
	shll	$8, %edx
	orl	%edi, %edx
	orl	%esi, %edx
	movl	%edx, -44(%rbp)
	movq	%r14, %rdi
	movl	$64, %esi
	callq	_pci_write_config_word
	jmp	LBB0_3
LBB0_2:
	andl	$-16497, %eax                   ## imm = 0xBF8F
	shll	$4, %ecx
	orl	$16384, %ecx                    ## imm = 0x4000
	cmpl	$2, %r15d
	movl	$16384, %edx                    ## imm = 0x4000
	cmovgel	%ecx, %edx
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	$68, %esi
	callq	_pci_read_config_byte
	movl	$240, %eax
	andl	-48(%rbp), %eax
	movslq	%r15d, %rcx
	leaq	_it8213_set_pio_mode.timings(%rip), %rdx
	movl	(%rdx,%rcx,8), %esi
	shll	$2, %esi
	orl	%eax, %esi
	orl	4(%rdx,%rcx,8), %esi
	movl	%esi, -48(%rbp)
	movl	-44(%rbp), %edx
	movq	%r14, %rdi
	movl	$64, %esi
	callq	_pci_write_config_word
	movl	-48(%rbp), %edx
	movq	%r14, %rdi
	movl	$68, %esi
	callq	_pci_write_config_byte
LBB0_3:
	leaq	_it8213_set_pio_mode.tune_lock(%rip), %rdi
	callq	_spin_unlock_irqrestore
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_it8213_set_pio_mode.tune_lock,4,2 ## @it8213_set_pio_mode.tune_lock
	.section	__TEXT,__const
	.p2align	4                               ## @it8213_set_pio_mode.timings
_it8213_set_pio_mode.timings:
	.space	8
	.space	8
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3

	.comm	_ide_disk,8,3                   ## @ide_disk
	.no_dead_strip	_it8213_set_pio_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function it8213_set_pio_mode
_it8213_set_pio_mode:                   ; @it8213_set_pio_mode
	.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	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #16]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w22, [x21]
Lloh0:
	adrp	x0, _it8213_set_pio_mode.tune_lock@PAGE
Lloh1:
	add	x0, x0, _it8213_set_pio_mode.tune_lock@PAGEOFF
	bl	_spin_lock_irqsave
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #64
	bl	_pci_read_config_word
	cmp	w20, #1
	cset	w8, gt
	ldr	x9, [x21, #8]
Lloh2:
	adrp	x10, _ide_disk@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ide_disk@GOTPAGEOFF]
Lloh4:
	ldr	x10, [x10]
	orr	w11, w8, #0x4
	cmp	x9, x10
	csel	w23, w8, w11, eq
	mov	x0, x21
	mov	x1, x20
	bl	_ide_pio_need_iordy
	orr	w8, w23, #0x2
	cmp	x0, #0
	csel	w8, w23, w8, eq
	ldr	w9, [sp, #12]
	tbnz	w22, #0, LBB0_2
; %bb.1:
	mov	w10, #-13064
	and	w9, w9, w10
	cmp	w20, #1
	csel	w8, w8, wzr, gt
	orr	w8, w9, w8
Lloh5:
	adrp	x9, _it8213_set_pio_mode.timings@PAGE
Lloh6:
	add	x9, x9, _it8213_set_pio_mode.timings@PAGEOFF
	add	x9, x9, w20, sxtw #3
	ldp	w10, w9, [x9]
	orr	w8, w8, w10, lsl #12
	orr	w2, w8, w9, lsl #8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #64
	bl	_pci_write_config_word
	b	LBB0_3
LBB0_2:
	mov	w10, #-16497
	and	w9, w9, w10
	mov	w10, #16384
	mov	w11, #16384
	bfi	w11, w8, #4, #3
	cmp	w20, #1
	csel	w8, w11, w10, gt
	orr	w8, w8, w9
	str	w8, [sp, #12]
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #68
	bl	_pci_read_config_byte
	ldp	w8, w2, [sp, #8]
	and	w8, w8, #0xf0
Lloh7:
	adrp	x9, _it8213_set_pio_mode.timings@PAGE
Lloh8:
	add	x9, x9, _it8213_set_pio_mode.timings@PAGEOFF
	add	x9, x9, w20, sxtw #3
	ldp	w10, w9, [x9]
	orr	w8, w8, w10, lsl #2
	orr	w8, w8, w9
	str	w8, [sp, #8]
	mov	x0, x19
	mov	w1, #64
	bl	_pci_write_config_word
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	w1, #68
	bl	_pci_write_config_byte
LBB0_3:
Lloh9:
	adrp	x0, _it8213_set_pio_mode.tune_lock@PAGE
Lloh10:
	add	x0, x0, _it8213_set_pio_mode.tune_lock@PAGEOFF
	bl	_spin_unlock_irqrestore
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_it8213_set_pio_mode.tune_lock,4,2 ; @it8213_set_pio_mode.tune_lock
	.section	__TEXT,__const
	.p2align	2                               ; @it8213_set_pio_mode.timings
_it8213_set_pio_mode.timings:
	.space	8
	.space	8
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3

	.comm	_ide_disk,8,3                   ; @ide_disk
	.no_dead_strip	_it8213_set_pio_mode
.subsections_via_symbols
