	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sc1200_set_dma_mode
_sc1200_set_dma_mode:                   ## @sc1200_set_dma_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movl	8(%r14), %edi
	callq	_to_pci_dev
	xorl	%ebx, %ebx
	cmpq	$0, (%r14)
	movq	%rax, %r14
	setne	%bl
	shll	$4, %ebx
	orl	$64, %ebx
	xorl	%eax, %eax
	callq	_sc1200_get_pci_clock
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%r12, %rcx
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rdx
	cmovgq	(%rdx), %rcx
	movzwl	%ax, %eax
	leaq	_sc1200_set_dma_mode.mwdma_timing(%rip), %rdx
	leaq	_sc1200_set_dma_mode.udma_timing(%rip), %rsi
	cmovgq	%rdx, %rsi
	subq	%rcx, %r12
	leaq	(%rax,%rax,2), %rax
	leaq	(%rsi,%rax,4), %rax
	movl	(%rax,%r12,4), %r12d
	testb	$1, (%r15)
	jne	LBB0_2
## %bb.1:
	orl	$4, %ebx
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_read_config_dword
	movl	$-2147483648, %edx              ## imm = 0x80000000
	andl	-36(%rbp), %edx
	orl	%r12d, %edx
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_pci_write_config_dword
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	orl	$12, %ebx
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pci_write_config_dword         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @sc1200_set_dma_mode.udma_timing
_sc1200_set_dma_mode.udma_timing:
	.long	9572944                         ## 0x921250
	.long	9507136                         ## 0x911140
	.long	9506864                         ## 0x911030
	.long	9643120                         ## 0x932470
	.long	9577056                         ## 0x922260
	.long	9576768                         ## 0x922140
	.long	9713313                         ## 0x9436a1
	.long	9647233                         ## 0x933481
	.long	9581153                         ## 0x923261

	.p2align	4                               ## @sc1200_set_dma_mode.mwdma_timing
_sc1200_set_dma_mode.mwdma_timing:
	.long	489329                          ## 0x77771
	.long	74017                           ## 0x12121
	.long	8224                            ## 0x2020
	.long	768946                          ## 0xbbbb2
	.long	148033                          ## 0x24241
	.long	78129                           ## 0x13131
	.long	1048563                         ## 0xffff3
	.long	217938                          ## 0x35352
	.long	86353                           ## 0x15151

	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,8,3              ## @XFER_MW_DMA_0
	.no_dead_strip	_sc1200_set_dma_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sc1200_set_dma_mode
_sc1200_set_dma_mode:                   ; @sc1200_set_dma_mode
	.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	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #8]
	ldr	w0, [x22, #8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	x8, [x22]
	cmp	x8, #0
	mov	w8, #80
	mov	w9, #64
	csel	w22, w9, w8, eq
	bl	_sc1200_get_pci_clock
Lloh0:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x20
	csel	x8, x9, x8, gt
Lloh6:
	adrp	x9, _sc1200_set_dma_mode.udma_timing@PAGE
Lloh7:
	add	x9, x9, _sc1200_set_dma_mode.udma_timing@PAGEOFF
Lloh8:
	adrp	x10, _sc1200_set_dma_mode.mwdma_timing@PAGE
Lloh9:
	add	x10, x10, _sc1200_set_dma_mode.mwdma_timing@PAGEOFF
	csel	x9, x10, x9, gt
	sub	x8, x20, x8
	mov	w10, #12
	umaddl	x9, w0, w10, x9
	ldr	w20, [x9, x8, lsl #2]
	ldrb	w8, [x21]
	tbnz	w8, #0, LBB0_2
; %bb.1:
	orr	w21, w22, #0x4
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	and	w8, w8, #0x80000000
	orr	w2, w8, w20
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_dword
	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
LBB0_2:
	orr	w1, w22, #0xc
	mov	x0, x19
	mov	x2, x20
	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
	b	_pci_write_config_dword
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @sc1200_set_dma_mode.udma_timing
_sc1200_set_dma_mode.udma_timing:
	.long	9572944                         ; 0x921250
	.long	9507136                         ; 0x911140
	.long	9506864                         ; 0x911030
	.long	9643120                         ; 0x932470
	.long	9577056                         ; 0x922260
	.long	9576768                         ; 0x922140
	.long	9713313                         ; 0x9436a1
	.long	9647233                         ; 0x933481
	.long	9581153                         ; 0x923261

	.p2align	2                               ; @sc1200_set_dma_mode.mwdma_timing
_sc1200_set_dma_mode.mwdma_timing:
	.long	489329                          ; 0x77771
	.long	74017                           ; 0x12121
	.long	8224                            ; 0x2020
	.long	768946                          ; 0xbbbb2
	.long	148033                          ; 0x24241
	.long	78129                           ; 0x13131
	.long	1048563                         ; 0xffff3
	.long	217938                          ; 0x35352
	.long	86353                           ; 0x15151

	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,8,3              ; @XFER_MW_DMA_0
	.no_dead_strip	_sc1200_set_dma_mode
.subsections_via_symbols
