	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sis_66_set_dmamode
_sis_66_set_dmamode:                    ## @sis_66_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
	pushq	%rax
	.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), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movslq	(%rbx), %r12
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	movslq	(%rax), %r13
	movq	%rbx, %rdi
	callq	_sis_old_port_base
	movl	%eax, %r15d
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_pci_read_config_word
	movslq	(%rbx), %rax
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rax, %rcx
	jle	LBB0_2
## %bb.1:
	subq	%r13, %r12
	movl	$-34576, %edx                   ## imm = 0xFFFF78F0
	andl	-44(%rbp), %edx
	leaq	l___const.sis_66_set_dmamode.mwdma_bits(%rip), %rax
	leaq	(%rax,%r12,4), %rax
	jmp	LBB0_3
LBB0_2:
	movl	$-61441, %edx                   ## imm = 0xFFFF0FFF
	andl	-44(%rbp), %edx
	subl	%ecx, %eax
	cltq
	leaq	l___const.sis_66_set_dmamode.udma_bits(%rip), %rcx
	leaq	(%rcx,%rax,4), %rax
LBB0_3:
	orl	(%rax), %edx
	movl	%edx, -44(%rbp)
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_pci_write_config_word
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.section	__TEXT,__const
	.p2align	2                               ## @__const.sis_66_set_dmamode.mwdma_bits
l___const.sis_66_set_dmamode.mwdma_bits:
	.long	8                               ## 0x8
	.long	770                             ## 0x302
	.long	769                             ## 0x301

	.p2align	4                               ## @__const.sis_66_set_dmamode.udma_bits
l___const.sis_66_set_dmamode.udma_bits:
	.long	61440                           ## 0xf000
	.long	53248                           ## 0xd000
	.long	45056                           ## 0xb000
	.long	40960                           ## 0xa000
	.long	36864                           ## 0x9000
	.long	32768                           ## 0x8000

	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.no_dead_strip	_sis_66_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sis_66_set_dmamode
_sis_66_set_dmamode:                    ; @sis_66_set_dmamode
	.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	x21, x1
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w22, [x21]
Lloh0:
	adrp	x8, _XFER_MW_DMA_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	mov	x0, x21
	bl	_sis_old_port_base
	mov	x20, x0
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	_pci_read_config_word
	ldrsw	x8, [x21]
Lloh3:
	adrp	x9, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.le	LBB0_2
; %bb.1:
	sub	w9, w22, w23
	ldr	w8, [sp, #12]
	mov	w10, #-34576
	and	w8, w8, w10
Lloh6:
	adrp	x10, l___const.sis_66_set_dmamode.mwdma_bits@PAGE
Lloh7:
	add	x10, x10, l___const.sis_66_set_dmamode.mwdma_bits@PAGEOFF
	b	LBB0_3
LBB0_2:
	sub	w9, w8, w9
	ldr	w8, [sp, #12]
	and	w8, w8, #0xffff0fff
Lloh8:
	adrp	x10, l___const.sis_66_set_dmamode.udma_bits@PAGE
Lloh9:
	add	x10, x10, l___const.sis_66_set_dmamode.udma_bits@PAGEOFF
LBB0_3:
	add	x9, x10, w9, sxtw #2
	ldr	w9, [x9]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_word
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.section	__TEXT,__const
	.p2align	2                               ; @__const.sis_66_set_dmamode.mwdma_bits
l___const.sis_66_set_dmamode.mwdma_bits:
	.long	8                               ; 0x8
	.long	770                             ; 0x302
	.long	769                             ; 0x301

	.p2align	2                               ; @__const.sis_66_set_dmamode.udma_bits
l___const.sis_66_set_dmamode.udma_bits:
	.long	61440                           ; 0xf000
	.long	53248                           ; 0xd000
	.long	45056                           ; 0xb000
	.long	40960                           ; 0xa000
	.long	36864                           ; 0x9000
	.long	32768                           ; 0x8000

	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.no_dead_strip	_sis_66_set_dmamode
.subsections_via_symbols
