	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function artop6260_set_dmamode
_artop6260_set_dmamode:                 ## @artop6260_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movq	8(%rbx), %rax
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	setne	%dl
	leal	(%rdx,%rdx,2), %edx
	incl	%edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_artop6260_load_piomode
	movq	(%r15), %rsi
	addq	$68, %rsi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	movl	16(%rbx), %ecx
	shll	$2, %ecx
	movl	$7, %edx
	shll	%cl, %edx
	notl	%edx
	andl	-28(%rbp), %edx
	movl	%edx, -28(%rbp)
	movq	8(%rbx), %rax
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpq	%rsi, %rax
	jl	LBB0_2
## %bb.1:
	movq	_clock@GOTPCREL(%rip), %rdi
	addl	(%rdi), %esi
	subl	%esi, %eax
	incl	%eax
	movl	$1, %esi
	cmovnel	%eax, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %esi
	orl	%esi, %edx
	movl	%edx, -28(%rbp)
LBB0_2:
	movq	(%r15), %rsi
	addq	$68, %rsi
	movq	%r14, %rdi
	callq	_pci_write_config_byte
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_PIO_0,4,2                 ## @XFER_PIO_0
	.comm	_XFER_MW_DMA_0,8,3              ## @XFER_MW_DMA_0
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_clock,8,3                      ## @clock
	.no_dead_strip	_artop6260_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function artop6260_set_dmamode
_artop6260_set_dmamode:                 ; @artop6260_set_dmamode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x20, x0
	ldr	x8, [x21, #8]
Lloh0:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #4
	csinc	w2, w8, wzr, ne
	mov	x0, x19
	mov	x1, x21
	bl	_artop6260_load_piomode
	ldr	x8, [x19]
	add	x1, x8, #68
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_byte
	ldr	w8, [x21, #16]
	lsl	w8, w8, #2
	mov	w9, #7
	lsl	w9, w9, w8
	ldr	w10, [sp, #12]
	bic	w2, w10, w9
	str	w2, [sp, #12]
	ldr	x9, [x21, #8]
Lloh3:
	adrp	x10, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x10, [x10, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x9, x10
	b.lt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x11, _clock@GOTPAGE
Lloh7:
	ldr	x11, [x11, _clock@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	add	w10, w10, w11
	sub	w9, w9, w10
	cmn	w9, #1
	mov	w10, #1
	csinc	w9, w10, w9, eq
	lsl	w8, w9, w8
	orr	w2, w8, w2
	str	w2, [sp, #12]
LBB0_2:
	ldr	x8, [x19]
	add	x1, x8, #68
	mov	x0, x20
	bl	_pci_write_config_byte
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_PIO_0,4,2                 ; @XFER_PIO_0
	.comm	_XFER_MW_DMA_0,8,3              ; @XFER_MW_DMA_0
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_clock,8,3                      ; @clock
	.no_dead_strip	_artop6260_set_dmamode
.subsections_via_symbols
