	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ali_set_dma_mode
_ali_set_dma_mode:                      ## @ali_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_to_pci_dev
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_ide_get_pair_dev
	movq	%rax, %r15
	movq	_ide_pci_clk@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movl	$33, %ecx
	cmovnel	%eax, %ecx
	movl	$1000000, %eax                  ## imm = 0xF4240
	xorl	%edx, %edx
	idivl	%ecx
	movl	(%r13), %ebx
	movl	$0, -52(%rbp)
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rdx
	movl	%ebx, %ecx
	subl	(%rdx), %ecx
	jge	LBB0_5
## %bb.1:
	movslq	%eax, %r12
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	movl	%ebx, %esi
	movq	%r12, %rcx
	movl	$1, %r8d
	callq	_ide_timing_compute
	testq	%r15, %r15
	je	LBB0_4
## %bb.2:
	movl	4(%r15), %esi
	leaq	-56(%rbp), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movq	%r12, %rcx
	movl	$1, %r8d
	callq	_ide_timing_compute
	movq	_IDE_TIMING_SETUP@GOTPCREL(%rip), %rax
	movq	_IDE_TIMING_8BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ide_timing_merge
	movl	(%r15), %esi
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	leaq	-56(%rbp), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	movq	%r12, %rcx
	movl	$1, %r8d
	callq	_ide_timing_compute
	movq	_IDE_TIMING_8BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_IDE_TIMING_SETUP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_ide_timing_merge
LBB0_4:
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%ecx, %ecx
	callq	_ali_program_timings
	jmp	LBB0_7
LBB0_5:
	movslq	%ecx, %rax
	leaq	_ali_set_dma_mode.udma_timing(%rip), %rcx
	movl	(%rcx,%rax,4), %ecx
	movq	%r14, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_ali_program_timings
	movq	_XFER_UDMA_3@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_7
## %bb.6:
	leaq	-52(%rbp), %rdx
	movq	%r12, %rdi
	movl	$75, %esi
	callq	_pci_read_config_byte
	movl	-52(%rbp), %edx
	orl	$1, %edx
	movl	%edx, -52(%rbp)
	movq	%r12, %rdi
	movl	$75, %esi
	callq	_pci_write_config_byte
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @ali_set_dma_mode.udma_timing
_ali_set_dma_mode.udma_timing:
	.long	12                              ## 0xc
	.long	11                              ## 0xb
	.long	10                              ## 0xa
	.long	9                               ## 0x9
	.long	8                               ## 0x8
	.long	15                              ## 0xf
	.long	13                              ## 0xd

	.comm	_ide_pci_clk,4,2                ## @ide_pci_clk
	.comm	_XFER_UDMA_0,4,2                ## @XFER_UDMA_0
	.comm	_IDE_TIMING_SETUP,4,2           ## @IDE_TIMING_SETUP
	.comm	_IDE_TIMING_8BIT,4,2            ## @IDE_TIMING_8BIT
	.comm	_XFER_UDMA_3,4,2                ## @XFER_UDMA_3
	.no_dead_strip	_ali_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 ali_set_dma_mode
_ali_set_dma_mode:                      ; @ali_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	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_to_pci_dev
	mov	x22, x0
	mov	x0, x19
	bl	_ide_get_pair_dev
Lloh0:
	adrp	x8, _ide_pci_clk@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ide_pci_clk@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #33
	cmp	w8, #0
	csel	w8, w9, w8, eq
	ldr	w23, [x19]
	str	wzr, [sp, #12]
Lloh3:
	adrp	x9, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	subs	w9, w23, w9
	b.ge	LBB0_5
; %bb.1:
	mov	x21, x0
	mov	w9, #16960
	movk	w9, #15, lsl #16
	sdiv	w8, w9, w8
	sxtw	x22, w8
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x23
	mov	x3, x22
	mov	w4, #1
	bl	_ide_timing_compute
	cbz	x21, LBB0_4
; %bb.2:
	ldr	w1, [x21, #4]
	mov	x2, sp
	mov	x0, x21
	mov	x3, x22
	mov	w4, #1
	bl	_ide_timing_compute
Lloh6:
	adrp	x23, _IDE_TIMING_SETUP@GOTPAGE
Lloh7:
	ldr	x23, [x23, _IDE_TIMING_SETUP@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh8:
	adrp	x24, _IDE_TIMING_8BIT@GOTPAGE
Lloh9:
	ldr	x24, [x24, _IDE_TIMING_8BIT@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w3, w9, w8
	mov	x0, sp
	add	x1, sp, #8
	add	x2, sp, #8
	bl	_ide_timing_merge
	ldr	w1, [x21]
	cbz	w1, LBB0_4
; %bb.3:
	mov	x2, sp
	mov	x0, x21
	mov	x3, x22
	mov	w4, #1
	bl	_ide_timing_compute
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w3, w9, w8
	mov	x0, sp
	add	x1, sp, #8
	add	x2, sp, #8
	bl	_ide_timing_merge
LBB0_4:
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	mov	w3, #0
	bl	_ali_program_timings
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x8, _ali_set_dma_mode.udma_timing@PAGE
Lloh11:
	add	x8, x8, _ali_set_dma_mode.udma_timing@PAGEOFF
	ldr	w3, [x8, w9, sxtw #2]
	mov	x0, x20
	mov	x1, x19
	mov	x2, #0
	bl	_ali_program_timings
Lloh12:
	adrp	x8, _XFER_UDMA_3@GOTPAGE
Lloh13:
	ldr	x8, [x8, _XFER_UDMA_3@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w23, w8
	b.lt	LBB0_7
; %bb.6:
	add	x2, sp, #12
	mov	x0, x22
	mov	w1, #75
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x1
	str	w2, [sp, #12]
	mov	x0, x22
	mov	w1, #75
	bl	_pci_write_config_byte
LBB0_7:
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @ali_set_dma_mode.udma_timing
_ali_set_dma_mode.udma_timing:
	.long	12                              ; 0xc
	.long	11                              ; 0xb
	.long	10                              ; 0xa
	.long	9                               ; 0x9
	.long	8                               ; 0x8
	.long	15                              ; 0xf
	.long	13                              ; 0xd

	.comm	_ide_pci_clk,4,2                ; @ide_pci_clk
	.comm	_XFER_UDMA_0,4,2                ; @XFER_UDMA_0
	.comm	_IDE_TIMING_SETUP,4,2           ; @IDE_TIMING_SETUP
	.comm	_IDE_TIMING_8BIT,4,2            ; @IDE_TIMING_8BIT
	.comm	_XFER_UDMA_3,4,2                ; @XFER_UDMA_3
	.no_dead_strip	_ali_set_dma_mode
.subsections_via_symbols
