	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmac_ide_set_dma_mode
_pmac_ide_set_dma_mode:                 ## @pmac_ide_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, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_dev_get_drvdata
	movl	(%r15), %ebx
	andl	$1, %ebx
	movq	8(%rax), %r12
	movl	(%r12,%rbx,4), %ecx
	movl	%ecx, -48(%rbp)
	movl	8(%r12,%rbx,4), %edx
	leaq	-44(%rbp), %rcx
	movl	%edx, -44(%rbp)
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rdx
	movq	(%rax), %rsi
	cmpq	%r14, (%rdx)
	jbe	LBB0_1
## %bb.12:
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movq	%r14, %r8
	callq	_set_timings_mdma
	jmp	LBB0_9
LBB0_1:
	movq	_controller_kl_ata4@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_3
## %bb.2:
	leaq	-48(%rbp), %rdi
	movq	%r14, %rsi
	callq	_set_timings_udma_ata4
	jmp	LBB0_8
LBB0_3:
	movq	_controller_un_ata6@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_5
## %bb.4:
	movq	_controller_k2_ata6@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	je	LBB0_5
## %bb.6:
	movq	_controller_sh_ata6@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_10
## %bb.7:
	leaq	-48(%rbp), %rdi
	movq	%rcx, %rsi
	movq	%r14, %rdx
	callq	_set_timings_udma_shasta
	jmp	LBB0_8
LBB0_5:
	leaq	-48(%rbp), %rdi
	movq	%rcx, %rsi
	movq	%r14, %rdx
	callq	_set_timings_udma_ata6
LBB0_8:
	testl	%eax, %eax
	jne	LBB0_10
LBB0_9:
	movl	-48(%rbp), %eax
	movl	%eax, (%r12,%rbx,4)
	orq	$2, %rbx
	movl	-44(%rbp), %eax
	movl	%eax, (%r12,%rbx,4)
	movq	%r15, %rdi
	callq	_pmac_ide_do_update_timings
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_controller_kl_ata4,8,3         ## @controller_kl_ata4
	.comm	_controller_un_ata6,8,3         ## @controller_un_ata6
	.comm	_controller_k2_ata6,8,3         ## @controller_k2_ata6
	.comm	_controller_sh_ata6,8,3         ## @controller_sh_ata6
	.no_dead_strip	_pmac_ide_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 pmac_ide_set_dma_mode
_pmac_ide_set_dma_mode:                 ; @pmac_ide_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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_dev_get_drvdata
	ldr	w8, [x19]
	and	x22, x8, #0x1
	ldr	x21, [x0, #8]
	mov	w23, #2
	ldr	w9, [x21, x22, lsl #2]
	bfxil	x23, x8, #0, #1
	str	w9, [sp]
	ldr	w8, [x21, x23, lsl #2]
	mov	x9, sp
	add	x3, x9, #4
	str	w8, [sp, #4]
Lloh3:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x1, [x0]
	cmp	x8, x20
	b.ls	LBB0_2
; %bb.1:
	mov	x2, sp
	mov	x0, x19
	mov	x4, x20
	bl	_set_timings_mdma
	b	LBB0_8
LBB0_2:
Lloh6:
	adrp	x8, _controller_kl_ata4@GOTPAGE
Lloh7:
	ldr	x8, [x8, _controller_kl_ata4@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_4
; %bb.3:
	mov	x0, sp
	mov	x1, x20
	bl	_set_timings_udma_ata4
	cbnz	w0, LBB0_9
	b	LBB0_8
LBB0_4:
Lloh9:
	adrp	x8, _controller_un_ata6@GOTPAGE
Lloh10:
	ldr	x8, [x8, _controller_un_ata6@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
Lloh12:
	adrp	x9, _controller_k2_ata6@GOTPAGE
Lloh13:
	ldr	x9, [x9, _controller_k2_ata6@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x1, x8
	ccmp	x1, x9, #4, ne
	b.ne	LBB0_6
; %bb.5:
	mov	x0, sp
	mov	x1, x3
	mov	x2, x20
	bl	_set_timings_udma_ata6
	cbnz	w0, LBB0_9
	b	LBB0_8
LBB0_6:
Lloh15:
	adrp	x8, _controller_sh_ata6@GOTPAGE
Lloh16:
	ldr	x8, [x8, _controller_sh_ata6@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_9
; %bb.7:
	mov	x0, sp
	mov	x1, x3
	mov	x2, x20
	bl	_set_timings_udma_shasta
	cbnz	w0, LBB0_9
LBB0_8:
	ldr	w8, [sp]
	str	w8, [x21, x22, lsl #2]
	ldr	w8, [sp, #4]
	str	w8, [x21, x23, lsl #2]
	mov	x0, x19
	bl	_pmac_ide_do_update_timings
LBB0_9:
	ldr	x8, [sp, #8]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	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
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_controller_kl_ata4,8,3         ; @controller_kl_ata4
	.comm	_controller_un_ata6,8,3         ; @controller_un_ata6
	.comm	_controller_k2_ata6,8,3         ; @controller_k2_ata6
	.comm	_controller_sh_ata6,8,3         ; @controller_sh_ata6
	.no_dead_strip	_pmac_ide_set_dma_mode
.subsections_via_symbols
