	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cs5536_set_dmamode
_cs5536_set_dmamode:                    ## @cs5536_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
	cmpq	$0, 8(%rbx)
	jne	LBB0_1
## %bb.2:
	movq	_IDE_D0_SHIFT@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_IDE_D1_SHIFT@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %ebx
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %r13
	cmpl	(%r13), %r12d
	jge	LBB0_4
## %bb.5:
	movq	_DTC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_cs5536_read
	movq	_IDE_DRV_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	notl	%eax
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	subq	%rcx, %r12
	leaq	_cs5536_set_dmamode.mwdma_timings(%rip), %rcx
	movl	(%rcx,%r12,4), %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	andl	-48(%rbp), %eax
	orl	%eax, %edx
	movl	%edx, -48(%rbp)
	jmp	LBB0_6
LBB0_4:
	movq	_ETC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_cs5536_read
	movq	_IDE_DRV_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	notl	%eax
	movslq	(%r13), %rcx
	subq	%rcx, %r12
	leaq	_cs5536_set_dmamode.udma_timings(%rip), %rcx
	movl	(%rcx,%r12,4), %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	andl	-44(%rbp), %eax
	orl	%eax, %edx
	movl	%edx, -44(%rbp)
LBB0_6:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_cs5536_write
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @cs5536_set_dmamode.udma_timings
_cs5536_set_dmamode.udma_timings:
	.long	194                             ## 0xc2
	.long	193                             ## 0xc1
	.long	192                             ## 0xc0
	.long	196                             ## 0xc4
	.long	197                             ## 0xc5
	.long	198                             ## 0xc6

	.p2align	2                               ## @cs5536_set_dmamode.mwdma_timings
_cs5536_set_dmamode.mwdma_timings:
	.long	103                             ## 0x67
	.long	33                              ## 0x21
	.long	32                              ## 0x20

	.comm	_IDE_D1_SHIFT,4,2               ## @IDE_D1_SHIFT
	.comm	_IDE_D0_SHIFT,4,2               ## @IDE_D0_SHIFT
	.comm	_XFER_UDMA_0,4,2                ## @XFER_UDMA_0
	.comm	_ETC,4,2                        ## @ETC
	.comm	_IDE_DRV_MASK,4,2               ## @IDE_DRV_MASK
	.comm	_DTC,4,2                        ## @DTC
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.no_dead_strip	_cs5536_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cs5536_set_dmamode
_cs5536_set_dmamode:                    ; @cs5536_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	x20, x1
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w21, [x20]
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _IDE_D1_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IDE_D1_SHIFT@GOTPAGEOFF]
Lloh2:
	adrp	x10, _IDE_D0_SHIFT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _IDE_D0_SHIFT@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w22, [x8]
Lloh4:
	adrp	x23, _XFER_UDMA_0@GOTPAGE
Lloh5:
	ldr	x23, [x23, _XFER_UDMA_0@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w21, w8
	b.ge	LBB0_2
; %bb.1:
Lloh6:
	adrp	x20, _DTC@GOTPAGE
Lloh7:
	ldr	x20, [x20, _DTC@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	mov	x0, x19
	bl	_cs5536_read
Lloh8:
	adrp	x8, _IDE_DRV_MASK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IDE_DRV_MASK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	lsl	w8, w8, w22
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
Lloh11:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh12:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _cs5536_set_dmamode.mwdma_timings@PAGE
Lloh15:
	add	x10, x10, _cs5536_set_dmamode.mwdma_timings@PAGEOFF
	sub	w9, w21, w9
	ldr	w9, [x10, w9, sxtw #2]
	lsl	w9, w9, w22
	orr	w2, w9, w8
	str	w2, [sp, #12]
	b	LBB0_3
LBB0_2:
Lloh16:
	adrp	x20, _ETC@GOTPAGE
Lloh17:
	ldr	x20, [x20, _ETC@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #8
	mov	x0, x19
	bl	_cs5536_read
Lloh18:
	adrp	x8, _IDE_DRV_MASK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IDE_DRV_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	lsl	w8, w8, w22
	ldr	w9, [sp, #8]
	bic	w8, w9, w8
	ldr	w9, [x23]
Lloh21:
	adrp	x10, _cs5536_set_dmamode.udma_timings@PAGE
Lloh22:
	add	x10, x10, _cs5536_set_dmamode.udma_timings@PAGEOFF
	sub	w9, w21, w9
	ldr	w9, [x10, w9, sxtw #2]
	lsl	w9, w9, w22
	orr	w2, w9, w8
	str	w2, [sp, #8]
LBB0_3:
	ldr	w1, [x20]
	mov	x0, x19
	bl	_cs5536_write
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @cs5536_set_dmamode.udma_timings
_cs5536_set_dmamode.udma_timings:
	.long	194                             ; 0xc2
	.long	193                             ; 0xc1
	.long	192                             ; 0xc0
	.long	196                             ; 0xc4
	.long	197                             ; 0xc5
	.long	198                             ; 0xc6

	.p2align	2                               ; @cs5536_set_dmamode.mwdma_timings
_cs5536_set_dmamode.mwdma_timings:
	.long	103                             ; 0x67
	.long	33                              ; 0x21
	.long	32                              ; 0x20

	.comm	_IDE_D1_SHIFT,4,2               ; @IDE_D1_SHIFT
	.comm	_IDE_D0_SHIFT,4,2               ; @IDE_D0_SHIFT
	.comm	_XFER_UDMA_0,4,2                ; @XFER_UDMA_0
	.comm	_ETC,4,2                        ; @ETC
	.comm	_IDE_DRV_MASK,4,2               ; @IDE_DRV_MASK
	.comm	_DTC,4,2                        ; @DTC
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.no_dead_strip	_cs5536_set_dmamode
.subsections_via_symbols
