	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oldpiix_set_dmamode
_oldpiix_set_dmamode:                   ## @oldpiix_set_dmamode
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %rdi
	xorl	%eax, %eax
	cmpq	$0, 8(%r14)
	setne	%al
	leal	(%rax,%rax), %r12d
	addl	$64, %r12d
	movl	(%rbx), %eax
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	movl	%r13d, -60(%rbp)
	movq	_XFER_PIO_3@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -56(%rbp)
	movq	_XFER_PIO_4@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -52(%rbp)
	movl	-60(%rbp,%rax,4), %r15d
	leaq	-64(%rbp), %rdx
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, %esi
	callq	_pci_read_config_word
	movq	8(%rbx), %rax
	movq	_ATA_DEV_ATA@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	shll	$2, %edx
	xorl	%eax, %eax
	cmpl	%r15d, 16(%rbx)
	setb	%al
	leal	(%rdx,%rax,8), %ecx
	addl	$3, %ecx
	cmpq	$0, 24(%rbx)
	movl	-64(%rbp), %eax
	je	LBB0_1
## %bb.2:
	andl	$52238, %eax                    ## imm = 0xCC0E
	shll	$4, %ecx
	jmp	LBB0_3
LBB0_1:
	andl	$52448, %eax                    ## imm = 0xCCE0
LBB0_3:
	orl	%ecx, %eax
	subl	%r13d, %r15d
	movslq	%r15d, %rcx
	leaq	_oldpiix_set_dmamode.timings(%rip), %rdx
	movl	(%rdx,%rcx,8), %esi
	movl	4(%rdx,%rcx,8), %edx
	shll	$12, %esi
	orl	%eax, %esi
	shll	$8, %edx
	orl	%esi, %edx
	movl	%edx, -64(%rbp)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	callq	_pci_write_config_word
	movq	%rbx, (%r14)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @oldpiix_set_dmamode.timings
_oldpiix_set_dmamode.timings:
	.space	8
	.space	8
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	2                               ## 0x2
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3

	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.comm	_XFER_PIO_0,4,2                 ## @XFER_PIO_0
	.comm	_XFER_PIO_3,4,2                 ## @XFER_PIO_3
	.comm	_XFER_PIO_4,4,2                 ## @XFER_PIO_4
	.comm	_ATA_DEV_ATA,8,3                ## @ATA_DEV_ATA
	.no_dead_strip	_oldpiix_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oldpiix_set_dmamode
_oldpiix_set_dmamode:                   ; @oldpiix_set_dmamode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	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
Lloh3:
	adrp	x8, _XFER_MW_DMA_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_MW_DMA_0@GOTPAGEOFF]
	ldr	w9, [x19]
Lloh5:
	ldr	w8, [x8]
	sub	w8, w9, w8
Lloh6:
	adrp	x9, _XFER_PIO_0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _XFER_PIO_0@GOTPAGEOFF]
Lloh8:
	ldr	w23, [x9]
Lloh9:
	adrp	x9, _XFER_PIO_3@GOTPAGE
Lloh10:
	ldr	x9, [x9, _XFER_PIO_3@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _XFER_PIO_4@GOTPAGE
Lloh13:
	ldr	x10, [x10, _XFER_PIO_4@GOTPAGEOFF]
	stp	w23, w9, [sp, #12]
Lloh14:
	ldr	w9, [x10]
	str	w9, [sp, #20]
	add	x9, sp, #12
	ldr	w24, [x9, w8, uxtw #2]
	add	x2, sp, #8
	mov	x1, x22
	bl	_pci_read_config_word
	ldr	x8, [x19, #8]
Lloh15:
	adrp	x9, _ATA_DEV_ATA@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ATA_DEV_ATA@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #3
	mov	w9, #7
	csel	w8, w9, w8, eq
	ldr	w9, [x19, #16]
	orr	w10, w8, #0x8
	cmp	w9, w24
	csel	w8, w10, w8, lo
	ldr	x9, [x19, #24]
	ldr	w10, [sp, #8]
	mov	w11, #52238
	and	w11, w10, w11
	bfi	w11, w8, #4, #4
	mov	w12, #52448
	and	w10, w10, w12
	orr	w8, w10, w8
	cmp	x9, #0
	csel	w8, w11, w8, ne
	sub	w9, w24, w23
Lloh18:
	adrp	x10, _oldpiix_set_dmamode.timings@PAGE
Lloh19:
	add	x10, x10, _oldpiix_set_dmamode.timings@PAGEOFF
	add	x9, x10, w9, sxtw #3
	ldp	w10, w9, [x9]
	orr	w8, w8, w10, lsl #12
	orr	w2, w8, w9, lsl #8
	str	w2, [sp, #8]
	mov	x0, x21
	mov	x1, x22
	bl	_pci_write_config_word
	str	x19, [x20]
	ldr	x8, [sp, #24]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_2:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @oldpiix_set_dmamode.timings
_oldpiix_set_dmamode.timings:
	.space	8
	.space	8
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	2                               ; 0x2
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3

	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.comm	_XFER_PIO_0,4,2                 ; @XFER_PIO_0
	.comm	_XFER_PIO_3,4,2                 ; @XFER_PIO_3
	.comm	_XFER_PIO_4,4,2                 ; @XFER_PIO_4
	.comm	_ATA_DEV_ATA,8,3                ; @ATA_DEV_ATA
	.no_dead_strip	_oldpiix_set_dmamode
.subsections_via_symbols
