	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cs5536_set_dma_mode
_cs5536_set_dma_mode:                   ## @cs5536_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	%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
	movl	(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	testb	$1, (%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), %r15d
	movq	%rbx, %rdi
	callq	_ide_get_drivedata
	movq	%rax, %r12
	movslq	4(%rbx), %r13
	movq	_ETC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	callq	_cs5536_read
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r13d
	jge	LBB0_4
## %bb.5:
	movq	_IDE_ETC_UDMA_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	%eax, -44(%rbp)
	movq	_IDE_DRV_MASK@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	andq	%rax, %r12
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	subq	%rax, %r13
	leaq	_cs5536_set_dma_mode.mwdma_timings(%rip), %rax
	movl	(%rax,%r13,4), %eax
	shll	$8, %eax
	movslq	%eax, %rsi
	orq	%r12, %rsi
	movq	%rbx, %rdi
	callq	_ide_set_drivedata
	movl	-44(%rbp), %edx
	jmp	LBB0_6
LBB0_4:
	movq	_IDE_DRV_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%r15d, %ecx
	shll	%cl, %esi
	notl	%esi
	subl	%eax, %r13d
	movslq	%r13d, %rax
	leaq	_cs5536_set_dma_mode.udma_timings(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	movl	%r15d, %ecx
	shll	%cl, %edx
	andl	-44(%rbp), %esi
	orl	%esi, %edx
	movl	%edx, -44(%rbp)
LBB0_6:
	movq	_ETC@GOTPCREL(%rip), %rax
	movl	(%rax), %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_dma_mode.udma_timings
_cs5536_set_dma_mode.udma_timings:
	.long	194                             ## 0xc2
	.long	193                             ## 0xc1
	.long	192                             ## 0xc0
	.long	196                             ## 0xc4
	.long	197                             ## 0xc5
	.long	198                             ## 0xc6

	.p2align	2                               ## @cs5536_set_dma_mode.mwdma_timings
_cs5536_set_dma_mode.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	_ETC,4,2                        ## @ETC
	.comm	_XFER_UDMA_0,4,2                ## @XFER_UDMA_0
	.comm	_IDE_DRV_MASK,4,2               ## @IDE_DRV_MASK
	.comm	_IDE_ETC_UDMA_MASK,4,2          ## @IDE_ETC_UDMA_MASK
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.no_dead_strip	_cs5536_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 cs5536_set_dma_mode
_cs5536_set_dma_mode:                   ; @cs5536_set_dma_mode
	.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	w0, [x0]
	bl	_to_pci_dev
	mov	x19, x0
Lloh0:
	adrp	x8, _IDE_D1_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDE_D1_SHIFT@GOTPAGEOFF]
	ldr	w9, [x20]
Lloh2:
	adrp	x10, _IDE_D0_SHIFT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _IDE_D0_SHIFT@GOTPAGEOFF]
	tst	w9, #0x1
	csel	x8, x10, x8, eq
	ldr	w23, [x8]
	mov	x0, x20
	bl	_ide_get_drivedata
	mov	x21, x0
	ldr	w24, [x20, #4]
Lloh4:
	adrp	x22, _ETC@GOTPAGE
Lloh5:
	ldr	x22, [x22, _ETC@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_cs5536_read
Lloh6:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	subs	w8, w24, w8
	b.ge	LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _IDE_ETC_UDMA_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IDE_ETC_UDMA_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	lsl	w8, w8, w23
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
Lloh12:
	adrp	x8, _IDE_DRV_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IDE_DRV_MASK@GOTPAGEOFF]
Lloh14:
	ldrsw	x8, [x8]
	and	x8, x21, x8
Lloh15:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh16:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _cs5536_set_dma_mode.mwdma_timings@PAGE
Lloh19:
	add	x10, x10, _cs5536_set_dma_mode.mwdma_timings@PAGEOFF
	sub	w9, w24, w9
	ldr	w9, [x10, w9, sxtw #2]
	lsl	w9, w9, #8
	sxtw	x9, w9
	orr	x1, x8, x9
	mov	x0, x20
	bl	_ide_set_drivedata
	ldr	w2, [sp, #12]
	b	LBB0_3
LBB0_2:
Lloh20:
	adrp	x9, _IDE_DRV_MASK@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IDE_DRV_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	lsl	w9, w9, w23
	ldr	w10, [sp, #12]
Lloh23:
	adrp	x11, _cs5536_set_dma_mode.udma_timings@PAGE
Lloh24:
	add	x11, x11, _cs5536_set_dma_mode.udma_timings@PAGEOFF
	bic	w9, w10, w9
	ldr	w8, [x11, w8, sxtw #2]
	lsl	w8, w8, w23
	orr	w2, w8, w9
	str	w2, [sp, #12]
LBB0_3:
	ldr	w1, [x22]
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @cs5536_set_dma_mode.udma_timings
_cs5536_set_dma_mode.udma_timings:
	.long	194                             ; 0xc2
	.long	193                             ; 0xc1
	.long	192                             ; 0xc0
	.long	196                             ; 0xc4
	.long	197                             ; 0xc5
	.long	198                             ; 0xc6

	.p2align	2                               ; @cs5536_set_dma_mode.mwdma_timings
_cs5536_set_dma_mode.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	_ETC,4,2                        ; @ETC
	.comm	_XFER_UDMA_0,4,2                ; @XFER_UDMA_0
	.comm	_IDE_DRV_MASK,4,2               ; @IDE_DRV_MASK
	.comm	_IDE_ETC_UDMA_MASK,4,2          ; @IDE_ETC_UDMA_MASK
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.no_dead_strip	_cs5536_set_dma_mode
.subsections_via_symbols
